Expand +



Foreign Procurement: Handling Ownership of Goods in Transit

by Ali Hassan, SAP Procurement Lead, ICI Pakistan and Talha Aftab, SAP Analyst, SAP HCM and ABAP, ICI Pakistan

April 15, 2016

Learn how to handle goods in transit (GIT) during foreign procurement. The process starts with the transfer of ownership at the time of shipment handover. It goes on to storing it in a bonded warehouse at the port of entry (if necessary), and finally to posting it to the company’s material stock account at the time of physical receipt and clearing the GIT account.

Compared with local procurement, foreign procurement brings its own set of requirements. One of them is managing ownership of goods-in-transit (GIT) after a foreign vendor hands over the shipment to the buyer or to its freight forwarding agent. At this point in time, the buying company usually records the value of the GIT in its books for financial reporting and insurance purposes.

This solution caters to the need of managing ownership of GIT and targets the critical gap of transfer of ownership in the SAP system’s standard foreign procurement process. It does so without disrupting the normal process flow of foreign procurement (i.e., purchase order [PO], advance payment, invoice receipt [IR], and goods receipt [GR]). It enables one-step transfer of ownership and provides procurement and finance departments with complete and real-time visibility into GIT quantity and value throughout the shipment duration using enhanced Purchase Orders by PO Number (transaction code ME2N) and G/L Account Line Items (transaction code FBL3N) reports, respectively.

By adopting this solution, the finance officer upon receiving shipment documents transfers the ownership of GIT by processing a vendor invoice for the shipment quantity and value (debiting a special GIT general ledger [G/L] account and crediting the vendor account). When goods arrive at the port of destination and if for the time being they need to be kept in a bonded warehouse.  A bonded warehouse stores goods duty free for a certain period, and then the store officer creates a rough GR with reference to the PO line item. Once the material is physically received at the company’s premises, the store officer processes a GR (debiting the material and crediting the special GIT G/L account).

These features of one-step ownership transfer and intermediate storage in a bonded warehouse and complete visibility during shipment duration distinguish this solution from SAP’s standard solution. The standard solution of acceptance at origin uses movement types 107 and 109 (valuated GR into blocked stock), which increases material stock account at the time of ownership transfer.

Figure 1 shows the process flow of the GIT handling process.

Figure 1
GIT process flow diagram

We now explain in detail the three aspects of this GIT handling solution:

  • Configuration
  • Development
  • Process 
Configuration: Maintain a Special G/L Account for GIT

A special GIT G/L account needs to be maintained so that the system can switch it in place of a normal WRX (GR/IR) account if a PO is issued to a foreign vendor.

To maintain this special GIT G/L account, you need to add a new rule (general modifier [GIT]) in the WRX transaction key. To do this execute transaction code OBYC, and in the screen that appears, double-click the WRX transaction key as shown in Figure 2.

Figure 2
Maintain the WRX transaction key

In the screen that appears, click the Rules button as shown in Figure 3.

Figure 3
Maintain rules in the WRX transaction key

In the next screen, select the General modification check box as shown in Figure 4. You can select Valuation modif. and Valuation class as per your business needs. After you make your selections, click the Accounts button in Figure 4.

Figure 4
Rules maintenance for the GR/IR transaction (WRX)

In the next screen (Figure 5) configure the valuation area or valuation class special GIT G/L accounts based on business needs. Enter a valuation modifier, general modification (GIT), valuation class, and appropriate G/L accounts in the debit or credit columns.

Figure 5
G/L accounts configuration for the GR/IR transaction (WRX)

Development: G/L Switch, Invoice Translation Date, GIT Report

You need to peform three enhancements to switch the G/L account and the invoice translation date, and to add a column in the Purchase Orders by PO Number report for GIT visibility.

Enhancement 1: Switching the GR/IR Account with the Special GIT GL Account

If a PO is for a foreign vendor, this enhancement changes the normal GR/IR account to be used at the time of IR and GR with your choice of account, which in this case is the GIT G/L account. The following enhancement point and code are used:

  • Function exit: EXIT_SAPLKONT_011
  • Enhancement: LMR1M002
  • Include: ZXM08U18

The code for this enhancement is shown in Figure 6.

Figure 6
Code to switch the GR/IR account with a special GIT G/L

