SAP Net Weaver BPM (CE 7.2) allows you to import Web Services and RFC in BPM. Though Web Services are still recommended approach for their mature exception handling methodology and better governance, it’s worthwhile to understand how to call RFCs in BPM.
To implement the RFC in BPM, we will try to import a RFC which gets some random number from ABAP system. We will execute the RFC in BPM and map that to a DO to check the output and ensure successful execution.
Implementing RFC in BPM also involves small amount of configuration around SOA in NWA as well. As a part of this implementation we will quickly go through that too.
Please ensure (RFC enabled) FM already exists that can be called in BPM. The output of the FM will be an integer. (It doesn’t accept any value). Basic knowledge of CE BPM is assumed as most of the steps dont cover minute details.
Update R/3 Configuration in NWDS
To access an ABAP system during design time, please updated R/3 Configuration within SAP NetWeaver Developer Studio.
Go to Windows -> preferences -> Destination Configurations -> R/3 Configuration
Add new system there. Choose appropriate option from Load Balancing or Single server.
Enter host name, system number and valid user credentials
2. Create ABAP Provider System
To create ABAP provider system,
Go to NWA -> SOA Management -> Technical Configuration -> System Connection
Create new provider system for RFC communication.
Choose “System Type” as “ABAP”.
Uncheck WS connectivity if you don’t intend to use the system for ABAP WS
Uncheck “Use Load Balancing” if load balancer is not used and it is single server node scenario.
Enter system details and user details.
Ensure on Test Connection step, you should be able to successfully create connection to given system and click Finish.
With R/3 Configuration in NWDS and ABAP Provider system created, Proceed and create a Process Composer DC.
Create Process Composer DC
Create a simple process with only Start and End event. Expand process DC-> Right click on “Connectivity” -> Create New Service Group. Specify service group name and finish. Here, name SG_RFC is used.
In Project structure, Right click on “Service Interfaces” -> Import RFC. Search for your specific RFC, select it and Finish.
The proxies should be visible in the project structure.
Drag and drop the above created Service Interface or create an automated activity with above interface in Process.
Open the Properties of automated activity and create a new “Service Reference”.
In “Service Reference”, select New -> Choose Existing -> Select service group we created above. Here, it is “SG_RFC” and Finish. The “Service Reference” will be updated with selected service group.
To check the execution of RFC and its result, create a Data Object – DO_Number (String)- and map response of the automated activity to it. The mapping link might show error if the source andtarget data type are different.
For the error shown by the mapping link, Double-click the function icon with the error marker to open the expression editor for it. Click the expression and press CTRL + 1. Select the quick fix offered and select OK.
As the process just has an automated activity, to see the value of parameter you can add an Intermediate Timer activity which halts the progress of process for some time. (Alternatively, you can also see the context values in completed process as well.)
Build and Deploy the DC.
Assign Provider System
Before you test the process, go to NWA -> SOA Management -> Application and Scenario Communication -> Application Communication, Search for the deployed Process Composer DC and assign Provider system to its Service Group under “Consumed Service Groups” tab.
Start and Check the Process flow
Go to NWA -> Configuration Management -> Processes and Tasks -> Select the deployed Process and start.
To check the progress of process and RFC execution, go to NWA -> Operation Management -> Processes and Tasks -> Manage Processes, In Running Processes,
Open Context Data of the process and ensure DO_Number should show up number returned by RFC.
Value shown by DO_Number specifies the successful RFC execution.