Hello Everyone
I want to update the Delivery block (LIKP-LIFSK) and show a popup information message in VL01N and VL02N once the 'Save' button is pressed in both these transactions. I have some checks which I'm doing and if the Outbound delivery exists within these checks, then only the pop up should trigger.
Here is my code.
IF NOT ct_xlips[] IS INITIAL.
SELECT COUNT(*) FROM zreachregulation FOR ALL ENTRIES IN ct_xlips WHERE matnr = ct_xlips-matnr.
IF sy-subrc = 0.
cs_likp-lifsk = 'YT'.
CALL FUNCTION 'POPUP_FOR_INTERACTION'
EXPORTING
HEADLINE = text-001
TEXT1 = text-002
TEXT2 = text-003
TICON = 'I'
BUTTON_1 = text-005.
IF SY-SUBRC <> 0.
MESSAGE text-004 TYPE 'E'.
ENDIF.
ENDIF.
ENDIF.
I put this code in the method 'READ_DELIVERY', but this doesn't trigger with the Save button and also doesn't work with VL01N.
How do I do the updation of delivery block using this Badi? in which method should I write my code?
Please help.
Hi Payal,
You can use the method SAVE_DOCUMENT_PREPARE of the BADI LE_SHP_DELIVERY_PROC.
Also make use of interface parameter IF_TRTYP ( 'H' - Add or 'V' - Change) to check if the delivery is being created or changed.
Regards,
Karthikeyan
This is the code I'm adding in the method SAVE_DOCUMENT_PREPARE.
IF NOT ct_xlips[] IS INITIAL.
SELECT COUNT(*) FROM zreachregulation FOR ALL ENTRIES IN ct_xlips
WHERE matnr = ct_xlips-matnr.
IF sy-subrc = 0.
IF wa_xlikp-lifsk IS INITIAL.
wa_xlikp-lifsk = 'ZF'.
ENDIF.
MODIFY ct_xlikp FROM wa_xlikp.
COMMIT WORK AND WAIT.
CALL FUNCTION 'POPUP_FOR_INTERACTION'
EXPORTING
HEADLINE = text-001
TEXT1 = text-002
TEXT2 = text-003
TICON = 'I'
BUTTON_1 = text-005.
IF SY-SUBRC <> 0.
MESSAGE text-004 TYPE 'E'.
ENDIF.
ENDIF.
ENDIF.
The block is not being added and also somehow the delivery is not getting created.
When I try in VL01N, it says the delivery is saved. And when I try in VL02N to see the delivery, it says the delivery does not exist. Why is this happening? Please help.
Add a comment