cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a new Handling unit assigned to a Shipment?

Former Member
0 Kudos

Hi,

has anyone an experience how to create a new HU and assign it to a shipment (object type VEKP-VPOBJ = '04')?

I need to create it via SAPConsole transaction. Originally I intended to use LM19 to create an unassigned HU and to assign it further on via some BAPI. But I could not find any suitable BAPI for the assignment. Standard transaction LM24, allows only to create a HU with an assignement to a delivery (outbound/inbound).

Thank you

Martin

Accepted Solutions (0)

Answers (4)

Answers (4)

jim_donahue
Explorer
0 Kudos

If you want to use function modules to accomplish this, here is 1 way.

BAPI_HU_CREATE

BAPI_TRANSACTION_COMMIT

BAPI_HU_CHANGE_HEADER

HU_POST

   lw_hproposal-hu_exid         = i_exidv"Ext HU# Optional

   lw_hproposal-hu_status_init = 'A'.          "Planned. -

   lw_hproposal-pack_mat   = i_pack_mat.       "Packaging Material

*  This will create an UNASSIGNED HU object type 12.

   CALL FUNCTION 'BAPI_HU_CREATE'

     EXPORTING

       headerproposal = lw_hproposal

     IMPORTING

       huheader       = lw_huheader

       hukey          = lv_hukey

     TABLES

       itemsproposal  = li_iproposal

       return         = li_return.

*  I could not assign to a shipment unless the commit was done.

IF lv_hukey IS NOT INITIAL.

     CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' 

       EXPORTING

         wait   = 'X'

       IMPORTING

         return = lw_return.

     IF sy-subrc NE 0.

       APPEND lw_return TO et_return.

     ENDIF.


*    Assign to a Shipment

     lw_huheader-pack_mat_object  = i_object.               "04-HU Type for Shipment

     lw_huheader-pack_mat_obj_key = i_obj_key.           "Shipment #   
     lw_huheader-dc_custom_mat    = i_dc_custom_mat."Sets the Dist Channel

     CALL FUNCTION 'BAPI_HU_CHANGE_HEADER'

       EXPORTING

         hukey     = lv_hukey

         huchanged = lw_huheader

       IMPORTING

         huheader  = e_huheader

       TABLES

         return    = li_return.

     e_hukey       = lv_hukey.

*It is still not attached to the shipment until HU_POST is done.

  LS_OBJECT-OBJECT = P_OBJTYP.    "04

   LS_OBJECT-OBJKEY = P_OBJKEY.   "Shipment Number.

CALL FUNCTION 'HU_POST'

  EXPORTING

    IF_SYNCHRON          = ' '

    IF_COMMIT            = 'X'

    IS_OBJECT            = LS_OBJECT

  IMPORTING

    ET_MESSAGES          = LT_MESSAGES

sarvesh_gudapati2
Contributor
0 Kudos

Can you check VT01n/VT02n while creating shipments, you can select list of deliveries. Here in VT02n there is a pack icon on the screen. If you click the pack icon then you can create HUs directly on shipment with VEKP-VPOBJ = '04'.

It is possible to pack at shipment level using transaction LM63 before goods issue. Please check that.

Former Member
0 Kudos

Hi Sarvesh,

thank you for your reply. LM63 enables us to create another HU in a delivery, although the very first screen refers to a shipment number. This is our issue.

Our goal is to pack HU's from multiple deliveries of one shipment onto one pallet. This means the pallet should exist on the level of the shipment, as it contains HU's from multiple deliveries.

We have found many BAPI's and function modules to create an independent HU or an assigned HU to a delivery. But We can't find any for creation of a HU tied directly to a shipment...

sarvesh_gudapati2
Contributor
0 Kudos

Hi Jiri,

Yes, LM63 internally calls LM24 to pack by delivery. I haven't seen any LM transaction achieving the same as pack by shipment in VT02n for multiple deliveries. You may get a more detailed response if you post this in ABAP/RFID forums as well. I feel it would require significant ammount of customization by just lifting the logic from VT02n to a new ZRF transaction. Its worth checking the code SAPLV51G in VT02n for packing.

cheers,

Sarvesh

Former Member
0 Kudos

Hi Jiri,

I also have the same requirement . Can you please tell me what FM's you used?

Thanks,

Das.

Former Member
0 Kudos

Hi Jiri,

we have exactly the same requirement. Can you please share what solution you came up with.

Our requirement goal to

1. Pack HU's from multiple deliveries of one shipment onto one pallet.

2. There may be multiple outer HU'S within shipment and we want to move inner handling unit from one outermost HU to another outermost HU's

issue we are facing HU's are assigned to delivery.

Thanks in advance.

VP

Former Member
0 Kudos

Dear Jiri Melzer

please try this go to HU02 , mention the packing material , then mention the material quantity ,WH no, plant , storage location

i hope it will help you ,

other option is MB01 movement type 561 , increase the stock , system will create the Inbound delivery , during the goods receipt system will create the HU , then you use the same HU for shipment

sarvesh_gudapati2
Contributor
0 Kudos

LM24 is the transaction to pack HU and assign it to delivery. If the delivery is tied to a shipment, then the HU should be tied to shipment. In SAP Console RF transactions, there is an issue that I came across that tells me that HU is not assigned to shipment while doing RF Loading with LM30. This is not the case however when I do the same transaction from SAP GUI using LM00. You can get this working by having correct GUI patch level if this is the issue you are trying to solve.