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: 

FM - Read_Text

Former Member
0 Kudos

Hi all,

I am using FM read_text, in which its expecting value for the text. If text is blank in the text box, its giving following error.

Text 410000001600010 ID F01 language EN not found

if i use INCLUDE its working, means the output is blank.

4 REPLIES 4

Former Member
0 Kudos

For READ_TEXT, there are 3 parameter which are mandatory.

1. TDOBJECT

2. TDID

3. TDNAME

I am not sure which long text you are reading, but for a example if you are reading Header Text of a PO the values will be

Text Name 5500000178

Language EN

Text ID F01 Header text

Text object EKKO

You can see these value by going into the full screen mode of the text and then in the menu GO TO->HEADER, and you can see the values.

Regards,

Ravi

Note : Please mark the helpful answers

Former Member
0 Kudos

Hi ,

Please give the correct STXH-TDNAME in the 'NAME' import parameters.

You can always check the entry with the table STXH.

TDNAME = value you give.

TDID = 'TXT'

TDSPRAS = 'E'

If its useful, award points pls..

Regards,

Bharadwaj

0 Kudos

double click on the text and then goto->header will give u all the required value that u need to pass to fM read_text.

Reward points if it helps

regards

Gunjan

Former Member
0 Kudos

Hai Ravi

Check the following Code. how to use read_text f.m

DATA: BEGIN OF XTHEAD.

INCLUDE STRUCTURE THEAD.

DATA: END OF XTHEAD.

DATA: BEGIN OF ZZTLINE OCCURS 10.

INCLUDE STRUCTURE TLINE.

DATA: END OF ZZTLINE.

XTHEAD-TDID = 'ZPPM'. "TEXT-ID

XTHEAD-TDSPRAS = SY-LANGU. "Language

XTHEAD-TDNAME = 'ZTKF'. "identification

CONCATENATE SY-TCODE(5) ITAB0300POS-AUFNR

INTO XTHEAD-TDNAME.

XTHEAD-TDOBJECT = 'TEXT'. "Object type top/position

CALL FUNCTION 'READ_TEXT'

EXPORTING

ID = XTHEAD-TDID

LANGUAGE = XTHEAD-TDSPRAS

NAME = XTHEAD-TDNAME

OBJECT = XTHEAD-TDOBJECT

IMPORTING

HEADER = XTHEAD

TABLES

LINES = ZZTLINE

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

NOT_FOUND = 4

OBJECT = 5

REFERENCE_CHECK = 6

WRONG_ACCESS_TO_ARCHIVE = 7

OTHERS = 8.

IF SY-SUBRC = 0.

REFRESH ZZTLINE.

ZZTLINE-TDLINE = ITAB0300POS-BEM.

APPEND ZZTLINE.

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

HEADER = XTHEAD

IMPORTING

FUNCTION = ZFUNCTION

NEWHEADER = XTHEAD

TABLES

LINES = ZZTLINE

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

OBJECT = 4

OTHERS = 5.

ELSE.

XTHEAD-TDID = 'ZPPM'. "TEXT-ID

XTHEAD-TDSPRAS = SY-LANGU. "Language

XTHEAD-TDNAME = 'ZTKF'. "identification

CONCATENATE SY-TCODE(5) ITAB0300POS-AUFNR

INTO XTHEAD-TDNAME.

XTHEAD-TDOBJECT = 'TEXT'. "Object type top/position

REFRESH ZZTLINE.

ZZTLINE-TDLINE = ITAB0300POS-BEM.

APPEND ZZTLINE.

CALL FUNCTION 'CREATE_TEXT'

EXPORTING

FID = XTHEAD-TDID

FLANGUAGE = XTHEAD-TDSPRAS

FNAME = XTHEAD-TDNAME

FOBJECT = XTHEAD-TDOBJECT

TABLES

FLINES = ZZTLINE

EXCEPTIONS

NO_INIT = 01

NO_SAVE = 02.

ENDIF.

Thanks & regards

Sreeni