2007 Jun 28 11:45 AM
Hi all,
can anyone show me how to use the Function Module WS_DELIVERY_UPDATE?
I want to do the packing of the delivery. How do I have to fill the tabels so that the FM creats the HUs and does the packing?
Thank you for your help!
Stefan
2007 Jun 28 11:48 AM
Hi,
May be this might help with some ideas.
FORM UPDATE_VEKP.
DATA: LIN LIKE SY-TABIX.
DATA: HLP_VBELN LIKE LTAK-VBELN.
DATA: IVERKO LIKE VERKO OCCURS 10 WITH HEADER LINE.
DATA: IVBKOK LIKE VBKOK.
*......check if sth. needs to be done at all..............
CHECK SY-TCODE = CON_LM45.
CLEAR: IVERKO, HLP_VBELN.
REFRESH: IVERKO.
DESCRIBE TABLE TO_HEADER_TABLE LINES LIN.
CHECK LIN <> 0.
LOOP AT TO_HEADER_TABLE.
MOVE: TO_HEADER_TABLE-VBELN TO IVBKOK-VBELN_VL.
MOVE: TO_HEADER_TABLE-VBELN TO HLP_VBELN.
ENDLOOP.
*......prepare ivekp tables .............................
MOVE: SAV_VHILM TO IVERKO-VHILM,
SAV_CLENUM TO IVERKO-EXIDV,
'01' TO IVERKO-OBJECT,
HLP_VBELN TO IVERKO-OBJKEY.
APPEND IVERKO.
*......update per delivery item...................................
CALL FUNCTION 'WS_DELIVERY_UPDATE'
EXPORTING
VBKOK_WA = IVBKOK
COMMIT = 'X'
DELIVERY = HLP_VBELN
TABLES
VERKO_TAB = IVERKO
EXCEPTIONS
ERROR_MESSAGE = 99.
IF SY-SUBRC = 99.
Shipm. or deliv. is locked, status of shipping unit &1 was not chang
MESSAGE_NUMBER = '270'.
PERFORM ERROR_MESSAGE.
LEAVE TO TRANSACTION SY-TCODE.
ENDIF.
ENDFORM. " UPDATE_VEKP
Hope this helps.
Reward points if it is helpful...
Regards,
Omkar.
Message was edited by:
Omkaram Yanamala
2007 Jun 28 11:59 AM
Hi,
May be this might help with some ideas.
FORM UPDATE_VEKP.
DATA: LIN LIKE SY-TABIX.
DATA: HLP_VBELN LIKE LTAK-VBELN.
DATA: IVERKO LIKE VERKO OCCURS 10 WITH HEADER LINE.
DATA: IVBKOK LIKE VBKOK.
*......check if sth. needs to be done at all..............
CHECK SY-TCODE = CON_LM45.
CLEAR: IVERKO, HLP_VBELN.
REFRESH: IVERKO.
DESCRIBE TABLE TO_HEADER_TABLE LINES LIN.
CHECK LIN <> 0.
LOOP AT TO_HEADER_TABLE.
MOVE: TO_HEADER_TABLE-VBELN TO IVBKOK-VBELN_VL.
MOVE: TO_HEADER_TABLE-VBELN TO HLP_VBELN.
ENDLOOP.
*......prepare ivekp tables .............................
MOVE: SAV_VHILM TO IVERKO-VHILM,
SAV_CLENUM TO IVERKO-EXIDV,
'01' TO IVERKO-OBJECT,
HLP_VBELN TO IVERKO-OBJKEY.
APPEND IVERKO.
*......update per delivery item...................................
CALL FUNCTION 'WS_DELIVERY_UPDATE'
EXPORTING
VBKOK_WA = IVBKOK
COMMIT = 'X'
DELIVERY = HLP_VBELN
TABLES
VERKO_TAB = IVERKO
EXCEPTIONS
ERROR_MESSAGE = 99.
IF SY-SUBRC = 99.
Shipm. or deliv. is locked, status of shipping unit &1 was not chang
MESSAGE_NUMBER = '270'.
PERFORM ERROR_MESSAGE.
LEAVE TO TRANSACTION SY-TCODE.
ENDIF.
ENDFORM. " UPDATE_VEKP
Hope this helps.
Regards