Skip to Content
0
Former Member
May 04, 2004 at 09:26 AM

Problem in executing function BAPI_MATERIAL_SAVEDATA with SAPJCO

155 Views

Hello,

I am using SAPJCO2.0.2 to create a material in the SAPR/3 when i execute the function BAPI_MATERIAL_SAVEDATA by setting all the possibble values i get the following error in response.It doesnt give any descriptive error just says the message,pls help me to find a solution.

<b>ERROR You have not fully maintained the descriptions </b>

the code is as follows.Pls help me in fixing this problem coz i find no detailed description causing this error and i am new bee to SAP.

public void createMaterial()

{

try{

String number=getIntNumber();

System.out.println("MATNO" + number);

JCO.Function jcofunction=_aConnector.createFunction("BAPI_MATERIAL_SAVEDATA");

JCO.ParameterList input=jcofunction.getImportParameterList();

JCO.ParameterList tables=jcofunction.getTableParameterList();

// SAPConnector.getGlobalClient().setAbapDebug(true);

/*HEADDATA FOR BASIC VIEW

*/

JCO.Structure headdata=input.getStructure("HEADDATA");

headdata.setValue(number,"MATERIAL");

headdata.setValue("1","IND_SECTOR");

headdata.setValue("HAWA","MATL_TYPE");

headdata.setValue("X","BASIC_VIEW");

headdata.setValue("E","INP_FLD_CHECK");

/*CLIENTDATAX FOR BASIC VIEW

*/

JCO.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");

/*CLIENTDATA FOR BASIC VIEW

*/

JCO.Structure clientdata=input.getStructure("CLIENTDATA");

clientdata.setValue("110","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");

/*MATERIALDESCRIPTION FOR BASIC VIEW

*EN

*/

JCO.Table materialdesc=tables.getTable("MATERIALDESCRIPTION");

materialdesc.appendRow();

materialdesc.setValue("EN","LANGU_ISO");

materialdesc.setValue("INJECTION PUMP PULLEY PULLER","MATL_DESC");

materialdesc.insertRow(1);

//DE

materialdesc.setValue("DE","LANGU_ISO");

materialdesc.setValue("PULLEY ABZIEHER","MATL_DESC");

materialdesc.insertRow(1);

materialdesc.setValue("IT","LANGU_ISO");

materialdesc.setValue("INJECTION PUMP PULLEY PULLER","MATL_DESC");

materialdesc.insertRow(1);

materialdesc.setValue("ES","LANGU_ISO");

materialdesc.setValue("EXTRACTOR POLEA BOMBAINYECTORA","MATL_DESC");

materialdesc.insertRow(1);

materialdesc.setValue("PT","LANGU_ISO");

materialdesc.setValue("INJECTION PUMP PULLEY PULLER","MATL_DESC");

materialdesc.insertRow(1);

materialdesc.setValue("NL","LANGU_ISO");

materialdesc.setValue("INJECTION PUMP PULLEY PULLER","MATL_DESC");

materialdesc.insertRow(1);

materialdesc.setValue("FR","LANGU_ISO");

materialdesc.setValue("INJECTION PUMP PULLEY PULLER","MATL_DESC");

materialdesc.insertRow(1);

//MeasureX

JCO.Table measurex=tables.getTable("UNITSOFMEASUREX");

measurex.appendRow();

measurex.setValue("X","ALT_UNIT_ISO");

// measurex.setValue("X","DEL_FLAG");

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.insertRow(1);

//Measure

JCO.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.111,"VOLUME");

measure.setValue("CMQ","VOLUMEUNIT_ISO");

measure.setValue(0.111,"GROSS_WT");

measure.setValue("KGM","UNIT_OF_WT");

measure.insertRow(1);

SAPConnector.getGlobalClient().execute(jcofunction);

JCO.Function jcoCommit = aConnector.createFunction("BAPITRANSACTION_COMMIT");

if ( jcoCommit == null )

{

throw new RuntimeException("function not found");

}

SAPConnector.getGlobalClient().execute(jcoCommit);

JCO.Structure areturn=jcofunction.getExportParameterList().getStructure("RETURN");

areturn.writeHTML("c:/create.html");

System.out.println("type " + areturn.getValue("TYPE"));

}