Skip to Content
author's profile photo Former Member
Former Member

Problem in executing function BAPI_MATERIAL_SAVEDATA with SAPJCO

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

}

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on May 04, 2004 at 09:50 AM

    Hi Jakeer,

    is it possible for you to access the corresponding R/3 system directly (via SAPGUI)? Then, the following steps might help:

    1. Goto transaction SE37, enter BAPI_MATERIAL_SAVEDATA as function module name. Look at the documentation (reachable from the menu) of the BAPI. Since it's a BAPI, it should be well documented, including the minimum requirements for parameter and structure filling.

    2. If that's not sufficient, activate the function module test by pressing F8. You can enter all the parameters there and save them as test environment(s). Test-run it until it succeeds (changing/adding parameters). Since there's no commit, the material will not be saved (hopefully).

    3. As far as i remember, MM materials have short and long descriptions, you didn't fill the short one, so that might be the current error reason.

    Hope that helps.

    Regards

    Stefan

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Stefan,

      Thanks for the instant reply,i was able to trace whats causing this error.The problem is i was appending a row and then inserting a new row and the result is it appends an empty row in the Table MATERIALDESCRIPTION and this causes the error <b>You have not fully maintained the descriptions</b> .This problem is solved by materialdesc.insertRow(0)(ie,inserting row at the appropriate index).

      Thanks,Jakeer

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.