2023 Aug 31 4:36 PM
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
2023 Sep 01 11:34 AM
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