Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Unable to retreive records using BAPI_SALESORDER_GETLIST

Hi

I am trying to retreive rows from BAPI_SALESORDER_GETLIST using JSPDynpage. But it does not give me any records. I am quite skeptical about the way i am trying to retreive MATERIAL and BATCH number.

When i look at the log it gives me a type as "com.sapportals.connectors.SAPCFConnector.execution.structures.RecordSetWrapper@84918" for the statement ->

Object result = output.get("SALES_ORDERS");

The flow is not just geting into my While Loop.

Object rs = null;

IRecordSet exportTable = null;

Object result = output.get("SALES_ORDERS");

if ( result == null ) {

rs = new String(" ");

}

else if (result instanceof IRecordSet) {

exportTable = (IRecordSet) result;

exportTable.beforeFirst();

// Moves the cursor before the first row.

while (exportTable.next()) {

String column_1 = exportTable.getString("MATERIAL");

String column_2 = exportTable.getString("BATCH");

}

}

//create the tableview mode in the bean

myBean.createData(exportTable);

client.close();

Below is the source Code for My Bean :

public void createData(IRecordSet table) {

//this is your column names

Vector column = new Vector();

column.addElement("Material");

column.addElement("Batch");

//all this logic is for the data part.

Vector rVector = new Vector();

try {

table.beforeFirst();

while (table.next()) {

Vector data = new Vector();

data.addElement(table.getString("MATERIAL"));

data.addElement(table.getString("BATCH"));

rVector.addElement(data);

} } catch (Exception e) {

e.printStackTrace();

}

Suggestions are welcome.

Murali.

Not what you were looking for? View more on this topic or Ask a question