on 04-08-2007 3:42 PM
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");
Ok....I've solved my problem:
To table material description LANGU and LANGU_ISO must be passed in one letter standard, for example:
E means english
U means finnish
so....old code:
materialDesc.appendRow();
materialDesc.setValue("FINNISH", "LANGU");
materialDesc.setValue("FI", "LANGU_ISO");
materialDesc.setValue(_material+" - test FI", "MATL_DESC");
new code:
materialDesc.appendRow();
materialDesc.setValue("U", "LANGU");
materialDesc.setValue("U", "LANGU_ISO");
materialDesc.setValue(_material+" - test FI", "MATL_DESC");
etc.
you can find abbreviations in:
<a href="http://help.sap.com/saphelp_46c/helpdata/en/67/237bd795da11d384bb0060975b04f3/frameset.htm">Press here</a>
Thanks for help.
Looking forward your cooperation with future problems.
If some have a question related to my problem, just ask.
Br,
Rafal K.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rafal,
This may seem like an obvious question, but has your MM person created/extended this material in R/3 for you? (MM01/MM02). The message is not really complaining about your parameters.
Alistair
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alistair,
I have a full access to SAP, so I can create and extend material whenever I want through MM01/MM02, but my target is to develop a method in Java, which creates a fully functional material to be used later in Sales Order.
A code listed in my prevoius post shows most of my method. I've got to indicate that my method works correctly and creates material. I've checked it through MM03 - I mean my material created with my method exists.
Moreover both sales org. and distr. channel are passed to BAPI, as you may see in the following code:
/*
* 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");
But the problem occurs when I wanna create Sales Order (VA01) and when I choose the item. Material created by my method causes error:
"Material myMaterial is not defined for sales org. 4000, distr.chan. 01, language FI"
I don't understand why? I'm not SAP specialist, but in my opinion I've passed necessary data.
Do you any idea?
Thanks in advance. Every helpful suggestion will be properly rewarded.
BR,
Rafal
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.