Skip to Content

Parameters specified in BAPI_MATERIAL_SAVDATA

Hello Experts,

I am using FM : BAPI_MATERIAL_SAVDATA.

In this, I am giving one volume for basic unit of measure & want to give another volume for basic unit of measure as 'ME'.

Can it be possible ? What parameters to be used in declaration & in FM ?

Thanks,

Swanand

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Jun 12, 2014 at 04:54 AM

    Hi Swanand,

    I am not sure if I got you correctly.

    If you meant that you want to give one unit for Basic Unit of Measure and another for Unit of Measure, its perfectly fine. You dont have to give the same for both BUOM and UOM.

    TABLES:
    bapi_mara, "Clientdata
    bapi_marax, "Clientdatax
    bapi_marm, " Units of Measure
    bapi_marmx, " Units of Measurex



    DATA: BEGIN OF it_uom OCCURS 0.
    INCLUDE STRUCTURE bapi_marm.
    DATA:END OF it_uom.



    DATA: BEGIN OF it_uomx OCCURS 0.
    INCLUDE STRUCTURE bapi_marmx.
    DATA:END OF it_uomx.

    In this BAPI, these two are provided in the following two parameters.

    * For Base unit of measure , either from input file or hardcoded.

    CLEAR bapi_mara.
    bapi_mara-matl_group = it_matmaster-matkl.
    bapi_mara-old_mat_no = it_matmaster-bismt.
    CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
    EXPORTING
    input = 'PC' "it_matmaster-meins
    language = sy-langu
    IMPORTING
    * LONG_TEXT =
    output = it_matmaster-meins. .
    bapi_mara-base_uom = it_matmaster-meins.
    bapi_mara-base_uom_iso = it_matmaster-meins.
    bapi_mara-batch_mgmt = 'X'.

    CLEAR bapi_marax.
    bapi_marax-base_uom = 'X'.
    bapi_mara-base_uom_iso = 'X'.
    bapi_marax-old_mat_no = 'X'.
    bapi_marax-matl_group = 'X'.
    bapi_marax-batch_mgmt = 'X'.


    *For Unit of measure

    * Gross Weight
    if it_matmaster-brgew is not INITIAL.
    bapi_marm-gross_wt = it_matmaster-brgew.
    CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
    EXPORTING
    input = 'KG' "it_matmaster-gewei
    language = sy-langu
    IMPORTING
    * LONG_TEXT =
    output = it_matmaster-gewei .
    bapi_marm-unit_of_wt = it_matmaster-gewei.
    bapi_marm-unit_of_wt_iso = it_matmaster-gewei.
    bapi_marm-alt_unit = it_matmaster-meins.
    bapi_marm-alt_unit_iso = it_matmaster-meins.
    APPEND bapi_marm TO it_uom.

    bapi_marmx-gross_wt = 'X'.
    bapi_marmx-unit_of_wt = 'X'.
    bapi_marmx-unit_of_wt_iso = 'X'.
    bapi_marmx-alt_unit = it_matmaster-meins.
    bapi_marmx-alt_unit_iso = it_matmaster-meins.
    APPEND bapi_marmx TO it_uomx.





    CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
    EXPORTING
    headdata = bapimathead
    clientdata = bapi_mara
    clientdatax = bapi_marax
    plantdata = bapi_marc
    plantdatax = bapi_marcx
    storagelocationdata = bapi_mard
    storagelocationdatax = bapi_mardx
    valuationdata = bapi_mbew
    valuationdatax = bapi_mbewx
    IMPORTING
    return = it_return
    TABLES
    materialdescription = it_materialdesc
    unitsofmeasure = it_uom
    unitsofmeasurex = it_uomx
    * internationalartnos = it_mean
    materiallongtext = it_mltx.
    IF it_return-type = 'S'.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    wait = 'X'.
    ELSE.
    CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
    ENDIF.




    pastedImage_0.png (69.9 kB)
    Add a comment
    10|10000 characters needed characters exceeded

    • Just ensure that the Basic Unit of measure and alternative unit are the same.

      s_meins-low should be ME in this case. or Base UOM should be s_meins-low.

      Also fill values for parameter alt_unit_iso

      Further, I hope you are appending i_uom and i_uomx into the tables.

      i_uom-alt_unit = 'ME'. "s_meins-low.
      i_uom-alt_unit_iso = 'ME'. "s_meins-low.


      i_uom-volume = final_volume.


      i_uomx-alt_unit = 'ME' ."s_meins-low.

      i_uomx-alt_unit_iso = 'ME'. "s_meins-low.

      i_clientdata-BASE_UOM = 'ME'. "s_meins-low.

  • Posted on Jun 12, 2014 at 05:59 AM

    Hi,

    You cannot add more than one unit of measure in 'Basic View'.because in MARA Table MATNR(material) is keyfield.

    Regards,

    venkatramesh.V

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.