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: 

How to use WS_DELIVERY_UPDATE

stefan_wagner4
Discoverer
0 Kudos
5,572

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

2 REPLIES 2

Former Member
0 Kudos
1,237

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

Former Member
0 Kudos
1,237

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