Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

stop PGI but save delivery

Former Member
0 Kudos

hi all,

i have an issue on delievry enhancement for PGI,

*issue* : when they create delivery from vl01n they directly clicking PGI, for this delivery should be stoped by checking some condition(if it is good customer or bad customer ) but delivery should be saved with delivery number .

in same way they are changing delivery from vl02n clicking PGI directly , changes should be saved but PGi will not be proceed.

*trials:*

i tried this issue in so many ways by mv50afz , v0fm routines and badis . but i didnt complete this ,

(even if i palce error message on that condition delivery is not saving and PGI stoped).

please give me your advise is it possible

<removed by moderator>

Edited by: Thomas Zloch on Feb 7, 2012 9:12 PM

6 REPLIES 6

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

I'm wondering if you could solve this via the incompletion procedure. For instance you could use (or even define) a field for the imcompletion log and set it's value via a user exit that checks your condition.

I suppose the delivery being incomplete would prevent the goods issue document, but the delivery itself is saved... I haven't done this in a good while but that's the idea I'd pursue.

Former Member
0 Kudos

Use LE_SHP_DELIVERY_PROC badi in the method SAVE_DOCUMENT_PREPARE

here is the code where you can stop the PGI. This code belongs to particular plant but sy-ucomm = 'WANU_T is the PGI ok cod evalue...Use this same code....

IF ( ( if_trtyp = 'V' OR if_trtyp = 'M'

OR if_trtyp = 'B' OR if_trtyp = 'H') AND

( if_tcode = 'VL02N' OR if_tcode = 'VL01N' ) ).

IF if_tcode <> 'VL09'.

READ TABLE ct_xlips INTO w_lips INDEX 1.

IF w_lips-werks = '4610' OR

w_lips-werks = '4620' OR

w_lips-werks = '2600'.

IF sy-ucomm = 'WABU_T'.

LOOP AT ct_xlikp INTO w_likp WHERE NOT wadat_ist IS INITIAL.

READ TABLE ct_xvbfa INTO w_vbfa WITH KEY vbtyp_n = '8'.

IF sy-subrc <> 0.

w_log-vbeln = w_likp-vbeln.

  • w_log-posnr = '00001'.

w_log-msgty = 'S'.

w_log-msgno = '002'.

w_log-msgid = 'ZMES'.

APPEND w_log TO ct_log.

ENDIF.

ENDLOOP.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

Thanks,

Siva

0 Kudos

for this code PGI is also done i think.

and i tried this badi . but is not working may be iam wrong can u give clear .

my project is product based so i cant write for only particular plant like that. i think u r the only person to give an idea for me..

Former Member
0 Kudos

MESSAGE TYPE SHOULD BE 'e' OR 'E'..

tHANKS,

sIVA

0 Kudos

type 'E'.

chundru_ravindra
Participant
0 Kudos

Hi Bhaskar,

Use BAdI LE_SHP_DELIVERY_PROC in this use method SAVE_AND_PUBLISH_DOCUMENT this will trigger before PGI ,here u can stop.

Regards,

Ravindra.