2008 Feb 14 4:55 AM
HI all,
I want to update picking quantity as delivery quantity...I tried via user exit...but it is not updating(it is possible via user exit?)...how can i do this plz help me..
2008 Feb 14 5:05 AM
2008 Feb 14 5:48 AM
2008 Feb 14 5:07 AM
Hi,
Try to create an Implementation for BADI : LE_SHP_DELIVERY_PROC and
goto Method : SAVE_AND_PUBLISH_DOCUMENT
paste this code,
DATA: v_pikmg TYPE lipsd-pikmg,
flag TYPE c,
v_flag TYPE c.
DATA: wa_lips TYPE lips,
it_lips TYPE TABLE OF lips,
wa_likp TYPE likp,
it_likp TYPE TABLE OF likp.
DATA:wa_vbkok TYPE vbkok.
DATA:wa_vbpok TYPE vbpok,
it_vbpok TYPE TABLE OF vbpok.
TYPES:BEGIN OF x_pikmg,
vbelv TYPE vbfa-vbelv,
posnv TYPE vbfa-posnv,
rfmng TYPE vbfa-rfmng,
END OF x_pikmg.
DATA:it_pikmg TYPE TABLE OF x_pikmg,
wa_pikmg TYPE x_pikmg.
ZLOGDELY Updation*******************************
IF it_xlikp IS NOT INITIAL.
Read IT_LIKP into WorkArea* *******************
it_lips[] = it_xlips[]. " Move it_Xlips to it_lips
it_likp[] = it_xlikp[].
IMPORT flag TO v_flag FROM MEMORY ID 'ZSASI'. "Import v_flag from memory
IF ( sy-cprog EQ 'SAPMSSY1' OR sy-cprog EQ 'RVV50R10C' ).
IF ( sy-uname NE 'WF-BATCH' ). "Byepassing Auto picking for Workflow - PTC1004, Automation of 2nd Triangular Invoice
IF v_flag NE 'X'.
v_flag = 'X'. "set the v_flag to X.
FREE MEMORY ID 'ZSASI'.
EXPORT flag FROM v_flag TO MEMORY ID 'ZSASI'. "Export the V-flag to Memory.
SELECT vbelv posnv rfmng FROM vbfa INTO TABLE it_pikmg
FOR ALL ENTRIES IN it_lips
WHERE vbelv = it_lips-vbeln
AND posnv = it_lips-posnr
AND vbeln = it_lips-vgbel
AND ( vbtyp_n = 'Q'
OR vbtyp_v = 'J' ). "Get the Picking quantity from VBFA table for all entries in it_lips.
LOOP AT it_lips INTO wa_lips. "Loop at it_lips to populate it_vbpok.
READ TABLE it_likp INTO wa_likp WITH KEY vbeln = wa_lips-vbeln.
READ TABLE it_pikmg INTO wa_pikmg WITH KEY vbelv = wa_lips-vbeln.
IF wa_pikmg-rfmng IS INITIAL.
wa_vbkok-vbeln_vl = wa_likp-vbeln.
wa_vbkok-vbtyp_vl = wa_likp-vbtyp.
wa_vbkok-kodat = wa_likp-kodat.
wa_vbpok-vbeln_vl = wa_lips-vbeln.
wa_vbpok-posnr_vl = wa_lips-posnr.
wa_vbpok-vbeln = wa_lips-vgbel.
wa_vbpok-posnn = wa_lips-vgpos.
wa_vbpok-pikmg = wa_lips-lfimg.
wa_vbpok-matnr = wa_lips-matnr.
wa_vbpok-charg = wa_lips-charg.
wa_vbpok-werks = wa_lips-werks.
APPEND wa_vbpok TO it_vbpok.
ENDIF.
ENDLOOP.
IF it_vbpok IS NOT INITIAL.
CALL FUNCTION 'SD_DELIVERY_UPDATE_PICKING_1' "Call FM to do Auto Picking.
EXPORTING
vbkok_wa = wa_vbkok
synchron = 'X'
no_messages_update_1 = ' '
TABLES
vbpok_tab = it_vbpok.
ENDIF.
ENDIF.
IF sy-subrc = '0'.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' " call FM to Commit the DataBase work.
EXPORTING
wait = 'X'.
ENDIF.
FREE MEMORY ID 'ZSASI'.
ENDIF.
ENDIF.
ENDIF.
PLZ PLZ reward Points...
Regards SASI...
Edited by: SASIKANTH SM on Feb 14, 2008 10:43 AM
2008 Feb 14 5:58 AM
hi sasi thanks for ur reply...but I dont have a control using break point in this method..
2008 Feb 14 6:09 AM
I cant get u... can u explain me clearly... are plz contact me in [email protected]
whether do u feel that this badi is not triggering...
i will help u...
2008 Feb 14 6:12 AM
2008 Feb 14 6:19 AM
Hi...
R u creating delivery via VL10D or VL10B or VL10batch or VL10 transaction.
if so just give the STO NO# in PO # field in VL10D transaction...
if u execute,then u will get the checkbox with no# of items thne wn u check the check box and press Background button, then only it will trigger...
plz let me know if u hv any query.
2008 Feb 28 12:58 PM
HI,
Is there any option in SPRO to pass the delivery quantity to Picking quantity without using any user exit
Thanks in advance
Kevin