cancel
Showing results for 
Search instead for 
Did you mean: 

conditions in smartforms

HarshalVakil
Active Contributor
0 Kudos

I have requirement. where I am printing name1 name2 name 3 and name 4 in smart form with different node for each.

currently is displaying

NAME1

NAME2

NAME3

NAME4

i want to hide name1 and name2 if there is values in name3 and name4. if name3 and name4 does not have any values then only it should print name1 and name2.

(all NAME1 NAME2 NAME3 NAME4 has values)

I am putting following conditions in conditions tab of name1 and name2 node.

GS_SOADRC-NAME3 = ' '.

GS_SOADRC-NAME4 = ' '.

And when i execute the smart form istead of hiding name1 and name2 its showing following output

NAME2

NAME1

NAME2

NAME1

where i want output to be

NAME3

NAME4.

can you suggest how this can be done?

Thanks,

Harshal

Accepted Solutions (1)

Accepted Solutions (1)

Abhijeet-K
Active Participant
0 Kudos

Hi Harshal,

Can you put a screen shot of your smartform here? Especially, the part where you have put conditions and the texts for name1-4.

HarshalVakil
Active Contributor
0 Kudos

I am adding condition in text element. As you can see in smart form conditions tab GS_SOADRC-NAME1 NE ' ' instead of this I am putting condition GS_SOADRC-NAME3 = ' ' AND GS_SOADRC-NAME4 = ' '.

Abhijeet-K
Active Participant
0 Kudos

Hi Harshal,

Instead of ' ', write INITIAL.

venkateswaran_k
Active Contributor
0 Kudos

Why this 1 = 2....

This condition returns always False then.....

HarshalVakil
Active Contributor
0 Kudos

Actually the problem was with address node. names were getting displayed from the adrc table using address number. and that 1 = 2 condition was kept because in previous requirement there was no need of populating the text elements. Now I have removed that condition and over riding the data coming from address number and address node.

Thanks.

Answers (4)

Answers (4)

HarshalVakil
Active Contributor
0 Kudos

To print the address there are two ways.

1st creating address node.

2nd is fetching data into a structure and populating each fields of the structure in to text elements.

In this case I was getting name and address from the address number in address node and which was getting displayed in output.

there were text elements in the smart forms but previously there was no need to populate the name1 name2 etc. individually so to not to populate it they have kept the condition 1=2 so that in every case this individual nodes dont get populate and it will print name and address using address node only.

so now i have provided condition 1=2 in address node and removed the same from each text element so that i can populate individual text element and decide when to display or when not to display element based on the conditions.

HarshalVakil
Active Contributor
0 Kudos

Thanks guys for your help.

Problem resolved.

venkateswaran_k
Active Contributor
0 Kudos

Please udpaet with your resolution....

Former Member
0 Kudos

HI,

Try

GS_SOADRC-NAME3 EQUALTO 'INITIAL'.

GS_SOADRC-NAME4 EQUALTO 'INITIAL'.

Regards,

Ravi Singh

HarshalVakil
Active Contributor
0 Kudos

I tried top put this GS_SOADRC-NAME3 EQ INITIAL as well. but still no success..

Former Member
0 Kudos

This is in a text element node?  after you put the conditions in, did you do the check to see if SmartForms or SAP detects an error?  You do have your structure and field names precisely correct?  Should work it seems to me, if you have it in the right place and the right structure and fieldnames.

HarshalVakil
Active Contributor
0 Kudos

Yes This name1 to name 4 are in text element. I have checked the smart form. and there is no error. also i have double checked the structure and field names. everything is fine.. but the result seems strange to me.

is there any other way by which i can achieve the same?

thanks