02-07-2012 7:17 PM
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
02-07-2012 7:36 PM
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.
02-07-2012 9:09 PM
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
02-10-2012 5:47 PM
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..
02-07-2012 9:10 PM
02-08-2012 3:20 AM
02-08-2012 12:45 PM
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.