HOW TO IMPLEMENT CUSTOM USER DEFINED FUNCTIONS IN FORMULA EDITOR FOR DECISION STEP OF THE PROCESS CHAIN
This document will explain you on how to use the custom user defined functions in the decision step of the process chain.
IMPLEMENTATION OF BADI “RSAR_CONNECTOR”
Display the BADI “RSAR_CONNECTOR” in SE18
Create an implementation as explained below.
Save and activate the implementation, then the implementation will change to Active.
Go to the “Name of implementing class” and do the custom coding inside the method
“IF_EX_RSAR_CONNECTOR~GET”
Make sure that the new custom function should start with “C_”.
Create a class ZTEST_CL_DATE and method CHECK_DATE.
CREATION OF PROCESS CHAIN AND USE OF THE CUSTOM DEFINED FUNCTION
Now go to RSPC transaction and create a process chain as below, where we will use the custom defined function created in the decision step.
In the below chain we will create Start step –> Decision step –> Program step
Decision step with condition on ‘Friday’
Now from the drop-down list select CUSTOM User defined functions and then add the custom and save the step.
Now do the check and activate the chain, then execute the chain.
After executing monitor it in ST13 and the result should be decision 1 should be executed and it ran as expected.
Kindly provide your feedback or any further points to be included.
Thanks, really good explained!
Regards,
Jürgen
You are welcome Jurgen 🙂
Nice document!! Thanks!
You are welcome Mariano 🙂
Hi,
Thanks a lot for the document, very helpful!!
Just a comment about an issue I faced recently: if afterwards, all this, was implemented in the system, you change the method parameters within your class, because you want to enhance the functionality. You may face issues when trying to use it again, because it seems the system it is not updating properly the table: SFBMETHSIG which contains the parameters of the method used in the decision step within RSPC.
So, until this "bug" is fixed, I recommend you to create a clean new method in that case, and so avoid the issue.
Regards!
Hi,
Could you please show the declaration of importing\exporting parameters of the class? And is it possible to declare more than one importing parameter? If yes, how to pass the values into custom function in formula editor?
Many thanks!
Hi Igor,
The declaration in the import/export has nothing special, you can put anything you need if it is allowed by the formula editor to be used. And of course you can use more than one. In my case I used some strings. Something like:
C_CHECK_( 'String1', 'String2' ) = 'TRUE'
In the logic, those strings are checked against some tables, and if the meet the requirements for that current day, they send back TRUE.
Thanks! Thus I mean what is the sequence of the tranfsfer parameters in the formula. Is it match the order of the importing parameters in the method declaration?
Yes, it does.
Everything explained so clearly... Good Work ..
Thanks Puja 🙂
This is the kind of blog you enjoy to read: Simply clearly, easy step by step to reproduce
Nice job Thanga
Thanks @Alexandre Behaegel