10-07-2008 12:39 PM
Hi,
Grateful if someone can help.
I have a shipment that can be viewed via the VTxxN transactions. The shipment has several deliveries in it. I want to emulate the packing of the deliveries into HU's (I have set up config to use external HU id numbers and will be using one of two packing material numbers) within VT02N (brown cardboard box icon) using a BAPI or fn module.
Im having difficulties with function module HU_PACKING_AND_UNPACKING which I thought was the one to use, but this fn module has a structure GS_HEADER51 which is populated when called from VT02N but of course its not populated when I test it or call from my code, and the contents of this structure are checked. After creating an enhancement to set up this structure, for testing purposes, I then find other structures that are not populated. It is going to get messy this way.
There are other BAPI's like BAPI_HU_PACK and BAPI_HU_CREATE but I dont believe these work with deliveries.
At the minimum I believe I need a BAPI that will accept the following four fields - delivery number, delivery item, HU id and packaging material number.
I dont want to write a CALL TRANSACTION calling VT02N as I need to pack HU's within containing HU's, so there will be multiple HUs to be packed - then I start having the difficulty of page up/page down screen control.
Would be great if someone with experience of this can help as Im stuck and really need to resolve this.
Kind regards in advance,
Jon-Paul.
09-04-2014 6:10 PM
Hi Jon,
How do You solved this problem? Any idea how to implement this in other way?
Peter
09-05-2014 8:45 PM
Hi,
Basically the function module HU_PACKING_AND_UNPACKING also works.
You are correct that the global table GS_HEADER51 needs to be filled.
Basically understand that SAP fills the global table via a different function module.
So if you use HU_PACKING_AND_UNPACKING then you need to call the function module which fills the global data before it and then after that call FM HU_PACKING_AND_UNPACKING.
I do not have the system at the moment with me but you can get the function module in the same function group.
This is a common issue with the function module HU_PACKING_AND_UNPACKING.
Regards,
Ankur Parab
09-09-2014 12:13 PM
Hi
If you using "HU_PACKING_AND_UNPACKING"
then you need to call the FMs in below sequence.
* if your HU is shipment based then
call function 'RV_SHIPMENT_VIEW'
exporting
shipment_number = lt_vttp-tknum
option_items = lc_x
option_package_dialog = lc_x
option_partners = lc_x
exceptions
not_found = 1
no_authority = 2
delivery_missing = 3
delivery_lock = 4
others = 5.
if sy-subrc <> 0.
* PERFORM error_message_own.
exit.
endif.
**refrech buffer
call function 'HU_INITIALIZE_PACKING'.
**get HU details. this will fill the global tables.
call function 'HU_GET_HUS'
exporting
if_lock_hus = 'X'
it_venum = li_venum
importing
et_header = li_header
et_items = li_huitem
exceptions
hus_locked = 1
no_hu_found = 2
fatal_error = 3
others = 4.
if sy-subrc <> 0.
exit.
endif.
*
call function 'HU_PACKING_AND_UNPACKING'
and finally
call function 'HU_POST'
09-16-2014 1:58 PM