SAP Screen Personas
Create: Sushant Priyadarshi Jan 14, 2015 19:38
Last Update: Regina Sheynblat Feb 14, 2017 20:59
How to call Remote Enabled ABAP Function Modules in Personas 3.0
SAP SCREEN PERSONAS KNOWLEDGE BASE - by Sushant Priyadarshi , Regina Sheynblat
This page provides an overview of using ABAP Function Modules from Personas 3.0 scripts.
In Personas 3.0, you can use script to call a Function Module which is "Remote Enabled" and "Whitelisted" by personas admin. Below, you will find 3 different examples of how to send/receive data from some standard BAPIs.
Checklist before using any Function
- Check whether the existing function is Remote Enabled. Go to transaction SE37 and enter the function module name. The highlighted radio button should be selected:
- Personas admin has to make the Function Module as WHITELISTED.
Go to transaction SM30 and display the table/view "/PERSONAS/C_RFCW".
You can also access to this view from Personas Admin Menu:
The maintenance screen displayed, with a sample FM already set:
3. Every RFC call made out of a SAP Screen Personas script runs and finishes it own Logical Unit of Work (LUW). In other words, if you want to run a "writing" RFC, such as changing the name of a business partner, you have to make sure that the chosen RFC function module finishes with a commit ( ABAP statement 'COMMIT WORK' ). Many standard RFCs come with a parameter that tells the RFC whether or not to commit (see for instance parameter 'WITHOUT_COMMIT' of sales order creation RFC 'BAPI_SALESORDER_CREATEFROMDAT1'). Others require subsequent call of RFC "BAPI_TRANSACTION_COMMIT". The latter group of non-committing RFC cannot be directly called from a script, or - to be precise - they can be called, but they will not work because the changes they perform will be rolled back at the end of the RFC call. Our suggestion for such non-committing RFCs is to create a custom, "wrapper" RFC that calls the desired RFC and then commits. See the example "Changing an Equipment Record" below.
Example 1 : Export/Import simple data parameter from "BAPI_USER_GET_DETAIL"
Example 2 : Export/Import table parameter from "SEPM_GWS_SALES_ORDERS_GET"
Example 3 : Changing an Equipment Record
The used custom RFC "ZBAPI_EQUI_CHANGE" calls standard RFC 'BAPI_EQUI_CHANGE' and then performs a "COMMIT WORK". ZBAPI_EQUI_CHANGE only has BAPI_EQUI_CHANGE's mandatory parameters.
Search the KB
Important SAP Notes
How to Open OSS Message
What information is needed for creating OSS message?