Skip to Content

In my current project we are using the BAPI_MATERIAL_SAVEDATA to create and change material master data in SAP from a legacy application. The BAPI was working fine until we got to a point where we were required to populate net and gross weight for a material under Material Master -> basic data 1 view. We found that the BAPI has parameter called CLIENTDATA-NET_WEIGHT but there is no such parameter for gross weight. Upon contacting SAP I learnt that in order to pass Gross Weight (MARA-BRGEW), we need to pass a record in UNITOFMEASURE table for the base unit of measure along with the gross weight value and gross weight unit. Initially my understanding was that UNITOFMEASURE was to be used only for alternate units, which is true. I would not have guessed that we have to pass gross weight for base unit in this fashion unless SAP told me so. I have asked SAP to add this information in the BAPI documentation. The following screen image shows the values you need to pass for this case. Please like and rate this post if you find this information useful.

How to pass gross weight to BAPI.png

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. Daniel Klein

    Thanks, it worked, but no need to populate UNITSOFMEASUREX-UNIT_OF_WT if you only want to maintain MARA-BRGEW.

    Code Snippet:

    clientdata-base_uom   = ‘ST’.

    clientdatax-base_uom   = ‘X’.

    clientdata-unit_of_wt   = ‘G’.

    clientdatax-unit_of_wt   = ‘X’.

    clientdata-net_weight   = 100.

    clientdatax-net_weight   = ‘X’.

    APPEND INITIAL LINE TO lt_unitsofmeasure ASSIGNING FIELDSYMBOL(<uom>).
           <uom>alt_unit   = clientdatabase_uom.
           <uom>gross_wt = 150.
           APPEND INITIAL LINE TO lt_unitsofmeasurex ASSIGNING FIELDSYMBOL(<uomx>).
           <uomx>alt_unit   = clientdatabase_uom.
           <uomx>gross_wt = abap_true.

    (0) 

Leave a Reply