You are on page 1of 6

Migration of Material Master data (MM03)

For migrating the Material Master data we designed two BODS jobs

 Material_Master_Format
 Material_Master_Idoc

The Material Master job is executed for the 2 Material Types ‘ZHAW’ and ‘ZROH’.
Inside the condtion flow MaterialMaster_Mapping_Required we are having the workflow
with so many data flow in it

DF_MAT_GROUP
File Name ->

The file is consumed in the bods and moved the data into Permanent table
‘DM_MM_LEGACY’
DF_MAT_PLANT
File Name->

The data in this file is also moved to a Permanent table ‘DM_MM_MATPLANT’


Df_Baseuintof Measure
File Name->

The data in this file is also moved to a temp table ‘DM_MM_BASE_UINT_OF_MEASURE’


WF_MaterialMaster_Mapping

DF_LOOKUP_PLANT

DF_LOOKUP_MARA

The data in the standard MARA table is moved to DM_MARA2 by writing a condition in
where of the query MARA.MTART=$G_MaterialType

In this job we need to explicitly generate the No Range for the two material types
ZHAW-> ‘1100000000’
ZROH-> ‘4100000000’
Inside the script we written the logic to fetch the highest no range for the Materials inside
the script. We declared a Global Variable $L_MATNR

$L_MATNR = sql('STAGING_DB','SELECT MAX(MATNR) FROM STAGING.DM_MARA2');


print( '-------------------------------------- INFO: SAP Material No --------------------------------------');

ltrim_blanks( rtrim_blanks( $L_MATNR ));


#print( 'ASCII Value of $L_MATNR: '|| ascii( $L_MATNR ) );

if ( $L_MATNR is null )
begin
if ( $G_MaterialType = 'ZHAW') print( 'SAP Material No will start from: 1100000000');
if ( $G_MaterialType = 'ZROH') print( 'SAP Material No will start from: 4100000000');
if ( ( $G_MaterialType != 'ZHAW') and ( $G_MaterialType != 'ZROH') ) print( $G_MaterialType
|| ' is not a valid Material Type' );
if ( ( $G_MaterialType != 'ZHAW') and ( $G_MaterialType != 'ZROH') ) raise_exception(
$G_MaterialType || ' is not a valid Material Type' );
end

else
begin
print( 'Do not worry about this message if you are running in UPDATE MODE: ');
print( 'Highest SAP Material No is: ' || $L_MATNR );
$L_MATNR = $L_MATNR + 1;
print( 'Next SAP Material No will be: ' || $L_MATNR );
end

print( '--------------------------------------END OF INFO: SAP Material No --------------------------------');

You might also like