05-19-2011 4:32 PM
Hi Experts,
I have a requirement, where I need to copy the text of Delivery to the shipment while creating it. Is there any User Exit or BADI where I can copy these Delivery texts to Shipment.
Thanks,
Sree.
Moderator message: please do more (or show you have done) research before asking, you have been asked before.
Edited by: Thomas Zloch on May 19, 2011 5:44 PM
05-19-2011 4:40 PM
Hi Sree,
Use this BADI BADI_LE_SHIPMENT and in mthod BEFORE_UPDATE write the following code. It will work damn sure.
TB_VTTP[] = IM_SHIPMENTS_BEFORE_UPDATE-NEW_VTTP[].
tb_VTTK[] = IM_SHIPMENTS_BEFORE_UPDATE-NEW_VTTK[].
Loop At TB_VTTP Into X_VTTP Where TKNUM = X_VTTK-TKNUM.
CALL FUNCTION 'READ_TEXT'
IF SY-SUBRC = 0.
Append Lines Of TB_LINES TO TB_LINES_FINAL.
endif.
At Last.
If TB_LINES_FINAL[] Is Not Initial.
CALL FUNCTION 'CREATE_TEXT'
endat.
If Sy-Subrc Ne 0.
If IM_SHIPMENTS_BEFORE_UPDATE-NEW_VTTK[] Is Initial.
Loop At IM_SHIPMENTS_BEFORE_UPDATE-OLD_VTTP Into X_VTTP.
X_HEADER-TDNAME = X_VTTP-TKNUM.
CALL FUNCTION 'DELETE_TEXT'
EndLoop.
EndIf.
EndIf.
Thanks,
Bhargav.