SAP Purchase Order creation from MS Excel using Talend

Home / Blog / SAP Purchase Order creation from MS Excel using Talend
SAP Purchase Order creation from MS Excel using Talend

The goal of this article is to emphasize on Talend Data Integration capabilities, features and ease of use especially with SAP.
What is even more important is that using Talend it is possible to create SAP Purchase Orders without need to use abap or any code at all!

The demonstrated scenario cannot be used as is, but needs a number of adjustments to be fully functional.

The scope of the process is to read purchasing data from an excel file, upload the data in SAP using a BAPI and create a Purchase Order.  Errors can be logged, but are not documented in the scenario for simplicity reasons.  Purchase order creation was chosen (instead of purchase requisition), since it requires more information and is more strictly ruled in SAP.

The purchase order that will be created will have four items with account assignment type K (cost center).

The Excel file must contain all required information for the purchase order to be created and is:

Figure 1: Excel structure
Figure 1: Excel structure

When using SAP Bapi, it is essential to define if you will be using multiple input / output parameters or document type input / output parameters.  In this scenario the document input / output is selected.

SAP Bapi input / output is mapped based on the above mentioned selection using a tXMLMap component as shown in figure 2.

Figure 2: PO creation sample job
Figure 2: PO creation sample job

Field mapping is essential, since a mapping misconfiguration would fail to create the purchase order in SAP.

Another very useful Talend feature is the capability to map, therefore log all SAP Bapi input or output tables.  This feature proves to be essential since it allows the user to know the process results (messages) as they are generated in SAP.  SAP generated errors help to identify the reason of the process success / failure and should be logged in an interfacing scenario.

There are three tLogRow components in the process each mapped as follows:

  • tLogRow_6, Bapi return table
  • tLogRow_7, Bapi items table
  • tLogRow_8, Bapi header table

Each component is utilized for process control / mapping verification and can be deleted as soon as the process is finalized.  When processing Talend jobs in background, there is no need for using tLogRow components.

The process is quite simple and as soon as it runs the results are shown in the execution window.

Figure 3: Job results
Figure 3: Job results

All four tLogRow components display the requested information based on their mapping.  The most important is Bapi return table (tLogRow6), which report Bapi return messages from sap.  According to the scenario purchase order 4500001079 was created in SAP.

The purchase order header is as follows:

Figure 4: SAP PO Header
Figure 4: SAP PO Header

Based on the input (excel) all components have account assignment K and their account assignment details are shown in figure 5:

Figure 5: Account assignment details
Figure 5: Account assignment details