Skip to Content
0
Former Member
Apr 08, 2007 at 02:42 PM

Sales Order and obligatory material's parameter fields - help!!!

23 Views

Hi,

My problem is:

I've got to create material in MM by using BAPI_MATERIAL_SAVEDATA, so that this material can be later used as an item in Sales Order (SD). Do you know what parameter fields from which structures are obligatory in my case? I've already passed quite a lot of data to this BAPI, but I still get following error:

"Material myMaterial is not defined for sales org. 4000, distr.chan. 01, language FI"

Any suggestion will be appreciated and properly rewarded if useful.

My Java source-code is available below. Check this out and let me know what is missed.

/*
			 * HEADDATA FOR BASIC VIEW
			 */
 
			Structure headData = input.getStructure("HEADDATA");
			headData.setValue(_material, "MATERIAL");
			headData.setValue("1", "IND_SECTOR");
			headData.setValue(_matl_type, "MATL_TYPE");
			headData.setValue("X", "BASIC_VIEW");
			headData.setValue("X", "SALES_VIEW");
			//headData.setValue("X", "MRP_VIEW");
			headData.setValue("E", "INP_FLD_CHECK");
 
			/*
			 * CLIENTDATAX FOR BASIC VIEW
			 */
			Structure clientDatax = input.getStructure("CLIENTDATAX");
			clientDatax.setValue("X", "MATL_GROUP");
			clientDatax.setValue("X", "OLD_MAT_NO");
			// clientdatax.setValue("X", "PROD_HIER");
			clientDatax.setValue("X", "BASE_UOM_ISO");
			clientDatax.setValue("X", "NET_WEIGHT");
			clientDatax.setValue("X", "UNIT_OF_WT_ISO");
			clientDatax.setValue("X", "ITEM_CAT");
			clientDatax.setValue("X", "PUR_VALKEY");
			clientDatax.setValue("X", "LABEL_TYPE");
			clientDatax.setValue("X", "LABEL_FORM");
			clientDatax.setValue("X", "DIVISION");
 
			/*
			 * CLIENTDATA FOR BASIC VIEW
			 */
			Structure clientData = input.getStructure("CLIENTDATA");
			clientData.setValue("02", "MATL_GROUP");
			clientData.setValue("testmaterial", "OLD_MAT_NO");
			// clientdata.setValue("1000000790","PROD_HIER");
			clientData.setValue("PCE", "BASE_UOM_ISO");
			clientData.setValue(0.111, "NET_WEIGHT");
			clientData.setValue("KGM", "UNIT_OF_WT_ISO");
			clientData.setValue("NORM", "ITEM_CAT");
			clientData.setValue("UV03", "PUR_VALKEY");
			clientData.setValue("1", "LABEL_TYPE");
			clientData.setValue("E1", "LABEL_FORM");
			clientData.setValue("01", "DIVISION");
			
			/*
			 * SALESDATAX
			 */
			Structure salesDatax = input.getStructure("SALESDATAX");
			salesDatax.setValue("4000","SALES_ORG");
			salesDatax.setValue("01","DISTR_CHAN");
			salesDatax.setValue("X","ITEM_CAT");
			salesDatax.setValue("X","DELYG_PLNT");
			
			
			/*
			 * SALESDATA
			 */
			Structure salesData = input.getStructure("SALESDATA");
			salesData.setValue("4000","SALES_ORG");
			salesData.setValue("01","DISTR_CHAN");
			salesData.setValue("NORM","ITEM_CAT");
			salesData.setValue("4200","DELYG_PLNT");
			
			/*
			 * PLANTDATAX
			 */
			Structure plantDatax = input.getStructure("PLANTDATAX");
			plantDatax.setValue("4200", "PLANT");
			plantDatax.setValue("X", "MRP_TYPE");
			plantDatax.setValue("X", "MRP_CTRLER");
			plantDatax.setValue("X", "REORDER_PT");
			plantDatax.setValue("X", "MINLOTSIZE");
			plantDatax.setValue("X", "LOADINGGRP");
			
			/*
			 * PLANTDATA
			 */
			Structure plantData = input.getStructure("PLANTDATA");
			plantData.setValue("4200", "PLANT");
			plantData.setValue("ND", "MRP_TYPE");
			plantData.setValue("001", "MRP_CTRLER");
			plantData.setValue("0", "REORDER_PT");
			plantData.setValue("100", "MINLOTSIZE");
			plantData.setValue("0001", "LOADINGGRP");
			
			/*
			 * MATERIALDESCRIPTION EN
			 */
			Table materialDesc = tables.getTable("MATERIALDESCRIPTION");
			materialDesc.appendRow();
			materialDesc.setValue("ENGLISH", "LANGU");
			materialDesc.setValue("EN", "LANGU_ISO");
			materialDesc.setValue(_material+" - test for sales order", "MATL_DESC");
			
			/*
			 * MATERIALDESCRIPTION FI
			 */
			materialDesc.appendRow();
			materialDesc.setValue("FINNISH", "LANGU");
			materialDesc.setValue("FI", "LANGU_ISO");
			materialDesc.setValue(_material+" - test FI", "MATL_DESC");
			// materialdesc.insertRow(0);
 
			// MeasureX
			Table measurex = tables.getTable("UNITSOFMEASUREX");
			measurex.appendRow();
			measurex.setValue("X", "ALT_UNIT_ISO");
			measurex.setValue("X", "UNIT_DIM_ISO");
			measurex.setValue("X", "LENGTH");
			measurex.setValue("X", "WIDTH");
			measurex.setValue("X", "HEIGHT");
			measurex.setValue("X", "VOLUME");
			measurex.setValue("X", "VOLUMEUNIT_ISO");
			measurex.setValue("X", "GROSS_WT");
			measurex.setValue("X", "UNIT_OF_WT");
			measurex.setValue("X", "UNIT_OF_WT_ISO");
			// measurex.insertRow(0);
 
			// Measure
			Table measure = tables.getTable("UNITSOFMEASURE");
			measure.appendRow();
			measure.setValue("PCE", "ALT_UNIT_ISO");
			// measure.setValue("X","DEL_FLAG");
			measure.setValue("CMT", "UNIT_DIM_ISO");
			measure.setValue(0.111, "LENGTH");
			measure.setValue(0.111, "WIDTH");
			measure.setValue(0.111, "HEIGHT");
			measure.setValue(0.3, "VOLUME");
			measure.setValue("CMQ", "VOLUMEUNIT_ISO");
			measure.setValue(0.111, "GROSS_WT");
			measure.setValue("KGM", "UNIT_OF_WT");
			measure.setValue("KG", "UNIT_OF_WT_ISO");
			
			//Tax classifications
			Table tax = tables.getTable("TAXCLASSIFICATIONS");
			tax.appendRow();
			tax.setValue("FI", "DEPCOUNTRY");
			tax.setValue("FI", "DEPCOUNTRY_ISO");
			tax.setValue("MWST", "TAX_TYPE_1");
			tax.setValue("1", "TAXCLASS_1");
			
			//tax.setValue("01", "TAX_IND");
			
			tax.appendRow();
			tax.setValue("EN", "DEPCOUNTRY");
			tax.setValue("EN", "DEPCOUNTRY_ISO");
			tax.setValue("MWST", "TAX_TYPE_1");
			tax.setValue("2", "TAXCLASS_1");