The enhancement is executed at the time of invoice posting. The function of this enhancement is to determine if this is a foreign transaction or not by comparing the country keys of the vendor and the company code used in the PO. If the country keys are not the same, then the account modifier is set to GIT, meaning it is a foreign transaction. Because of this setting, the system picks the special G/L account for transaction code WRX with the account modifier GIT.

Enhancement 2: Switching the Invoice Translation Date from the Posting Date to the Invoice Date

This enhancement switches the invoice translation date from the posting date (by default) to the invoice date. This ensures that the invoice value is converted to the local currency based on the exchange rate of the bill of lading or shipment handover date, as required by finance stakeholders. SAP’s provided instructions in Note 574583 (MIRO: BADI for value date) have been followed while programing this enhancement. Specify the INTCA  as the filter type in the Business Add-In (BAdI) implementation if it is not already specified. The following BAdI, method, and code are used:

  • Method: DERIVE_WWERT

(Note: INCTA is a standard SAP filter type for country ISO code.)

This code assigns the document date (BLDAT) to the document translation date (WWERT) as shown in Figure 7.

Figure 7
Code to switch invoice translation date from posting date to invoice date

Enhancement 3: Column Addition in the Purchase Orders by PO Number Report for GIT Visibility

You use this enhancement to add new columns for GIT quantity, GIT value, Bonded quantity, Received (GR) quantity, Invoiced Quantity, and Rough GR Quantity in the Purchase Orders by PO Number report (transaction code ME2N). This is done so the purchasing department can monitor the GIT quantity and value.

To add the columns mentioned above, follow these two steps.

First, you need to create an append structure in data type MEREP_OUTTAB_PURCHDOC and add the required fields. To do this, execute transaction code SE11. In the screen that appears, enter MEREP_OUTTAB_PURCHDOC in the Data type field and click the Display button as shown in Figure 8. This action displays the screen shown in Figure 9.

Figure 8
Enter MEREP_OUTTAB_PURCHDOC as the data type

To display all existing append structures, click the Append Structure... button shown in Figure 9.

Figure 9
Create an append structure for MEREP_OUTTAB_PURCHDOC

In the next figure (Figure 10) click the create icon (the fourth icon from the right) to create a new append structure. In the pop-up screen that appears, enter the name of the new append structure (ZZGIT_ME2N) and click the green check mark or press Enter.

Figure 10
Add the new append structure

Now you need to add components and define a component type for each  field you want to add in the ME2N report as shown in Figure 11.

Figure 11
Add components and component types in the append structure

To create your own field descriptions and field headings to be displayed in the ME2N report, you need to be able to specify field labels for all the fields in the append structure. Therefore, you need to create your own component types. Double-click each component type and define a Data Type (e.g., domain MENGE13) and Field Label as shown in Figures 12 and 13, respectively.

Figure 12
Define a data type for the component type

Figure 13
Define field labels in the component type

Then activate the component type and click the back button to go back to the screen shown in Figure 11. The steps described through Figures 11 through13 must be repeated for each component. After you add the components, the screen look like Figure 14.

Now click the Currency/quantity fields tab (Figure 15). Because these are quantity fields, you need to populate the fields under the Reference table and Ref. Field (reference field) columns in the Currency/quantity fields tab.

Figure 14
All components added and their respective component types created

Figure 15
Define the reference table and the reference field in the Currency/quantity fields tab

After you add all the component types and fields, the append structure screen looks like Figure 16. Click the save icon (not shown) and then click the activate icon.

Figure 16
The newly created append structure

The second step is to add code for the calculation and storage of values in the fields we added in the append structure. To do this, add the code in Figure 17 in the following prescribed enhancement, BAdI, and method.

  • Enhancement: ES_BADI_ME_REPORTING


DATA: ls_ekpo TYPE ekpo,
FIELD-SYMBOLS: <fs_outtab>   TYPE ANY,
<fs_ebeln>    TYPE ebeln,
<fs_ebelp>    TYPE ebelp,
<fs_material> TYPE matnr,
* check that a purchasing document view is displayed
CHECK im_struct_name EQ 'MEREP_OUTTAB_PURCHDOC'   OR    "view: basic list
im_struct_name EQ 'MEREP_OUTTAB_SCHEDLINES' OR    "view: delivery schedule
im_struct_name EQ 'MEREP_OUTTAB_ACCOUNTING'.      "view:account assignment
* loop at the output table and assign a field symbol
LOOP AT ch_outtab ASSIGNING <fs_outtab>.

