cancel
Showing results for 
Search instead for 
Did you mean: 

how to print a return structure for BAPI_PO_CREATE1

Former Member
0 Kudos

Hi i am working with creation of Purchase Order using JCO3. I am having difficulty in printing the return structure or the response. Could someone help in understanding what line of java code i have to add to print the response.


// Print the Return Message
//JCoStructure returnStructure = createPurchaseOrderFunction.getTableParameterList().getStructure("RETURN");
// JCoTable table = createPurchaseOrderFunction.getTableParameterList().getTable("Number");
// System.out.println("Field" + createPurchaseOrderFunction.getExportParameterList().getValue("Number"));
//System.out.println(table.);
//System.out.println("RETURN: \n" + returnStructure.getString("MESSAGE"));

I am not sure how to print and check the result of Purchase Order creation. Please tell me the exact table and structure with java code so that i can understand what wrong i am doin.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Do you have access to the backend SAP system so that you can test the call of the BAPI directly with your data?  It will also enable you to look at what the RETURN object looks like when it completes.  If you don't have this access, sit with someone who does who is an ABAPer and can talk you through what the BAPI is doing and how it works.

The RETURN object is actually a table and could contain multiple entries.  Also, EXPPURCHASEORDER is the field that will be populated with the PO number if your create was successful - I'm not sure where you have got the NUMBER attribute from?

And don't forget, if you call this BAPI you also need to call BAPI_TRANSACTION_COMMIT to save the PO into SAP, as part of the same session.

Cheers,

G.

Former Member
0 Kudos

Thanks Gareth , i am able to print return structure now , but still i need help on how to print the newly generated PO number. Can you please help in understanding how to get PO Number after successfully calling and creating PO using BAPI

Answers (1)

Answers (1)

vijay_kumar49
Active Contributor
0 Kudos

System.out.println("Field" + createPurchaseOrderFunction.getExportParameterList().getValue("Number"));    //System.out.println(table.);

what data is printing here. where did you check the data.

Former Member
0 Kudos

which data you are talking about ?