cancel
Showing results for 
Search instead for 
Did you mean: 

P&PM Cloud - Remote Function Adapter

romuald_colletaz
Product and Topic Expert
Product and Topic Expert
1,202

Hi everyone,

P&PM Cloud provides 2 types of Remote Function Adapter function: JavaScript and Python. Do you know if there are some examples available in the sample contents or a blog to explain how to implement such a script?

Thanks for your help,

Have a nice day,

Romuald

Accepted Solutions (0)

Answers (4)

Answers (4)

Angelou
Product and Topic Expert
Product and Topic Expert

Hi Romuald,

Good day and hope you are well.

Yes, in PaPM Cloud we have 2 types of Remote Function Adapter which are JavaScript and Python.

A sample content which incorporates RFA Python will be available in Q2. For now, I can provide simple scenarios for both functions RFA JavaScript and Python.

For RFA JavaScript:

This simple scenario is meant to assign a value to KF_OUTPUT by 2.

Let's say we have a model table connected as input like the image below:

On the RFA JavaScript function, we will be needing to add the field CH_PROD(Product) on Selection fields to show the column in the result and also the KF_INPUT(INPUT) to be able to use it on our formula on our JavaScript rules later on.

Then, on Action fields, we will be adding the KF_OUTPUT(OUTPUT) so we can assign a value for it using the formula.

Moving on to our JavaScript Rules, we will be using the for loop to get the data of our input table row by row like the image below. (The green ones are the comment I manually maintained to serve as explanation per line).

As you can see on the image above, we declare the variable value as the KF_INPUT then for the KF_OUTPUT we put a formula which is value * 2. Therefore, the result of the code above should be like this:

On the output column, the value should be the result of KF_INPUT * 2 as expected.

For RFA Python:

Actually, if we will execute the same scenario above, the only difference is the code / Python rules. Below is the simple code sample and put a comment per line for explanation:

Though, these ones are very simple but I hope it helps. You can expect a blog post related to this one to be released in the future.

Best Regards,
Gelo

akki0785
Participant
0 Kudos
Fabrício
Participant
0 Kudos

Hi,

Is it possible call a RFC in SAP S/4 HANA using PaPM Cloud Python function?

Thanks,

Fabrício Souza

emanuele_fumeo
Product and Topic Expert
Product and Topic Expert

Hi Fabricio,

please create a new question, you posted it as an answer to the question above.

Please refer to my comment:
https://blogs.sap.com/2023/12/28/using-the-python-rfa-function-in-papm-to-calculate-the-difference-b...

Kind Regards,
Emanuele

romuald_colletaz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Gelo,

Thanks for the examples, I was wondering how to access to the data from the input function from the script.

Are there any guidelines explaining in which use cases JavaScript is more suitable than Python and vice versa?

Best regards,

Romuald