*-- assign the purchasing document number to a field symbol
CHECK sy-subrc = 0.
*-- assign the purchasing document item number to a field symbol
CHECK sy-subrc = 0.
*-- assign the manufacturer part number to a field symbol
ASSIGN COMPONENT 'EMATN' OF STRUCTURE <fs_outtab> TO <fs_material>.
CHECK sy-subrc = 0.
*-- assign the purchasing document quantity to a field symbol
CHECK sy-subrc = 0.
*-- assign the still to be invoiced quantity to a field symbol
CHECK sy-subrc = 0.
*-- assign the Invoiced quantity to a field symbol
CHECK sy-subrc = 0.
*-- assign the bonded quantity to a field symbol
CHECK sy-subrc = 0.
*-- assign the still to be delivered quantity to a field symbol
CHECK sy-subrc = 0.
*-- assign the GIT quantity to a field symbol
CHECK sy-subrc = 0.
**-- assign the rough GR quantity to a field symbol
CHECK sy-subrc = 0.
**-- assign the GR quantity to a field symbol
CHECK sy-subrc = 0.
**-- assign the GIT VALUE to a field symbol
CHECK sy-subrc = 0.
**-- assign the NETPR to a field symbol
CHECK sy-subrc = 0.
NewPoInd = <FS_EBELN>.

<fs_zzgrqty> = <fs_LAGMG> - <fs_MGLIEF>. "GR QTY = Ordered Qty – Still to be delivered Qty
<fs_ZZINVQTY> = <fs_LAGMG> - <fs_MGINV>. "Invoiced QTY = Ordered Qty – Still to be Invoiced Qty
<fs_ZZGITQTY> = <fs_ZZINVQTY> - <fs_zzgrqty>. " GIT QTY = Invoiced Qty – GR Qty
IF <fs_ZZRGRQTY> > 0.
<fs_ZZBQTY> = <fs_ZZRGRQTY> - <fs_zzgrqty>. "Bonded Qty = Rough GR Qty – GR Qty
<fs_ZZGITQTY> = 0.
<fs_ZZBQTY> = 0.
<fs_ZZGITVAL> = <fs_netpr> * <fs_ZZGITQTY>. "GIT Value = Unit Price * GIT Qty
*-- read the corresponding purchasing document item
pi_ebeln         = <fs_ebeln>
pi_ebelp         = <fs_ebelp>
po_ekpo          = ls_ekpo
no_records_found = 1
OTHERS           = 2.
CHECK sy-subrc = 0.
*-- assign the inventory managed material to the field "Material" in the output table
<fs_material> = ls_ekpo-matnr.
Figure 17
Source code to calculate GIT quantity, GIT value, Bonded quantity, Received (GR) quantity, Invoiced Quantity, and Rough GR Quantity

(Note: This enhancement point is available in enhancement package 4 or higher. Its implementation can be done using the new BAdI option.)

Execute transaction code SE19. In the screen the system displays under the Create Implementation section, select the New BAdI radio button and enter the enhancement name in the Enhancement Spot field. Click Create Impl. button shown in Figure 18. In the pop-up screen, enter an enhancement name in the Enhancement Implementation field and a description in the Short Text field as shown in Figure 18.

Figure 18
Create the enhancement implementation

Press Enter or click the green check mark icon, and in the next screen, enter names in the fields under the Implementation Class and BAdI Definition columns shown in Figure 19.

Figure 19
Define the BAdI for the enhancement

After you define the BAdI, you need to create a new implementation class. A sample implementation class can be copied by selecting the class and clicking the Copy Sample Class buttton as shown in Figure 20.

Figure 20
Create the new implementation class

After you copy the implementation class, double-click the method IF_EX_ME_CHANGE_OUTTAB_CUS~FILL_OUTTAB (shown in Figure 21) to add the code shown in Figure 17.

(Note: Because you have copied a sample class, a sample code is already added to the method. We have added our own code [from Figure 17].)

Figure 21
The method used for the enhancement

The GIT Process

Now we explain each process step to execute the GIT process.

Step 1. Create a Foreign PO

The purchasing officer creates a PO using transaction code ME21N and ensures that the GR-Bsd IV (goods receipt-based invoice) check box is not selected at the line item level. The unchecked GR-Bsd IV box allows the invoice to be posted before the GR (Figure 22).

Figure 22
PO to import material

Step 2. Post the Invoice

