on 09-20-2004 7:55 PM
Hi,
I am using JCA to call a standard bapi (BAPI_RESERVATION_CREATE).
It has one scalar parameter, one structure parameter (RESERVATION_HEADER) and one table parameter (RESERVATION)ITEMS).
In order to pass correctly the structure parameter, I did the following:
input = connectionfactory.getRecordFactory().createMappedRecord("BAPI_RESERVATION_CREATE");
MappedRecord header = (MappedRecord)input.get("RESERVATION_HEADER");
header.put("COST_CTR", "1110");
header.put("PARAM", "VALUE");
...
How do I do to put data in the RESERVATION_ITEMS table?
Does any one have an example of populating a table as a parameter in a BAPI?
Thank you
Dov
Hi Dov,
It's actually quite simple once you know that you to approach the import tables in the same way as the export tables, as ResultSets that you can pull out of the same input record as regular parameters.
input = connectionfactory.getRecordFactory().createMappedRecord(
"BAPI_RESERVATION_CREATE");
MappedRecord header = (MappedRecord)input.get("RESERVATION_HEADER");
header.put("COST_CTR", "1110");
header.put("PARAM", "VALUE");
ResultSet items = (ResultSet) input.get("RESERVATION_ITEMS);
items.moveToInsertRow();
items.updateString("MATERIAL", "ABC");
items.updateString("PLANT", "0001");
items.insertRow();
Hope this helps.
Cheers,
Jan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Dov,
have a look at this Download: <a href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/JCA%20on%20EP6%20Building%20Portal%20Applications.zip">JCA on EP6 Building Portal Applications</a>. In the PDF Documentation coming with it you find this example to fill a table:
IStructureFactory structureFactory
= interaction.retrieveStructureFactory();
IRecordSet table
= (IRecordSet) structureFactory.getStructure(
function.getParameter("TABLE_NAME").getStructure());
table.insertRow();
table.setString("COLUMN_NAME_1", "VALUE_1");
table.setString("COLUMN_NAME_2", "VALUE_2");
table.insertRow();
table.setString("COLUMN_NAME_1", "VALUE_1");
table.setString("COLUMN_NAME_2", "VALUE_2");
importParams.put("TABLE_NAME", table);
Regards
Gregor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.