• March 6, 2026
  • Kishore Thutaram
  • 0

Update the sales Delivery field values by using the BADI LE_SHP_DELIVERY_PROC

Business Scenario:

“Update the Batch Field value from STO during sales delivery creation.”

Steps: SE19 – create BADI implementation on LE_SHP_DELIVERY_PROC standard BADI

Implement the Interface method – IF_EX_LE_SHP_DELIVERY_PROC~SAVE_DOCUMENT_PREPARE

Implement the code below


 DATA(lv_po) = xlips[ 1 ]-vgbel.
      SELECT SINGLE stopo1, leg2deliv FROM ztable
        INTO @DATA(ls_log)
        WHERE stopo1 = @lv_po.
      IF sy-subrc = 0.

        SELECT vbeln, posnr, charg, uecha
          FROM lips
          INTO TABLE @DATA(lt_lips)
          WHERE vbeln = @ls_log-leg2deliv.
        LOOP AT xlips ASSIGNING .
          READ TABLE lt_lips INTO DATA(ls_lips) WITH KEY uecha = -posnr.
          IF sy-subrc = 0.
*^^* Update batch from STO delivery to the auto PO delivery creation
            -charg = ls_lips-charg.
          ENDIF.
        ENDLOOP.
      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