‎2008 Jul 30 9:59 AM
Hello,
I am using READ_TEXT function module. But there are multiple lines in LINES. I want to retrive all the data but now i m getting only first line of that. I want to get all data present under lines.
How to get that please help. Urgent
Thanks,
Ashu
‎2008 Jul 30 10:01 AM
‎2008 Jul 30 10:02 AM
‎2008 Jul 30 10:03 AM
hi check this..
use this ...
read table itab index 1.
if sy-subrc = 0.
do this...
endif.
read table itab index 2....
if sy-subrc = 0.
do this...
endif.
‎2008 Jul 30 10:03 AM
‎2008 Jul 30 10:05 AM
Hi Ashu ,
just go through following code ...u may get some help..
data:begin of wa_mat,
matnr like mara-matnr,
mtart like mara-mtart,
end of wa_mat.
data:it_mat like wa_mat occurs 0 with header line.
data:matk like THEAD-TDID.
data:it_lines like tline occurs 0..
data: aufk like THEAD-TDOBJECT.
data: wa_object like THEAD-TDNAME.
*data:sy-langu like THEAD-TDSPRAS.
data: result type string.
select matnr mtart from mara into table it_mat.
concatenate it_mat-matnr it_mat-mtart into result.
condense result no-gaps.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
id = 'MATK'
language = sy-langu
name = wa_object
object = 'AUFK'
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER =
tables
lines = it_lines
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.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Thanks & Regards
Ashu Singh
‎2008 Jul 30 10:06 AM
Hi,
Once you get the lines data, then you loop the lines internal table and get the data.
Ex
Call function read_text
etc..
tables = it_lines.
loop at it_lines
s_line = it_lines-tdline
write:/ s_line.
endloop.
Refer the below links.
[http://www.sap-basis-abap.com/sapac002.htm|http://www.sap-basis-abap.com/sapac002.htm]
Regards,
Boobalan S
‎2008 Jul 30 10:07 AM
‎2008 Jul 30 10:08 AM
Hi Ashu,
READ_TEXT gets all text lines into the LINES table.
we need to loop the table LINES to fetch all the lines .
Best regards,
raam
‎2008 Jul 30 10:09 AM
Hi,
Read_text is the function module ... it is used to read the standard text....we use this FM in script....