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: 

Handling Unit into Handling unit into Delivery

P905227
Explorer
0 Kudos
221

Hello experts, after searching a lot, I can't find a solution to the following problem:

I have a delivery that contains one HU (box) and one HU (bag) I need to insert the bag into the box. Tried with BAPI_HU_PACK to no avail. Can you give me some ideas?
Below an example of my code

*---
DATA:
l_hukey TYPE bapihukey-hu_exid,
ls_itemproposal TYPE bapihuitmproposal,
ls_huitem TYPE bapihuitem,
ls_huheader TYPE bapihuheader,
lt_serialnumbers LIKE TABLE OF bapihuitmserial,
lt_return LIKE TABLE OF bapiret2.
*---
l_hukey = '00000000000001832448'.
ls_itemproposal-hu_item_type = '3'.
ls_itemproposal-lower_level_exid = '00000000000001832449'.
ls_itemproposal-material = 'SCA'.

CALL FUNCTION 'BAPI_HU_PACK'
EXPORTING
hukey = l_hukey
itemproposal = ls_itemproposal
IMPORTING
huitem = ls_huitem
huheader = ls_huheader
TABLES
* serialnumbers = lt_serialnumbers
return = lt_return.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.

Thanks to those who will help me.

Ian

1 REPLY 1

P905227
Explorer
0 Kudos
174

I solved it myself using CALL FUNCTION 'WS_DELIVERY_UPDATE_2' instead of BAPI_HU_PACK

as described here

https://answers.sap.com/questions/3872431/bapihupack---processing-of-hus-for-selected-object.html

Ian