Application Development 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: 

sap text object storage !!

Former Member
0 Kudos

hi,

I need to understanding something abt sap text objects..

i am trying to make use of sap standard text objects for storing text for my custom transactions.

all i need is for every dialog transaction, user will enter a multi line text and i need it to be saved. and when he wants to modify that transaction, i want that text to be displayed.

so in SO10 i created a text object named ZTT1.

in my dialog flow logic, using save text, i saved the data from my text editor into this ZTT1. I checked in SO10, the value was there.

But now when i create another transaction and save logicis executed, the data is overwriting in what was saved before !!

how does SAP store the data I populate in the ZTT1 using SAVE_TEXT ?? am i missing something ??

i want to save such texts for each of the my custom transaction !! any suggestions ? I will have a unique number generated for every record stored in my custom tables. Now there must be some link created between that unique refernce number and the text object, isn'tit ??

hope i am clear.

thks

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos

Obviously it overrides the old one. if you don't want that you have to pass different Textname.(Textname should be unique) other wise it will override the old one.

example: First transaction

TDNAME 000000001

TDID ST

SPRAS SY-LANGU

TDOBJECT ZTT1

for second transaction

TDNAME 000000002

TDID ST

SPRAS SY-LANGU

TDOBJECT ZTT1

Like this you need to maintain

12 REPLIES 12

former_member188685
Active Contributor
0 Kudos

Obviously it overrides the old one. if you don't want that you have to pass different Textname.(Textname should be unique) other wise it will override the old one.

example: First transaction

TDNAME 000000001

TDID ST

SPRAS SY-LANGU

TDOBJECT ZTT1

for second transaction

TDNAME 000000002

TDID ST

SPRAS SY-LANGU

TDOBJECT ZTT1

Like this you need to maintain

0 Kudos

ok , got it...also these objects needs to be transported in a different manner ?? i did not find any transport request created when i created this object !! how do i handle that ??

thks

0 Kudos

> ok , got it...also these objects needs to be transported in a different manner ?? i did not find any transport request created when i created this object !! how do i handle that ??

>

you want to transport which object? All texts will be created when you run the transaction and create the texts. you mean you want to Transport the Textobject?

0 Kudos

Vijay, I think I did not clearly understand what u meant when u said supply different text name to the save_text to store the data distinctly..

so for e.g. find below what will happen in my case..

record 1 : unique number is 10001. suppose i create a text name same as that of unique number of the record: say 10001, then in SAP a text object with that name will be created at runtime ??

if yes, then if i create 1000 records, then 1000 text objects will be created ??

this does not sound good !!

rather i will save the data in my custom table itself !!

whats the benefit of storing as standard sap text object ?

please explain or correct me if i understood it wrong. thks

0 Kudos

you are understanding in different way..

when you use Create_text that means only Texts will be created not the text objects.

I understood that you are calling ZTT1 as textobject, but instead of calling that as textname.

For First time.

TDNAME 000000001       <====Text name
TDID         ST                          <=== Text Id
SPRAS SY-LANGU  
TDOBJECT  TEXT                     <====Text object

for second transaction

TDNAME 000000002
TDID       ST
SPRAS SY-LANGU
TDOBJECT TEXT

For Transporting the texts you can use this program RSTXTRAN. But you don't need to transport i guess. since it depends on the System(i.e Dev,Quality, Production etc).

0 Kudos

So, does that mean

1. I need not create any text object like ZTT1 thru SO10 initially ??

2. If no, I need to create , then where is the link between the ZTT1 and the text name we set in TDNAME in the program ??

Sorry Vijay, I m still missing something that stops me from understanding this concept !! Any more help ?

thks

0 Kudos

First tell me how you created that ZTT1 in SO10.

then i will tell you. what you missed. without linking to ZTT1 you can create the text.

I want some input on ZTT1 , how you created that.

using the TEXT as the TDOBJECT instead of ZTT1.

sequence number (ex:-0000001) TDNAME

ST as TDID

0 Kudos

Sure Vijay. I think I messed up in SO10, u need to correct me.

1. In SO10, I enterd textname as ZTT1, text id as ST and language as EN

2. Clicked on create button

3. a blank editor was displayed, i did not type anything, just clicked on the save button and exit !!

thats it..

in my code

DATA: GW_THEAD LIKE THEAD,

T_TLINE LIKE TABLE OF TLINE.

GW_THEAD-TDNAME = 'ZTT1'.

GW_THEAD-TDID = 'ST'.

GW_THEAD-TDSPRAS = SY-LANGU.

GW_THEAD-TDOBJECT = 'TEXT'.

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

HEADER = GW_THEAD

TABLES

LINES = T_TLINE

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

OBJECT = 4

OTHERS = 5.

I was wondering how will I be able to store such text data for different records !! Hope this info helps u.. thks

0 Kudos

> 1. In SO10, I enterd textname as ZTT1, text id as ST and language as EN

>

> 2. Clicked on create button

>

> 3. a blank editor was displayed, i did not type anything, just clicked on the save button and exit !!

what ever you created ZTT1 is TDNAME. not textobject.

DATA: GW_THEAD LIKE THEAD,

T_TLINE LIKE TABLE OF TLINE.

"maintain some unqique name,

"assume you are dealing with some order related. then pass that value to TDNAME

GW_THEAD-TDNAME = '0000001'.

GW_THEAD-TDID = 'ST'.

GW_THEAD-TDSPRAS = SY-LANGU.

GW_THEAD-TDOBJECT = 'TEXT'.

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

HEADER = GW_THEAD

TABLES

LINES = T_TLINE

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

OBJECT = 4

OTHERS = 5.

> I was wondering how will I be able to store such text data for different records !! Hope this info helps u.

It is possible to store the text for multiple records , with different TDNAMES. Thats how SAP stores the various texts for Different Documents like Sales order,Purchase order, delivery etc.

only thing is you need to change the TDNAME for Different Records.

0 Kudos

Okey, crystal clear now. thanks Vijay. So I must make sure that there should not be any conflicts in the TDNAME !! what if someone else also creates text with same name ?? How can i make sure of that ?

shall i prefix it with some name like ZXXX, so that my text names will be ZXXX00001, ZXXX00002 and so on ?

thks

0 Kudos

yes exactly

>some name like ZXXX

You formulate some combination, which no one uses, and which should be unique. that will resolve.you follow some Sequence to avoid conflicts in future.

0 Kudos

thanks Vijay..