07-12-2006 7:12 AM
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.
07-12-2006 7:16 AM
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
07-12-2006 7:18 AM
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
07-12-2006 7:32 AM
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
07-12-2006 7:31 AM
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