cancel
Showing results for 
Search instead for 
Did you mean: 

Personas 3 script issues while calling a custom RFC-enable function module

Groovy
Explorer
0 Kudos

Hello,

I have a simple requirement to read the company code and posting date from the screen, execute a custom function module and output fiscal year and fiscal period for information on customized FB01 transaction screen. The FM is very simple:

Groovy_0-1707986379480.png

Now, when getting to the script in SAP Personas i have several issues:

1. When trying to pass the parameter the issue is the syntax error below:

Groovy_1-1707986561407.png

While i can correct it by converting the input parameters .toString

FmCall.setParameter("I_BUKRS", companyCode.toString);
FmCall.setParameter("I_BUDAT", postingDate.toString);

then comes issue 2:

Groovy_2-1707986988098.png

Any help with the script is highly appreciated. Thank you

 

Accepted Solutions (0)

Answers (2)

Answers (2)

Groovy
Explorer
0 Kudos

Tamas,

Thank you for your reply. I got it to work in the most weird way - i just adopted the template RFC call, that's it.

Groovy_0-1708168295839.png

Defeats my imagination as to why it would start working while a manually written code, different only in some var names, doesn't. Inasmuch as i hate those 'automagical' solutions, the solution now works. The SAP-JS interpreter still tells me there's a syntax error but the code works and returns the desired values.

Groovy_1-1708168440843.png

Go figure.

Merci

 

 

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

At first glance, your script looks OK.

Then, the ubiquitous questions: Which Personas SP are you running, and do you have an all-green note check list in Health Check, with every available relevant note implemented?

Groovy
Explorer
0 Kudos
Tamas, posted a reply as an answer to my own message.