• March 9, 2026
  • Kishore Thutaram
  • 0

Update PO Item Details Using BADI ME_PROCESS_PO_CUST in SAP

Business Scenario:

“Update the Automatic FOC indicator while creating the PO based on a condition.”

Steps: SE19 – Implement the BADI, ME_PROCESS_PO_CUST

Method : PROCESS_ITEM

Implement the below code inside the method :


 "Read Item
        DATA(ls_item) = im_item->get_data( ).

 "Get VKORG value for EKPO-WERKS
        SELECT vkorg  FROM t001w INTO @DATA(lv_vkorg) UP TO 1 ROWS
          WHERE werks = @ls_item-werks .ENDSELECT.
 "Account Assignment Grp Mat.
        SELECT SINGLE ktgrm FROM mvke
          INTO @DATA(lv_ktgrm)
          WHERE matnr = @ls_item-matnr
          AND   vkorg = @lv_vkorg
          AND   vtweg = '00'.
        IF sy-subrc = 0 and lv_ktgrm = '02'.   "Condition
         ls_item-umson = abap_true.
          im_item->set_data( im_data = ls_item ).
        ENDIF.
   
    

Kishore Thutaram

SAP Solution Architect | 16+ Years' Experience in SAP | Sharing Practical SAP Knowledge | Engineering Graduate with Expertise in SAP Architecture

https://fiowelt.com