Skip to Content
0
Former Member
Nov 28, 2006 at 09:22 AM

Update Code not working

25 Views

Iam unable to update the "BAPI_SALESORDER_CREATEFROMDAT2" using JCo.Though its not giving any error but even after commit iam unable to see the change.

//----


JCO.Client client = JCO.createClient("100", "Username", "password", "EN", "hostname", "00");

client.connect();

JCO.Repository repository = new JCO.Repository("REPOSITORY", client);

JCO.Function function = repository.getFunctionTemplate("BAPI_SALESORDER_CREATEFROMDAT2").getFunction();

JCO.Structure orderHeaderIn = function.getImportParameterList().getStructure("ORDER_HEADER_IN");

orderHeaderIn.setValue(salesOrg,"SALES_ORG");

orderHeaderIn.setValue(distChannel,"DISTR_CHAN");

orderHeaderIn.setValue(division,"DIVISION");

orderHeaderIn.setValue(salesDocType,"DOC_TYPE");

JCO.Table orderPartners = function.getTableParameterList().getTable("ORDER_PARTNERS");

orderPartners.appendRow();

orderPartners.setValue(partnerRole,"PARTN_ROLE");

orderPartners.setValue(partnerNumber,"PARTN_NUMB");

JCO.Table orderItemsIn = function.getTableParameterList().getTable("ORDER_ITEMS_IN");

orderItemsIn.appendRow();

orderItemsIn.setValue(material,"MATERIAL");

client.execute(function);

JCO.Function BAPI_TRANSACTION_COMMIT = new JCO.Function(mRepository.getFunctionTemplate("BAPI_TRANSACTION_COMMIT"));//

client.execute(BAPI_TRANSACTION_COMMIT);