Upon receiving shipping documents from a foreign vendor, the finance officer executes transaction code MIRO to post the invoice document with reference to the PO line item. The finance officer needs to maintain the shipment amount in the Amount field and the shipment quantity in the Quantity field as shown in Figure 23. The bill of lading date needs to be maintained in the Invoice date field at the invoice header level in the Basic data tab, as shown in Figure 23. This ensures that the invoice value is converted into local currency based on the exchange rate applicable on the bill of lading date or shipment handover date. Use of the invoice date instead of the posting date for exchange rate conversion helps avoid posting period issues in case the bill of lading date falls in one of the closed periods (Figure 23).

Figure 23
Invoice of imported material

Because of enhancement 1 and the configuration settings, the system debits the special GIT G/L account instead of the normal WRX (GR/IR) account and credits the vendor account according to the exchange rate on the invoice date, due to enhancement 2 (Figure 24).

Figure 24
Accounting entries at the time of posting the invoice

Step 3. Monitor GIT in the Purchase Orders by PO Number Report

The purchase officer can execute transaction code ME2N to monitor GIT quantities and values in the Purchase Orders by PO Number report. You need to add new columns via enhancement 3 for the GIT quantity and value, bonded quantity, and received (GR) quantity as shown in Figure 25. Bonded quantity is the quantity stored in the bonded warehouse using a rough GR.

Figure 25
List of PO line items with GIT and bonded and received quantities

Step 4. Monitor GIT in the G/L Account Line Items Report

The finance officer can execute transaction code FBL3N to monitor the GIT quantity and value in the G/L Account Line Item report on the special GIT G/L account (Figure 26).

Figure 26
Entries in the G/L account used for recording the GIT value

Step 5. Create a Rough GR (into the Bonded Warehouse)

If material needs to be temporarily stored in a bonded warehouse (government or private), then the store officer creates a rough GR with reference to the PO line item.

However, first you have to maintain standard configuration to activate rough GR functionality. Afterward, you need to maintain the Confirmation Control key at the PO line item level as rough GR or Inb. delv./rough GR (inbound delivery/rough GR) as shown in Figure 27.

Figure 27
Set the confirmation control key as rough GR at the PO line item level

(Note: The process of creating a rough GR is beyond the scope of this article. For information on creating a rough goods receipt, click here.)

A rough GR needs to be created with reference to the PO line item level. Execute  transaction code VL41,enter the PO number, and press Enter as shown in Figure 28.

Figure 28
Create a rough GR against the PO

In the next screen at the line item level in the rough GR you need to maintain the quantity that is going to be stored in the bonded warehouse in the DelivNoteQty field and click the save icon as shown in Figure 29.

Figure 29
Maintain the bonded quantity in the rough GR

After you create a rough GR, its quantity starts showing up under the Bonded Qty column along with GIT Qty in the Purchase Orders by PO Number report (Figure 30).

Figure 30
List of PO line items with GIT and bonded quantities

Step 6. Goods Receipt

Upon physical arrival of goods at the company’s premises, the store officer enters a GR using transaction code MIGO. In the screen that opens, select Inbound Delivery from the drop-down list of options in the field at the top of screen. Enter a rough GR number in the field beside the Inbound Delivery. Under the Where tab, enter 101 in the Movement Type field, select the OK check box in the row in which your line item is entered, and then click the Post button as shown in Figure 31.

Figure 31
GR with reference to the PO

After you post the GR document, the system debits the material stock account and credits the special GIT G/L account (due to enhancement 1). The GIT G/L account is cleared after the GR. If delivery costs were added as conditions in the PO, then they are also added to the material value as shown above, where custom duty and incidentals were added. However, the special GIT G/L account is credited with the equivalent amount that was debited at the time of invoice posting (Figure 32).

Figure 32
Accounting entries at the time of posting the GR

An email has been sent to:


Ali Hassan

Ali Hassan leads the SAP Procurement team in ICI Pakistan. With more than eight years’ IT experience as software engineer and SAP consultant, Ali specializes in business software in the areas of purchasing, inbound logistics, and inventory/warehouse management. He holds a bachelor’s in computing and a master’s in information technology.

Talha Aftab

Talha Aftab is an SAP analyst in SAP HCM and ABAP. He has been with ICI Pakistan Limited since 2012. His interests are targeted toward creating a better user experience in SAP, and he is currently working on implementing SAP Fiori and SAP SuccessFactors at ICI Pakistan.


Please log in to post a comment.

No comments have been submitted on this article. Be the first to comment!