Application Development and Automation 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: 
Read only

Error in BAPI_HU_CREATE

former_member599326
Participant
0 Likes
763


Hi,

When I execute BAPI_HU_CREATE, I get following error :

"00517848450E does not have packaging material type and is therefore not a pack.mat."

my code is below :

       call function 'BBP_INB_DELIVERY_CREATE'
          exporting
            is_inb_delivery_header = is_inb_delivery_header
          importing
            ef_delivery            = ef_delivery
          tables
            it_inb_delivery_detail = gt_inb_delivery_detail
            return                 = gt_return.

        call function 'BAPI_TRANSACTION_COMMIT'.

        if ef_delivery is not initial.

          clear : gs_headerproposal,
                  gs_huheader,
                  gs_hukey.

          refresh : gt_itemsproposal,
                    gt_itemsserialno,
                    gt_return1,
                    gt_huitem.

          gs_itemsproposal-HU_ITEM_TYPE       = '1'.               " material item
          gs_itemsproposal-base_unit_qty      = 'EA'.              " unit of measure
          gs_itemsproposal-material           = gs_ekpo-matnr.   " zlpm material
          gs_itemsproposal-plant              = gs_ekpo-werks.   " plant
          gs_itemsproposal-stge_loc           = gs_ekpo-lgort.   " storage location
          read table poitem index 1.
          if sy-subrc = 0.
            gs_itemsproposal-batch              = poitem-BATCH.   " batch
            gs_itemsproposal-pack_qty           = poitem-quantity.   " quantity
          endif.

          gs_itemsproposal-no_of_serial_numbers = '1'.
          append gs_itemsproposal to gt_itemsproposal.

          gs_headerproposal-pack_mat          = gs_ekpo-matnr.     " packaging material
          gs_headerproposal-plant             = gs_ekpo-werks.     " plant
          gs_headerproposal-stge_loc          = gs_ekpo-lgort.     " storage location
*          gs_headerproposal-packg_instruct    = gv_packg_instruct. " packaging instruction

          gs_itemsserialno-row_index          = '1'.               " row index
          gs_itemsserialno-serialno           = '1'.   " serial number
          append gs_itemsserialno to gt_itemsserialno.

          call function 'BAPI_HU_CREATE'
            exporting
              headerproposal = gs_headerproposal
            importing
              huheader       = gs_huheader
              hukey          = gs_hukey
            tables
              itemsproposal  = gt_itemsproposal
              itemsserialno  = gt_itemsserialno
              return         = gt_return1
              huitem         = gt_huitem.

          if sy-subrc = 0.
            call function 'BAPI_TRANSACTION_COMMIT'.
          endif.
        endif.

Pls help ..

Regards,

1 REPLY 1
Read only

Former Member
0 Likes
531

Hi Santosh,

The problem could be with the material used for crating the delivery and hence packing.

Try to create manually the delivery and do the packing for the same material and see if you are getting that error.

If Yes, then probably you have to choose another material for testing your logic.

Take help of your functional consultant as well.

Br..

Dwaraka