Skip to Content
avatar image
Former Member

Unit of Conversion issue based on 'Key Date' for a Material in BOM using the FM 'CS_BOM_EXPL_MAT_V2'

Hi Team,

The material BOM ‘A’ has the material ‘B’ with Component UOM different from the Base UOM of the material ‘B’.

While exploding the Material (‘A’) BOM multi-level using the FM ‘CS_BOM_EXPL_MAT_V2’ , the FM is taking care of the converting the component UOM(STB-MNGKO) of the material (‘B’) to BASE UOM (STB-MNGLG). I think the conversion is done based on the data provided in ‘Additional Data->Units of Measure’ maintained in the Material Master of the Material ’B’.

The issue is we have maintained a different conversion factor (‘Additional Data->Units of Measure’) in Material Master for Material ‘B’ before a particular key date and want that particular conversion factor to be considered when the FM is executed before that key date but the FM is only considering the latest conversion factor even when the FM is executed by passing the Date (Import parameter: DATUV) before the key date.

There is no documentation for the FM ‘CS_BOM_EXPL_MAT_V2’.

Is there a way that the FM will pick the conversion factor for Material 'B' based on the key date.

Any suggestions/solutions on resolving this issue will be greatly appreciated.

The code used to for calling the FM is as below:

        CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
          EXPORTING
            capid                 = mv_capid
            datuv                 = key_date
            ehndl                 = '1' 
            rndkz                 = '1' 
            emeng                 = iv_req_quant
            mehrs                 = abap_true
            mmory                 = '0' 
            mtnrv                 = iv_material
            stlal                 = iv_bom_altern
            werks                 = iv_plant
          IMPORTING
            topmat                = es_topmat
          TABLES
            stb                   = lt_expl_data
          EXCEPTIONS
            alt_not_found         = 1
            call_invalid          = 2
            material_not_found    = 3
            missing_authorization = 4
            no_bom_found          = 5
            no_plant_data         = 6
            no_suitable_bom_found = 7
            conversion_error      = 8
            OTHERS                = 9.
        IF sy-subrc <> 0.
          l_error = abap_true.
        ENDIF.
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Nov 30, 2017 at 01:29 PM

    Hey,

    You can dig into the code of the function, and might find something, or simply iterate (LOOP) over lt_expl_data and on the desired material use your conversion based on any logic that fits your needs.

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 11, 2017 at 03:22 PM

    Not sure whether you have gone through the documentation of MATERIAL_UNIT_CONVERSION

    It says:-

    Functionality

    This function module converts a quantity from one unit of measurement to another. A requirement for this is that the units of measurement relate to a material. One of them must be the base unit of measure of the material, while the other must be defined as an alternative unit of measure for the material or be capable of being converted to an alternative unit of measure as per table T006.

    How you have maintained?

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Lakshmipathi,

      Thank you for your response.

      The alternative and base unit of measure is maintained for the material and the conversion is happening with the FM 'MATERIAL_UNIT_CONVERSION' but the issue is we have a maintained a different conversion factor from 'Alternative UOM' to 'Base UOM' in Material Master (Additional Data->Unit of Measure) before a particular key date and wanted the FM 'MATERIAL_UNIT_CONVERSION' to retrieve that conversion factor when executed for that key date.

      MM19 tcode is able to get the Material Master data(Conversion Factor : Additional Data->Unit of Measure) based on a key date. Do we have any Function Module/BAPI through which we can get the MM data based on key date or any other suggested solution is greatly appreciated.

      Thanks & Regards,

      Kiran