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: 

WS_DELIVERY_UPDATE

former_member260467
Discoverer
0 Kudos

Hi All,

Can anyone suggest how to create a HU using this FM WS_DELIVERY_UPDATE with items ?

I want the code for the same . This is vey urgent .

Thanks

Soumyadip

3 REPLIES 3

Former Member
0 Kudos

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.

Cheers

VJ

ferry_lianto
Active Contributor
0 Kudos

Hi Ganesh,

Please check this sample code from other thread.

The following is a test function module will unpack a specific Delivery Line\Quantity from an existing HU.

The import parameters are the Delivery, Delivery Item, the Dest

HU that you want to pack onto, and the quantity that should be

unpacked from the Source HU.

The unpacked quantity that is to be is turned into a negative number, by this function module, which causes the unpacking to happen. So it assumes that the unpack qty is passed in as a postive number.

*********************************************************

  • Data Declarations

*********************************************************

DATA:

lv_error_1 TYPE XFELD,

lv_error_2 TYPE XFELD,

lv_error_3 TYPE XFELD,

lv_error_4 TYPE XFELD,

lv_error_5 TYPE XFELD,

lv_error_6 TYPE XFELD.

DATA:

ls_vbkok like vbkok,

li_verko like verko occurs 0 with header line,

li_verpo like verpo occurs 0 with header line.

DATA:

ls_tmeng like vepo-vemng.

*********************************************************

  • Pack the lower level handling unit onto the higher level one

  • The packing is done through FM WS_DELIVERY_UPDATE.

*********************************************************

CLEAR: li_verpo, li_verko, LS_VBKOK.

REFRESH: li_verpo, li_verko.

  • Fill the HU Header

CLEAR: li_verko.

REFRESH: li_verko.

li_verko-exidv = ls_exidv.

INSERT TABLE li_verko.

  • Fill the HU items.

CLEAR: li_verpo.

REFRESH: li_verpo.

li_verpo-exidv_ob = ls_exidv.

li_verpo-vbeln = ls_vbeln.

li_verpo-posnr = ls_posnr.

li_verpo-tmeng = ( ls_unpack_qty * -1 ).

INSERT TABLE li_verpo.

CALL FUNCTION 'WS_DELIVERY_UPDATE'

EXPORTING

vbkok_wa = ls_vbkok

commit = 'X'

delivery = ls_vbeln

IMPORTING

ef_error_any_0 = lv_error_1

ef_error_in_item_deletion_0 = lv_error_2

ef_error_in_pod_update_0 = lv_error_3

ef_error_in_interface_0 = lv_error_4

ef_error_in_goods_issue_0 = lv_error_5

ef_error_in_final_check_0 = lv_error_6

TABLES

verko_tab = li_verko

verpo_tab = li_verpo

EXCEPTIONS

error_mesage = 9

others = 10.

ENDFUNCTION.

IMPORTING

LS_VBELN LIKE LIPS-VBELN Delivery

LS_EXIDV LIKE BAPIHUKEY-HU_EXID External Handling Unit Identification

LS_POSNR LIKE LIPS-POSNR Delivery item

LS_UNPACK_QTY LIKE VEPO-VEMNG Base Quantity Packed in the Handling Unit Item

Hope this will help.

Regards,

Ferry Lianto

Please reward point if helpful.

Former Member
0 Kudos

AFTER USING WS_DELIVERY_UPDATE TO CREATE AN HU. WHILE USING VL02N ONLINE TO DELETE IT, HOW CAN I TELL THAT A DELETE IS IN PROGRESS IN A USEREXIT INCLUDE TO PROGRAM MV50AFZ1.

THANKS,

jshupe@eastman.com