cancel
Showing results for 
Search instead for 
Did you mean: 

Updation of Record in SAP using JAVA

Former Member
0 Kudos

Hi all,

My function Module name is BAPI_COMPANYCODE_GETLIST.Here i want to send some input data to update a record which is there in SAP.

JCO.Table codes =

function.getTableParameterList().getTable("COMPANYCODE_LIST");

after setting values as

codes.setValue("","");

Is it necessary to have codes.appendRows(1); before executing the function module

Regards

Padma N

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi padma,

Function func = getDefaultJCoConnection().getJCoFunction(FUNCTION MODULE NAME);

func.getImportParameterList().getField(IMPORTPARAMETER).setValue(VALUE);

Table table = func.getTableParameterList().getTable(TABLENAME);

productTable.appendRow();

productTable.setValue(VALUE1,FIELDNAME1);

productTable.setValue(VALUE2,FIELDNAME2);

getDefaultJCoConnection().execute(func);

Follow this code and send parameters through table to an RFC

Regards,

Sateesh Chandra

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi Padma,

If you are trying to update rows of record to the backend system. you have to set(bind, addElement, append) the value before executing.

For example, if cardinality is 0..1 you may add sole element or bind this element. If the cardinality is 0..n (rows of record) then you may either bind collection of elements or add elements one by one.

Regards, Suresh KB