Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP Script 'Parameter expected' Error

Former Member
0 Likes
1,555

Hi All,

I am working on a script and in the text element i am using an if statement which spans over 2 lines as below:

/:    IF &lv_var1& EQ 'a' OR &lv_var2& EQ 'b' OR

      &lv_var3& EQ 'c' OR &lv_var4& EQ 'd'.

On syntax check, I am getting the error : Parameter expected in between the 2 lines.

So, what could be the possible reason for the above error.

Regards,

Tanushree

6 REPLIES 6
Read only

Former Member
0 Likes
1,026

Hi Tanushree,

You should write in both lines in the sapscript '/: ' like this:

/:    IF &lv_var1& EQ 'a' OR &lv_var2& EQ 'b' OR

/:          &lv_var3& EQ 'c' OR &lv_var4& EQ 'd'.

Try this

Read only

0 Likes
1,026

It too gives the same error.

Read only

0 Likes
1,026

Hi

Probably you need to write the whole IF condition in only one command line:


/: IF &lv_var1& EQ 'a' OR &lv_var2& EQ 'b' OR &lv_var3& EQ 'c' ....

Max

Read only

Former Member
0 Likes
1,026

Hi Tanushree,

Have you tried in the same line using left/right page (click right mouse button)?

Or try, for example, with a paragraph Z1, we use the '=' in the second line:

Z1 &var1&,,&var2&,,...

=   &var3&

But don´t know if it works with a command line...

Teresa

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,026

As said in the documentation: "The entire control statement must fit into one line; spreading it over subsequent lines is not allowed"

Read only

Former Member
0 Likes
1,026

Use Graphical Editor (Setting->Form Painter->(Sapscript Tab)->Tick Graphical PC Editor.

Inside the window, Click Insert Command in Tool Bar then insert your condition as 1 line in Command Option.