Skip to Content
Author's profile photo Thanga Prakash Thanga Raj

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

/wp-content/uploads/2014/07/01_490807.jpg

Create an implementation as explained below.

/wp-content/uploads/2014/07/01_490807.jpg

/wp-content/uploads/2014/07/02_490839.jpg

Save and activate the implementation, then the implementation will change to Active.

/wp-content/uploads/2014/07/03_490840.jpg

Go to the “Name of implementing class” and do the custom coding inside the method

“IF_EX_RSAR_CONNECTOR~GET”

/wp-content/uploads/2014/07/04_490841.jpg

Make sure that the new custom function should start with “C_”.

/wp-content/uploads/2014/07/05_490842.jpg

Create a class ZTEST_CL_DATE and method CHECK_DATE.

/wp-content/uploads/2014/07/06_490843.jpg

/wp-content/uploads/2014/07/07_490844.jpg

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

/wp-content/uploads/2014/07/01_490807.jpg

Decision step with condition on ‘Friday’

/wp-content/uploads/2014/07/02_490839.jpg

Now from the drop-down list select CUSTOM User defined functions and then add the custom and save the step.

/wp-content/uploads/2014/07/03_490840.jpg

Now do the check and activate the chain, then execute the chain.

/wp-content/uploads/2014/07/04_490841.jpg

After executing monitor it in ST13 and the result should be decision 1 should be executed and it ran as expected.

/wp-content/uploads/2014/07/05_490842.jpg

Kindly provide your feedback or any further points to be included.

Assigned tags

      14 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Thanks, really good explained!

      Regards,

      Jürgen

      Author's profile photo Thanga Prakash
      Thanga Prakash
      Blog Post Author

      You are welcome Jurgen 🙂

      Author's profile photo Mariano Cabalen
      Mariano Cabalen

      Nice document!! Thanks!

      Author's profile photo Thanga Prakash
      Thanga Prakash
      Blog Post Author

      You are welcome Mariano 🙂

      Author's profile photo alexis sanz
      alexis sanz

      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!

      Author's profile photo Igor Klushnev
      Igor Klushnev

      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!

      Author's profile photo alexis sanz
      alexis sanz

      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.

      Author's profile photo Igor Klushnev
      Igor Klushnev

      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?

      Author's profile photo alexis sanz
      alexis sanz

      Yes, it does.

      Author's profile photo Former Member
      Former Member
      ou>
      Author's profile photo Puja Jaiswal
      Puja Jaiswal

      Everything explained so clearly... Good Work ..

      Author's profile photo Thanga Prakash
      Thanga Prakash
      Blog Post Author

      Thanks Puja 🙂

      Author's profile photo Alexandre Behaegel
      Alexandre Behaegel

      This is the kind of blog you enjoy to read: Simply clearly, easy step by step to reproduce
      Nice job Thanga

      Author's profile photo Thanga Prakash Thanga Raj
      Thanga Prakash Thanga Raj
      Blog Post Author

      Thanks @Alexandre Behaegel