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

Difference between SO10 and 'READ_TEXT'

Former Member
0 Likes
2,265

Hello guys,

I have a question about SO10 texts. I'm using a programm which allows me to automatically replace texts in SO10 texts, e.g. when some director changed in some footer texts.

This works fine, but I just found out one thing that maybe is harmless because its just a displaying problem, but you never know so I'm asking

The program reads and updates texts with functions 'READ_TEXT' and 'SAVE_TEXT'. Now we're using only the 72 characters when changing SO10 texts (so no extended view with 132 characters in one row), which means after 72 characters we fill text in new row.

Now I have e.g. one SO 10 text which looks like

Now with the programm the string 'longname1 longname2' will be replaced by some shorter name which leads to the fact that 'normalname1' should be moved to first row. When I change it manually in SO10, SAP automatically puts the text in the first row. But when I update it with function 'SAVE_TEXT' and after that display it in a WRITE list, you can see the text 'normalname1' still remains in second row. Only when I after updating the text go to SO10 transaction I see it correct. And if I click on save in SO10 it looks like it gets stored in the database table, because then I can see it in write list as well.

So is this just a displaying problem with transaction SO10 or is more behind it? I mean in this case it doesnt matter because the two lines will be displayed as one row in formula. But maybe there are some cases where it matters?

Thanks a lot!

Regards
Michael

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,878

Hi Michael,

the SO10-Text is always designt to look well on the formular. Mostly you got continuous text (when having "=" or "SPACE" in command row). in this case it would not matter if you write the text in multiple lines, because they will get joined together later.

when having other commands in command row it may effect the output. For example for command "*" (Standardformat) you will get a new line for each "*" command. It will then matter if something is defined in line 1 or 2.

just for exchanging variable names it should not matter at all as long as the new variables are shorter than the old.

maybe you like the FM "TEXT_SYMBOL_REPLACE"

With this FM you can replace symbols by SAP-Standard. This FM is also used by SAP-Standard when designing Formulars and can be used when you work with SO10Texts outside Formularprogramming. It will Replace the Variables e.g. &name1& with the content of your global-Programmvariable Name1. This FM needs the Programmname as input name. Check this if you need an example.

How to replace a variable in SO10

regards

Stefan Seeburger

4 REPLIES 4
Read only

Former Member
0 Likes
1,879

Hi Michael,

the SO10-Text is always designt to look well on the formular. Mostly you got continuous text (when having "=" or "SPACE" in command row). in this case it would not matter if you write the text in multiple lines, because they will get joined together later.

when having other commands in command row it may effect the output. For example for command "*" (Standardformat) you will get a new line for each "*" command. It will then matter if something is defined in line 1 or 2.

just for exchanging variable names it should not matter at all as long as the new variables are shorter than the old.

maybe you like the FM "TEXT_SYMBOL_REPLACE"

With this FM you can replace symbols by SAP-Standard. This FM is also used by SAP-Standard when designing Formulars and can be used when you work with SO10Texts outside Formularprogramming. It will Replace the Variables e.g. &name1& with the content of your global-Programmvariable Name1. This FM needs the Programmname as input name. Check this if you need an example.

How to replace a variable in SO10

regards

Stefan Seeburger

Read only

0 Likes
1,878

Hello Stefan,

Thanks for your advice, I will keep that in mind 🙂 At the moment it's only for replacing normal texts and no symbols but you never know 😉

I am the same opinion like you because with other formats I thought at the same. But when a format is entered one text row, SAP would not put the words of the second row up to the first I think?

Imho SAP only automatically moves words one row above when no format is entered?

Regards
Michael

Read only

0 Likes
1,878

Hi Michael,

having no format is like having the format "=". although the SO10-Editor got a button "formating (or something like that)" which formats the text automatically when you manually do changes in the SO10-Text. This button wont be executed when you do changes by programm. maybe thats the difference.  i think as long as you have something inside command line , text wont get changed.

btw. you do have symbols. for you its "name1" but the more elegant and common way is to use "&name1&"

and exchange via fuba "TEXT_SYMBOL_REPLACE".

regards

Stefan Seeburger

Read only

0 Likes
1,878

Yes, maybe thats the difference. All of my tests looked well, so I think it will be no problem with the functions for updating texts. If it will be, I will post it here 😉

btw. no really, its no text symbol, its just the text written there 🙂

But I now see why you think so. It was just an example SO10 text which I created for SCN because I did not want to display the original names of our directors 🙂 The text 'longname1' etc. look like fields, but I just filled them manually to fill the previously deleted real names.

Regards
Michael