cancel
Showing results for 
Search instead for 
Did you mean: 

JCA - input parameters

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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

gregorw
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi Gregor,

That does exactly what I need... but... I am not building on top of the EP Portal, I am developping a custom independant web app...

IStructureFactory, IRecordSet, etc... are not available on javax.resource.cci.*