on 03-06-2008 6:33 AM
Hi,
I am trying to pass some import parameters to an RFC enabled Function Module from Java using JCo and get some export parameters back in Java. In the function module that I am using, one of the import parameter and one of the export parameter is of type Structure (FIS_BANK_DETAIL). But I am not sure how to pass parameters to a 'structure'.
I know how to pass and get parameters from an FM when the import/export parameter is of normal data type(char, int.. etc.). This is how I do it:
SAPConnection connObj = new SAPConnection();
connection = connObj.getConnection(request, response);
interaction = connection.createInteractionEx();
IInteractionSpec interactionSpec = interaction.getInteractionSpec();
interactionSpec.setPropertyValue("Name", "Z_EP_GET_BP_RECORD");
RecordFactory rf = interaction.getRecordFactory();
MappedRecord input = rf.createMappedRecord("INPUT");
MappedRecord output = rf.createMappedRecord("OUTPUT");
// put function module input parameters
input.put("I_NAME_LAST", lastName);
input.put("I_NAME_FIRST", firstName);
output = (MappedRecord) interaction.execute(interactionSpec, input);
// get function module export parameters
email = (String) output.get("E_EMAIL");
How should the above code be changed for an import/export parameter of structure type?
Thanks,
Ajay
Hi Ajay,
Follow this code.
Function func = getDefaultJCoConnection().getJCoFunction(FuctionModuleName);
func.getImportParameterList().getStructure(StructureName1).setValue(Value1, FieldName1);
func.getImportParameterList().getStructure(StructureName2).setValue(Value2, FieldName2);
getDefaultJCoConnection().execute(func);
Regards,
Sateesh Chandra Ch
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ajay,
This is the method we have it in our super class. This is the general scenario which is followed in ISA programming. And the Function is available with JCO API
Regards,
Sateesh Chandra.
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 | |
24 | |
11 | |
9 | |
7 | |
5 | |
5 | |
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.