Give the import parameter SALESDOCUMENT the value "00006973":
JCO.Field SalesDocumentField =
jcoFunction.getImportParameterList().getField("SALESDOCUMENT");
SalesDocumentField.setValue("00006973");
JCO.Table ORDER_PARTNERS = jcoFunction.getTableParameterList().getTable("ORDER_PARTNERS");
ORDER_PARTNERS.appendRow();
ORDER_PARTNERS.setValue("AG","PARTN_ROLE");
ORDER_PARTNERS.setValue("0000001032","PARTN_NUMB");
JCO.Structure order_header_inx = jcoFunction.getImportParameterList().getStructure("ORDER_HEADER_INX");
order_header_inx.setValue("I","UPDATEFLAG");
order_header_inx.setValue("X","DOC_TYPE");
JCO.Table myTable = jcoFunction.getTableParameterList().getTable("STATUSINFO");
for (int i=0; i < myTable.getNumRows(); i++)
myTable.setRow(i);
// Retrieve the value of the field DOC_DATE
oDocDate = myTable.getField("DOC_DATE").getValue();
Meesage type and message is stored in vector bapiReturn.
Vector bapiReturn;
JCO.Table jcoReturn = jcoFunction.getTableParameterList().getTable("RETURN");
for (int i = 0; i < jcoReturn.getNumRows(); i++)
{ jcoReturn.setRow(i);
String Message = jcoReturn.getField("TYPE").getValue() + " " +
jcoReturn.getField("MESSAGE").getValue();
bapiReturn.setSize(i + 1);
bapiReturn.setElementAt(new String(Message),i );
}
try
{ // Get a function template from the repository
IFunctionTemplate ftemplate = mRepository.getFunctionTemplate("BAPI_TRANSACTION_COMMIT");
// Create a function from the template
jcoCommit = new JCO.Function(ftemplate);
if ( jcoCommit == null )
// Do something..;
}
catch (Exception mException)
{ mException.printStackTrace(); }
// Execute COMMIT
try
{ sapConnection1.mConnection.execute(jcoCommit);
}
catch (Exception mException)
{ mException.printStackTrace(); }
| Converted from CHM to HTML with chm2web Standard 2.7 (unicode) |