Skip to Content

When a Purchase Order is associated with the Sales & Distribution process, always the shipping data is required within PO (Shipping Data tab will comes when user creates PO).

Normally, the Intercompany Purchase Order or STO are belongs to those kinds of purchase orders.

There is a business scenario that is when end user creates an Intercompany Purchase Order or a STO Purchase Order, user wants set the value of Storage loc. for EP (storage location for external procurement : which exists in the MRP 2 view of material master-MM03 ) to the Shipping Point which exists in PO’s Shipping Data tab.

Here is a simple solution to solve this issue, that is use a BAdI to do an Enhancement to realize it.

In the method IF_EX_ME_PROCESS_PO_CUST~PROCESS-ITEM, add the below ABAP source codes:

————-

METHOD IF_EX_ME_PROCESS_PO_CUST~PROCESS-ITEM.

DATA: IS_ITEM         TYPE   MEPOITEM,
           IS_HEADER   TYPE   REF TO IF_PURCHASE_ORDER_MM,
           ITEMS             TYPE   PURCHASE_ORDER_ITEMS,
           ITEM_OBJ      TYPE   PURCHASE_ORDER_ITEM,
           RE_HEADER TYPE    MEPOHEADER,
           MY_EKPV      TYPE    EKPV,
           L_LGFSB       TYPE    LGFSB.

IS_HEADER    = IM_ITEM->GET_HEADER( ).
RE_HEADER  = IS_HEADER->GET_HEADER( ).
IS_ITEM          = IM_ITEM->GET_DATA( ).
ITEMS             = IS_HEADER->GET_ITEMS( ).

IF IS_ITEM-LFRET = ‘ZNLC’.

   IF NOT ITEMS IS INITIAL.
        LOOP AT ITEMS INTO ITEM_OBJ.
                   MY_EKPV = ITEM_OBJ-ITEM->GET_SHIPPING_DATA( ).
        ENDLOOP.
   ENDIF.

  

   SELECT SINGLE LGFSB
       I NTO L_LGFSB
      FROM MARC
   WHERE MATNR = IS_ITEM-MATNR
         AND WERKS = RE_HEADER-FESWK.

 

   IF SY-SUBRC = 0.
        MY_EKPV-VSTEL = L_LGFSB.
   ENDIF.

  

    ITEM_OBJ-ITEM->SET_SHIPPING_DATA( IM_EKPV = MY_EKPV ).

ENDIF.

ENDMETHOD.

————-

Then the value of Storage loc. for EP  will be set to the Shipping Point which exists in that PO’s Shipping Data tab automatically.

Additional:

1.What is Storage loc. for EP ? (Definition from SAP):

Key of the storage location that is proposed in the purchase requisition in materials planning for subsequent storage of the material. In the case of a material procured externally, this storage location is proposed in the planned order in materials planning.

2.What is Shipping Point ? (Definition from SAP):

It is the physical location (for example, a warehouse or collection of loading ramps) from which you ship the item.

You can predefine shipping/receiving points in the system, based on different combinations of a).plants, b).shipping conditions, c).loading groups

During delivery processing, the shipping/receiving point is the most important criterion that you use to select deliveries.A delivery can be shipped from one shipping point only or received at one receiving point only.

Kind Regards.

To report this post you need to login first.

3 Comments

You must be Logged on to comment or reply to a post.

  1. Sagar Petkar

    Hi George,

    I am going to modify sales organization (VKORG) using your given badi but it is not reflecting.
    Can you please help me in to this ?

    Note : Shipping point is updating but sales organization is not updating.

    Thanks in Advance.

    (0) 

Leave a Reply