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

Problems with READ_TEXT / SAVE_TEXT

Former Member
0 Likes
1,630

I have created an object named ZMM_TXT from transaction se75, and also en ID named Z1 for this object.

I have executed funcion SAVE_TEXT from transaction se37 with these parameteres:

CLIENT = 111

HEADER:

TDOBJECT = ZMM_TXT

TDNAME = E000000000000001009731

TDID = Z1

TD = ES

LINES:

TDLINE = TEXT FOR PLANT E000 AND MATERIAL 1009731

NOTE: In TDNAME I have concatenated the plant (E000) and the material code ( 000000000001009731)

Everything is OK, I haven´t got any error message.

I thougth that using SAVE_TEXT, text was stored in STXH database table, but it´s not this way. After executing SAVE_TEXT from se16n

I look at STXH table with TDOBJECT = ZMM_TXT but no value is shown. In which database table are stored these values?

After executing SAVE_TEXT I have executed READ_TEXT with these parameters:

CLIENT = 111

ID = Z1

LANGUAGE = ES

NAME = E000000000000001009731

OBJECT = ZMM_TXT

This is what I get:

Excepcion NOT_FOUND

Id mensaje : TD

Numero mensaje = 600

Texto E000000000000001009731 ID Z1 idioma ES no existe.

How should I execute READ_TEXT to read the text I have saved previously?

Thanks in advance.

9 REPLIES 9
Read only

madhu_vadlamani
Active Contributor
0 Likes
1,096

Hi,

check this

[http://wiki.sdn.sap.com/wiki/display/Snippets/HowtosaveandretreiveTextobjects]

Regards,

Madhu.

Read only

Former Member
0 Likes
1,096

hii,

TDOBJECT shud be a table name of the text.Check the parameters u have passed correctly r not.see a sample code format.

data:l_name like thead-tdname,

SELECT single tdtxtlines

from stxh

into v_textline

where tdid = 'ZV23'

and tdname = p_vbeln

and tdobject = 'VBBK'.

call function 'READ_TEXT'

exporting

id = '0001'

language = sy-langu

name = wa_tname-name

object = 'VBBP'

tables

lines = it_tline

Read only

0 Likes
1,096

I have created database table ZMM_TXT_PD with fields

MANDT (MANDT)

CENTRO (EWERK)

MATERIAL (MATNR)

All of them are key fields.

I have created a record in this table:

111

E000

1009731

I have created from se75 an object called ZMM_TXT_PD with ID Z2.

I have executed SAVE_TEXT with these parameters:

CLIENT: 111

HEADER:

TDOBJECT = ZMM_TXT_PD

TDNAME = E000000000000001009731

TDID = Z2

TD = ES

LINES:

TDLINE = SOME TEXT

Text is saved.

After that I have executed READ_TEXT with these parameters:

CLIENT: 111

ID : Z2

LANGUAGE: ES

NAME : E000000000000001009731

OBJECT: ZMM_TXT_PD

I get this error:

EXCEPTION: NOT_FOUND

MESSAGE ID : TD

MEESAGE NUMBER : 600

"Texto E000000000000001009731 ID Z2 idioma ES no existe."

E000000000000001009731 ID Z2 LANGUAGE ES does not exist.

How should I execute READ_TEXT to be able to read the text previously saved?

Read only

Shahid
Product and Topic Expert
Product and Topic Expert
0 Likes
1,096

It looks like the text is not saved..

use the commit work and wait statement or commit_text FM after save_text FM.

first try saving the standard text in SO10, giving the same parameters which you are using.

for read_text and save_text code you can search the forum

Read only

Former Member
0 Likes
1,096

I execute save_text from se37, so commit is implicit; is it?

I can´t use so10 because it´s not a standard text.

Thanks.

Read only

Shahid
Product and Topic Expert
Product and Topic Expert
0 Likes
1,096

try with an extra commit statement after save_text.

I dont think its implicit.

if not so10, use the same tcode se75 which you are using.

Read only

Former Member
0 Likes
1,096

Would it be a good idea to save the text in table stxh directly?

Thanks.

Read only

Shahid
Product and Topic Expert
Product and Topic Expert
0 Likes
1,096

i usually store my standrad text @ so10 or using save_text , which i can see in STKH tables. even few of the SAP's standrd texts are saved in the same table

Read only

Clemenss
Active Contributor
0 Likes
1,096

Hi Jariz,

after SAVE_TEXT call COMMIT_TEXT.

Regards

Clemens