Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Embedded Google Drive File
docid1b9uHf6soU9ypv84F6QqeGVColSX9zHK_D_asrfyvQsg


Conversion Unit C_MATNR2 - UOMCMAT2 - Enhancement from Global Filter list

Dynamic conversion in queries (using Conversion Types) is only working if source and target units are in the same Dimension.

Otherwise a flow of conversions is done with Base UoM as pivot unit, by using factor from T006 table.

When all units of this flow are not provided by SAP Material alternative units, the missing unit must be added to the UOMCMAT2 ADSO.

(in → KG = in → M and M → KG)

Transformation TRSF: IFS_MD_MATNR2_UOMCMAT2_01 -> UOMCMAT2 is used to add specific Unit conversions for a list of Materials.

The Infosource IFS_MATNR2__UOMCMAT2_0001 allows to create another flow from Master Data C_MATNR2, with a dedicated logic in Transformation.

Image Added


The Materials/units to convert must be populated into the Master Data Global Filter C_GLBFILT, in each BW system to process.

Image Added

C_STREAM : Always value 'C_MATNR2' to select all records during Transformation Start Routine
C_RULE : Material value
C_LOW : Logical system compounding Material
C_SIGN : Value 'I' to input record in UOMCMAT2, value 'E' to delete a record in UOMCMAT2
C_OPTION : Always 'EQ'
C_HIGH : Unit to add for conversion in Base UoM in UOMCMAT2 => Unit value in INTERNAL format (PC => ST, GAL => GLL, "2 => IN2, in => IN….).
C_ACTIVE : If not equal 'Y', the record is not selected during loading

Transformation logic

Start Routine
Select all records with C_STREAM = 'C_MATNR2' from Master Data Global Filter C_GLBFILT.
Select all records from table /BI0/SUNIT (Unit SID) to populate in End Routine

End Routine
For each Logsys/Material record from source C_MATNR2 (use DTP filter to limit Materials to extract), a loop is done to process each Unit from Global Filter for this Logsys/Material.

The conversion added into UOMCMAT2 is from the Unit selected in C_GLBFILT, into the Base UoM of the Material from C_MATNR2.
If the Base UoM is empty (should occurs in Dev only !!), the target Unit is forced to 'KG' for conversion.

The conversion is done through the Function Module Z_MD_CONVERT_MATERIAL_UNIT3 which is the one used in BW data flows to convert units properly.
Conversion is working fine in this FM even if Units are in different dimensions.
The result of the conversion becomes the Numerator to add in UOMCMAT2 for the Unit converted.
The Input quantity to convert (1000) becomes the Denominator.
No matter the value to convert, the Factor result Numerator/Denominator will always be the same (at least a value of 1000 for accuracy purposes).

If C_SIGN = 'E' in Master Data Global Filter C_GLBFILT, the RECORDMODE is set to 'D' to delete the relevant record in UOMCMAT2.


Function Module Z_MD_CONVERT_MATERIAL_UNIT3

...