2006 Aug 24 2:08 PM
Hi All,
Whether this code is correct inside a text box in a Smartform ?
😕 IF &GS_NAME1& <> ''.
<T2>&GS_NAME1&</>
ENDIF.
😕 IF &GS_NAME2& <> ''.
<T2>&GS_NAME2&</>
😕 ENDIF.
Thanks in Advance ,
Vivek K ..
2006 Aug 24 7:23 PM
You can't put code like that in a Smartform textbox. What you can do is in the General Attributes tab, hit the Insert Field button and enter &GS_NAME1&. Then in the Conditions tab put GS_NAME1 in the 'field' column, <> in the 'Relational Operator' column, and INITIAL in the 'Comparison value' column.
Now the GS_NAME1 will only print if it is not initial.
Do the same for another text node for NAME2.
2006 Aug 24 7:23 PM
You can't put code like that in a Smartform textbox. What you can do is in the General Attributes tab, hit the Insert Field button and enter &GS_NAME1&. Then in the Conditions tab put GS_NAME1 in the 'field' column, <> in the 'Relational Operator' column, and INITIAL in the 'Comparison value' column.
Now the GS_NAME1 will only print if it is not initial.
Do the same for another text node for NAME2.
2006 Aug 24 9:24 PM
As suggested in the first post, you cannot use such coding. You may use variables as you would use it in any ABAP program. The only difference is: the variable has to be part of import/export parameters (of the individual code element) for you to use it in the code.
Raj
Reward points if helpful
2006 Aug 24 10:30 PM
You cannot use IF statements inside the smartforms text nodes.
In you case, you need to create two text nodes.
one to print <T2>&GS_NAME1&</>, in the condition tabs update the condition with field name GS_NAME1 and select <> option on Operartor column and value as Inital for the comparison.
Second to print <T2>&GS_NAME2&</>, in the condition tabs update the condition with field name GS_NAME2 and select <> option on Operartor column and value as Inital for the comparison.
2006 Aug 24 10:40 PM
Thank you friends , so i will create separate Text boxes for each of the Texts to be printed with Conditions
Vivek K .