cancel
Showing results for 
Search instead for 
Did you mean: 

Help required with com.sap.mw.jco

Former Member
0 Kudos

I am using com.sap.mw.jco for connecting to backend. I want to retrieve the values which are returned by a structure which is a part of export parameters for the RFC.

I am using the code as shown bellow:

-


IRepository repository = null;

JCO.Client client = null;

JCO.addClientPool( SID,MAX_NO_CONNECTION,CLIENT,USERID,PASSWORD,LANGUAGE,HOST_NAME,SYS_ID);

repository = JCO.createRepository("SUPPLIERID", "ISU");

JCO.Function function = null;

IFunctionTemplate functionTemplate = repository.getFunctionTemplate("BAPI_COMPANY_GETDETAIL");

function = functionTemplate.getFunction();

client = JCO.getClient(SID);

JCO.Field objUserIDField = input.getField("COMPANYID");

objUserIDField.setValue("1100");

//For this company id I have values in the backend

client.execute(function);

JCO.Structure companyList = null;

companyList = function.getExportParameterList().getStructure("COMPANY_DETAIL");

-


Now I need to get the values passed on by this structure can you please guide me how to do this

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

monalisa_biswal
Contributor
0 Kudos

hi Puneet,

You can use getString("Fieldname") on the structure to get field value.

[JCO API Link|https://help.sap.com/javadocs/NW04S/current/jc/index.html]

[JCOTutoral|http://www.apentia-forum.de/viewtopic.php?t=1962&sid=9ac1506bdb153c14edaf891300bfde25]

Hope this helps!

Monalisa

Answers (0)