How to Automatically Update Target Value in Scheduling Agreement (ME32L) Using SAP ABAP Exit

 Automatically Update Target Value in Scheduling Agreement (ME32L) Using SAP ABAP Exit


1. Open SMOD tcode in SAP

- Open your SAP and input SMOD tcode


2. Display Enhancement MM06E005

- Enter MM06E005 and click Display.
- This enhancement contains several exits related to Purchase Orders and Scheduling Agreements.


3. Find the right exit

- Double click on EXIT_SAPMM06E_012.


4. Add Custom ABAP Logic

SAP will redirect you to the include program (ZXM06U43).
Insert the following logic:

CASE sy-tcode.
  WHEN 'ME32L'.
    DATA: lv_zwert TYPE ekpo-zwert.
    FIELD-SYMBOLS: <fs_ekko> TYPE ekko.

    ASSIGN ('(SAPMM06E)EKKO') TO <fs_ekko>.

    LOOP AT tekpo ASSIGNING FIELD-SYMBOLS 
(<fs_ekpo>) WHERE loekz = ' '.

      lv_zwert = lv_zwert + <fs_ekpo>-zwert.

    ENDLOOP.

    <fs_ekko>-ktwrt = lv_zwert.

ENDCASE.


5. Activate and Test

Updating Qty and Net Price in Scheduling Agreement

Scheduling Agreement: Header Data

Fiori Approval








Comments

Popular posts from this blog

SAP ABAP Mass Download Attachment

Learn How to Use STVARV for Dynamic ABAP Programs

Why Can't I Find This Text in SE16N? Mastering the READ_TEXT Function Module