‎2006 Mar 07 4:12 AM
hello everyone:
I face the question as follow: We need to read the long text,but some long text is empty.when I call funtion "READ_TEXT",the system message me "no find the long text", and can not return to my programming. so I want to someone give me some help.
Regard&Thanks!
zagory
‎2006 Mar 07 4:37 AM
Hi zagory,
Welcome to SDN.
1. If you don't want to get message displayed on screen,
just remove * (comment)
for EXCEPTIONS.
2. Remove the * at the starting of each line.
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8
3. Then message on screen won't come.
and your program will proceed further without
any problem/halt.
regards,
amit m.
‎2006 Mar 07 4:21 AM
‎2006 Mar 07 4:22 AM
IF LONG TEXT IS NOT STORED IN stxh, stxl TABLES, U CANT READ USING read_teaxt.
u can create one using CREATE_TEXT.
SO IF U WANT UR PROGRAM TO RUN, REMOVE THE FN MODULE OR CREATE ONE AND THEN READ
Message was edited by: Hymavathi Oruganti
‎2006 Mar 07 4:24 AM
Hi Zagory ,
refer <a href="http://www.sap-basis-abap.com/sapac002.htm">http://www.sap-basis-abap.com/sapac002.htm</a> for some help and code on this FM.
regards
satesh
‎2006 Mar 07 4:30 AM
Hi,
Just comment the message statement in sy-subrc check after call function READ_TEXT.
Ex.
IF SY_SUBRC <> 0.
MESSAGE ....
ENDIF.
Hope this helps..
Regards,
Shashank
‎2006 Mar 07 4:37 AM
Hi zagory,
Welcome to SDN.
1. If you don't want to get message displayed on screen,
just remove * (comment)
for EXCEPTIONS.
2. Remove the * at the starting of each line.
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8
3. Then message on screen won't come.
and your program will proceed further without
any problem/halt.
regards,
amit m.
‎2006 Mar 07 4:45 AM
hi..
first change the header text in PO by ME22 (if u want to see its effect)
then u need three things for read text...
abject , name , its id.
then texts u got from read_text will be in WA_text...
try it and ask if problem still there
REPORT ZREADTEXT.
parameters: po like ekko-ebeln.
data : begin of itab_stxh occurs 0.
include structure stxh.
data : end of itab_stxh.
DATA: wa_TEXT like TLINE occurs 0 with header line.
data : begin of it_text occurs 0,
tdid like itab_stxh-tdid,
tdline like tline-tdline,
end of it_text.
select * into corresponding fields of table itab_stxh from stxh where
tdname = po.
loop at itab_stxh.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = itab_stxh-tdid
language = sy-langu
name = itab_stxh-tdname
object = itab_stxh-tdobject
tables
lines = wa_text
loop at wa_text.
MOVE wa_TEXT-TDLINE TO IT_text-TDLINE .
move itab_stxh-tdid to it_text-tdid.
APPEND IT_text .
endloop.
break-point.
write : / itab_stxh-tdid, itab_stxh-tdobject.
endloop.
loop at it_text.
write : / it_text-tdid, it_text-tdline.
endloop.
Message was edited by: Madan Gopal Sharma
‎2006 Mar 07 5:17 AM
hi
Check sy-subrc is zero or not.
if it is not zero then put corresponding message in ur
log that is internal table and display that log as report at end of program.
regards
vinod