cancel
Showing results for 
Search instead for 
Did you mean: 

Triggering output on PGI/ Reversal

ajoy_chakraborty
Participant
0 Kudos

Hi All,

REQUIREMENT: On PGI (VL02n) or on Reversing goods movement (VL09), when VBUK-WBSTK changes from A to C or C to A, output should be triggered. It should also trigger an IDoc for every PGI and Reversing.

MY CODE:

1) New routine created (VOFM -> Requirements -> Output Control, Application area = V2)

2) New Output Type created in NACE for V2 (Transmission Medium = EDI, Partner Function = LS)

3) Code within routine:

**-Fetch the existing Goods movement status
  CLEAR lv_wbstk.
  SELECT SINGLE wbstk         "Total goods movement status
    FROM vbuk                 "Sales Doc: Header Status and Admin Data
    INTO lv_wbstk
    WHERE vbeln EQ komkbv2-vbeln.

  IF sy-subrc EQ 0.
**-Check with the current status
    CASE lv_wbstk.
        WHEN 'A'.
           IF komkbv2-wbstk EQ 'C'.
              sy-subrc = 0.

       ENDIF.

      WHEN 'C'.
       IF komkbv2-wbstk EQ 'A'.
             sy-subrc = 0.

          ENDIF.

    ENDCASE.

ENDIF.

DOUBTS:

1) Each time I do PGI, status should be updated in NAST table (VL02N -> Extra -> Delivery Output -> Header should be update with new line item). How to achive this?

2) How do I trigger IDocs from this routine?

Please help!

Thanks in advance.

Rgds

Accepted Solutions (0)

Answers (2)

Answers (2)

ajoy_chakraborty
Participant
0 Kudos

Solved it on my own...

"Multiple Issuing" was un-checked..working fine after checking it (NACE -> V2 -> Output Type -> Z*** ->General Data tab)

former_member186385
Active Contributor
0 Kudos

Hi,

You have to define two output types,

one for PGI and another for Reversal

and assign respective routines in NACE transaction code

in output configuration, under the transmission medium you can maintain 6 to trigger IDOC

check and revert

thanks

santosh