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

About function module READ_TEXT

Former Member
0 Likes
1,021

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

9 REPLIES 9
Read only

Former Member
0 Likes
949

use

Loop at lines.

write 😕 lines-data.

endloop.

regars

rajesh

Read only

Former Member
0 Likes
949

Hi Ashu,

Check this link for sample code:

Regards,

Chandra Sekhar

Read only

Former Member
0 Likes
949

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.

Read only

Former Member
0 Likes
949

hi,

Refer to the link.

Regards

Sumit Agarwal

Read only

Former Member
0 Likes
949

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

Read only

Former Member
0 Likes
949

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

Read only

Former Member
0 Likes
949

chk the link below:

http://www.sap-basis-abap.com/sapac002.htm

With luck,

Pritam.

Read only

Former Member
0 Likes
949

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

Read only

Former Member
0 Likes
949

Hi,

Read_text is the function module ... it is used to read the standard text....we use this FM in script....