cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

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

Groovy
Explorer
0 Likes
1,089

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

 

View Entire Topic
Groovy
Explorer
0 Likes

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