cancel
Showing results for 
Search instead for 
Did you mean: 

JCO connection- retrieving values ?

Former Member
0 Kudos

Hi ,

am retrieving value from BAPI using JCO connection.

To Retrieve an Export Parameter field: am using the following logic.

<b>Ex:</b>

String ret = function.getExportParameterList().getString( "Field" );

My Export parameter is the structure :

Material type <Structure>

Material have many fields.

i need to retrieve Ex: Material-matnr.

Please tell me how to retrieve the following field from BAPI?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Suresh,

Try the following

JCO.Structure returnStructure =

function.getExportParameterList().getStructure("RETURN");

if (! (returnStructure.getString("TYPE").equals("") ||

returnStructure.getString("TYPE").equals("S")) ) {

System.out.println(returnStructure.getString("MESSAGE"));

System.exit(1);

}

// till here its for getting the structure details where RETURN is the structure in this code and MESSAGE is a field inside the same.

codes =

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

for (int i = 0; i < codes.getNumRows(); i++) {

codes.setRow(i);

System.out.println(codes.getString("COMP_CODE") + '\t' +

codes.getString("COMP_NAME"));

//Till here the code is for getting the field values if you have a table parameter in your BAPI.

Cheers

JK

Former Member
0 Kudos

Hi Jayakrisnan,

Thanks for your wonderful answers.let me try and update you soon.

Thanks a Lot