cancel
Showing results for 
Search instead for 
Did you mean: 

If condition Not working in Smartform Text element

Former Member
0 Kudos

Hi All,

I am developing a smartform . In this the if condition not getting recognized in the text element. I have properly used the Command operator (/:) for the if condition.

ex:

/: IF &VBDKA-VKORG& EQ '0001' OR &VBDKR-VKORG& EQ '0001'

ST sales org 0001.

/: ELSEIF &VBDKA-VKORG& EQ '0002' OR &VBDKR-VKORG& EQ '0002'

ST sales org 0002.

/: Endif.

In the above example my text element prints both the texts.

Output:

sales org 0001.

sales org 0002.

can anyony please help me out.

Thanks & Regards,

Seenu K

Accepted Solutions (0)

Answers (4)

Answers (4)

prakashjasti
Contributor
0 Kudos

Dear Srinu,

Remove the & symbol before and after VBDKA-VKORG and VBDKR-VKORG

/: IF &VBDKA-VKORG& EQ '0001' OR &VBDKR-VKORG& EQ '0001'

ST sales org 0001.

/: ELSEIF &VBDKA-VKORG& EQ '0002' OR &VBDKR-VKORG& EQ '0002'

ST sales org 0002.

/: Endif.

Regards,

Prakash

Former Member
0 Kudos

Hi Seenu,

You can use a different approach..

Use the tab conditions to specify your if condition

create two text elements, specify the if condition on the conditions tab of the first text element. and in the general text tab enter the value that you need to print.

in the next text element on the conditions tab specify the else condintion and in the general tab specify the value that needs to be printed in the else condition

Former Member
0 Kudos

Hi Seenu,

You can't use the conditional statement inside the text element in a smartform. But it works for the sapscript.

Smartform provide many options for placing conditions. Please use the condition tab or alternative which give you an option of true or false...or check the condition inside your smartform.

Regards,

Selva K.

Former Member
0 Kudos

Hi,

Please use alternative(IF-TRUE-FALSE) option in the smartforms instead of using command line inside the text element.

Regards

Balaji R