cancel
Showing results for 
Search instead for 
Did you mean: 

Execute a Function Module from Java

former_member374952
Participant
0 Kudos

I have a Function Module ZLIST_MATERIAL_DETAILS which accepts Two parameters MaterialID and MaterialName as VALUE in Import Parameter and returns all the Material Details as Export Parameter.

FM is RFC enabled and I am trying to execute this FM using Java application . I am able to establish connection to SAP from   Java Application .

I wanted to know the Syntax or an example of executing a SAP FM from Java by passing import parameters as value and display the export parameter information would be a great help .

Thanks in Advance .

Best Regards,

Viaml

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

if you use JRA for connection to the backend system, here is example how to call remote function module from Java:

Client Programming Model (SAP Library - Components of SAP Communication Technology)

In step 4.

input.put("MyBank",”BankOfWalldorf”);f

MyBank is the name of your import parameter in FM and BankOfWalldorf is the value of import parameter.

In step 6.

After execution you get output, which is also MappedRecord.

So getting specific return value:

output.get("NameOfOutputParameter")

NameOfOutputParameter is the name of output parameter from FM.

Conversion between Java and ABAP types is automated, so you shouldn't care of it.

I hope it helps.