cancel
Showing results for 
Search instead for 
Did you mean: 

Text Module - Can we use commands like IF, CASE, LOOP etc in the text modul

Former Member
0 Kudos

Hi Member,

Iu2019ve created Smartform and text Module. My smartform is using the text module. I would like to include commands like IF, CASE, LOOP etc in the text module but not successful so far. Is this possible?

Also I canu2019t drag and drop the fields from smartform to text module.

Thank you very much for help.

u2026Naddy

<MOVED BY MODERATOR TO THE CORRECT FORUM>

Edited by: Alvaro Tejada Galindo on Dec 17, 2009 9:44 AM

Accepted Solutions (1)

Accepted Solutions (1)

SuhaSaha
Advisor
Advisor
0 Kudos

Hello Naddy,

1. I would like to include commands like IF, CASE, LOOP etc in the text module but not successful so far. Is this possible?

Ans: I donot think it is possible. You can add the conditions in the condition tab of the text element. For CASE, LOOP etc you have add a Logic Node.

2. Also I canu2019t drag and drop the fields from smartform to text module.

Ans: You cannot drag & drop fields directly to a text module, but you can define the smartform fields you want to use in the text module while creating it. Viz.,

Company Code: &V_BUKRS&

where V_BUKRS is a SF variable.

Hope i am clear.

BR,

Suhas

Former Member
0 Kudos

Thank you Suhas.

I'm trying to use IF statement in Text Module but it is not working with variables.

If i use IF 1 = 0, then it works fine... (command line /: )

If i use IF ID = 10001, then not working (ID is variable from Form Interface)

...Naddy

Edited by: Naddy on Dec 17, 2009 7:24 PM

SuhaSaha
Advisor
Advisor
0 Kudos

Hello Naddy,

So stupid of me. You can always use the line editor & write your commands. Stupid me

Anyways it will not work b'coz you have missed the amps . Try:

/: IF &ID&  = 0.
.....
/: ENDIF.

BR,

Suhas

Former Member
0 Kudos

Actually ii was trying /: IF &ID& = 0 but not working...

When &ID& as default paragraph, it displays as dark color....

When IF &ID& = 0. as command line, it displays as light color....

You can try in your system.

...Naddy

former_member387317
Active Contributor
0 Kudos

Hi Naddy,

That is normal behaviour..

For the lines you are placing in or between command lines /: will be litlle lighter color

and if you declare varible alone without /: then it will be darker..

Just checkout the output.. it shoudl work... if still not working then check out the value of &ID& ( I mean ID )

Also don't forget to put ENDIF with command line /: (Note no dot after ENDIF or any command)

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

ilesh Nandaniya

Former Member
0 Kudos

I'm using lines in text module as bleow and condition is correct ( and no dot) ...but not Title Key and title Key texts not displayed...You can try it in the system.

/: IF &RCF_S_CS_DI_CANDIDATE_IT-CANDIDATEID& EQ 50003471

* Form of Address Key: &RCF_S_CS_DI_CANDIDATE_IT-TITLE_KEY&

* Form of Address Text: &RCF_S_CS_DI_CANDIDATE_IT-TITLE_KEY_TXT&

/: ENDIF

...Nandhs

Edited by: Naddy on Dec 17, 2009 8:08 PM

Former Member
0 Kudos

Hi,

Put Candidate id in single quotes like..

/: IF &RCF_S_CS_DI_CANDIDATE_IT-CANDIDATEID& EQ '50003471'

Regards,

KK

Former Member
0 Kudos

the single quote is not working.

It is working if use same field to compare with Equal and Not Equal

/: IF &RCF_S_CS_DI_CANDIDATE_IT-CANDIDATEID& EQ

= &RCF_S_CS_DI_CANDIDATE_IT-CANDIDATEID&.

* Form of Address Key: &RCF_S_CS_DI_CANDIDATE_IT-TITLE_KEY&

/: ENDIF.

/: IF &RCF_S_CS_DI_CANDIDATE_IT-CANDIDATEID& NE

= &RCF_S_CS_DI_CANDIDATE_IT-CANDIDATEID&.

* Form of Address Key: &RCF_S_CS_DI_CANDIDATE_IT-TITLE_KEY&

/: ENDIF.

...Naddy

Answers (1)

Answers (1)

former_member387317
Active Contributor
0 Kudos

Hi Naddy,

Alwayse put varibles between two & in SAPscript and SMARTFORM

IF &VAR& EQ 0  " Command /: in your case VAR is ID
Your code
ENDIF  " Command /: 

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

ilesh Nandaniya