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

Check variable conditions in SO10

tabraiz_khan
Participant
0 Likes
3,054

Hi All,

I am reading a standard text in a program calling READ_TEXT. I want to check a condition for a variable that i am using in the program.

For example,

if variable = 'x'

* fetch data for x

elseif variable = 'y'

* fetch data for y

endif

is it possible to write this condition in a so10 text?

Thanks,

Tabraiz

Hi All,

I am reading a standard text in a program calling READ_TEXT. I want to check a condition for a variable that i am using in the program.

For example,

if variable = 'x'

* fetch data for x

elseif variable = 'y'

* fetch data for y

endif

is it possible to write this condition in a so10 text?

Thanks,

Tabraiz

8 REPLIES 8
Read only

amol_samte
Contributor
0 Likes
1,680

Hi Tabraiz,

Can u please explain in details...so we can try to solve ur problem early..

Regards,

Amol

Read only

0 Likes
1,680

Hi Amol,

Thanks for the reply.

I have a variable say "v_lang" in my program.

I have some text that I want to fetch based on the value in v_lang.

To be more specific, if v_lang says 'EN' for english, i will pick up english text and if v_lang says 'ES' (spanish), i will pick up spanish text.

Now, I can use one standard text each for EN and ES texts and READ_TEXT them separately by but I have around 10 different texts and I dont want to maintain 10 separate SO10 texts. I just want to know if i can check the condition v_lang inside the SO10 text and fetch the correct text. This way I have to only use ONE SO10 text instead of 10.

Thanks,

Tabraiz

Read only

0 Likes
1,680

Hi Tabriz,

You need to maintain the st.text in different language manually in so10.

Then you call it through function module READ_TEXT. Here you pass the language dynamically.

Regards,

Sam

Read only

0 Likes
1,680

Hi Tabzaiz,

As per my understanding,

If text is not maintained under SO10 then how can u fetch?

Read only

0 Likes
1,680

Hi Tabraiz,

As Far as I know you can not write piece of code in so10 editor.

I have tried too but its not considering the command line from so10 editor.

Rgds,

Sandeep katoch

Read only

0 Likes
1,680

Hi Amol,

I was going to maintain the text in SO10. Thanks for the help mate.

Ta,

Tabraiz

Read only

Former Member
0 Likes
1,680

Tabraiz,

You can try the same by putting v_lang as the global parameter in SAP Script.

The sample code in Standard Text is

/:  IF &v_lang& EQ 'EN'

PF <Text Line1>

PF <Text Line2>

PF <Text Line3>

/: ELSEIF &v_lang& EQ 'ES'

PF

PF

PF

/: ELSEIF .....

.

.

/: ENDIF

PF is the paragraph format and try to use EQ instead of '=' as sometimes '=' is not taken into consideration. The variable can be in Capital letters like &V_LANG&

Regards,

Hardik Mehta

Read only

0 Likes
1,680

Thanks Hardik,

I am reading it in a program, i guess it is not possible in a program.

Thanks,

Tabraiz.