SAP Function OIB_QCI_CONVERSION_SIMPLE - Function module to convert a quantity between two units of measure

Parameter Reference Type Length Default Optional Text
I_BATCH MCHA-CHARG C 10 X Batch number
I_CONVERSIONGROUP OIB01-UMRSL C 4 X Oil conversion group
I_MATERIAL MATNR C 18 X Material number
I_PARAMETERS OIB_A04 u 592 X HPM Import/export for Quantity Conversion (OIB1, OIB_QCI)
I_PLANT WERKS_D C 4 X Plant
I_QUANTITY OIB_A05-ADQNT F 8 Additional oil/gas quantity
I_STANDARDCALC OIB_STANDARD C 1 X Indicator for standard calculation
I_TARGETUOM OIB_A05-MSEHI C 3 Unit of measurement
I_UOM OIB_A05-MSEHI C 3 Unit of measurement

Parameter Reference Type Length Text
E_QUANTITY OIB_A05-ADQNT F 8 Additional oil/gas quantity
E_QUANTITY_PACKED OIB_A05-ADQNTP P 7 Additional oil quantity (packed format)

Parameter Reference Length Optional Text
IT_PARAMETERS OIB_READING_PAR 96 X Structure for external applications (QCI_SIMPLE)
T_RETURN BAPIRET2 548 X Return parameter

Exception Text
CALCULATION_FAILURE
INCONSISTENT_CUSTOMIZING
INCONSISTENT_DATA
TRANS_UOM_NOT_FOUND

Functionality
This function module can be utilized to convert a given quantityI_QUANTITY (floating point format) to the corresponding quantityE_QUANTITY (floating point format) for a requested target unit ofmeasure I_TARGETUOM. You have to pass the source unit of measure(I_UOM) and quantity (I_QUANTITY) ( floating point format) and thetarget unit of measure (I_TARGETUOM) to the function module. In additionto the result E_QUANTITY in floating point format, the result is alsopassed back to the caller in packed format (E_QUANTITY_PACKED). If nospecial QCI BAdI for rounding is implemented, this packed value issimply derived by moving the float value to a packed field with 3decimal places.
Depending on the complexity of the conversion, you have to provide thefollowing additional information:

  • If you set the indicator I_STANDARDCALC to a non-initial value, you have
  • to provide the material number. Then, the function performs a conversionusing material master conversion data (fixed/static quantityconversion). The Oil & Gas specific conversion parameters are thenignored.
    • If you do not set the indicator I_STANDARDCALC, you have to pass:

    • Either the conversion group OR material number for an HPM material(MARA-CMETH = '1'). You may then have to pass the parameter structureI_PARAMETERS( OIB_A04 ). Use function moduleOIB_QCI_READ_CONV_PARAMETERS "Read HPM conversion default parameters"to determine these or fill the parameters "by hand" from yourapplication. The parameters are required as soon as the logic decidesthat a call to the QCI has to be performed and the API c-codes arecalled.
      For a standard material (MARA-CMETH = ' ') or TDP (Excise duty relevantonly) material (MARA-CMETH = '2'), the conversion group is not requiredand will be ignored and the parameters are also not relevant. For thesematerials you have to pass the material number ( I_MATERIAL )as requiredinformation.
      • For batch specific Material units of measure (MARA-KZWSM = A or B), the
      • batch and plant data may have to be passed with the material numberdepending on the business process.
        If you pass the conversion group AND material number information, theconversion group data will be adjusted based on the material and plantdata before the conversion is performed. For HPM materials, the plantdata has to be passed then as well in order to check that the data isconsistent.

        Description
        The result of the call: The value for the target quantity in therequested target UoM

        Description
        Result in packed format

        Description
        The batch number specifying the material . The batch number is onlyrequired if for a material the Batch-Specific Material Units of Measurehandling is activated.

        Description
        The conversion group defines how for a given oil or gas product (HPMmaterial) the quantity conversion is performed. The conversion group isassigned to an HPM material at material/plant level. Thus, for HPMmaterials, you have to pass either the material number AND plant orthe conversion group to the function. For all other mateirals only thematerial number is required.

        Value range
        Valid entries for a conversion group are maintained in customizingtable OIB01.

        Description
        The R/3 material number. For HPM materials you have to pass either thematerial number AND plant or the conversion group to the function. Forall other mateirals only the material number is required.

        Description
        Within this structure, all possible conversion parameters can be passedto the function

        Description
        The R/3 plant ID. This data is required for batch specific unit ofmeasure handling and quantity conversions for Excise Duty relevantmaterials (MARA-CMETH = 2 ) and HPM materials (MARA-CMETH = 1).

        Description
        This is the source quantity

        Description
        If you set this indicator to a non-initial value, a standard quantityconversion based on static material master conversion factors will beperformed. Then, you have to pass the material number to the function.

        Description
        This is the target unit of measurement

        Description
        This is the source unit of measurement (UoM)

        Description
        You can use this table to pass conversion parameters instead of usingthe flat structure I_PARAMETERS (TYPE OIB_A04)

        Description
        The table contains all messages collected during one call.
        This parameter is necessary since the QCI utilizes a global interface,which contains the same parameter and is used in most form routines.