Skip to Content
author's profile photo Former Member
Former Member

To block delivery in VL01N and VL02N using LE_SHP_DELIVERY_PROC Badi

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Jun 29, 2016 at 05:57 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • author's profile photo Former Member
    Former Member
    Posted on Jun 29, 2016 at 07:40 AM

    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
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.