cancel
Showing results for 
Search instead for 
Did you mean: 

READ_TEXT Function Module

Former Member
0 Kudos

Hi Experts,

I am using the FM READ_TEXT to retrieve the text. I am getting the data into the table it_lines[].

I am trying to assign the it_lines-tdline to a global variable. But, I am nor getting any value into the it_lines-tdline.

Here is my code. Please correct me if I am wrong in assigning it to a global variable.

Data: gv_text type tdline.

CALL FUNCTION 'READ_TEXT'

EXPORTING

client = sy-mandt

id = 'ZT01'

language = sy-langu

name = lv_vbeln "is_bil_invoice-hd_ref-deliv_numb

object = 'VBBK'

archive_handle = 0

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.

gv_text = it_lines-tdline.

Thanks in Advance.

Accepted Solutions (0)

Answers (3)

Answers (3)

P561888
Active Contributor
0 Kudos

Hi,

CALL FUNCTION 'READ_TEXT'

EXPORTING

CLIENT = SY-MANDT

ID = 'ZT01'

LANGUAGE = SY-LANGU

NAME = V_TDNAME

OBJECT = 'VBBK'

ARCHIVE_HANDLE = 0

IMPORTING

HEADER = I_TEXT_HEAD

TABLES

LINES = I_TEXT_LINE

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.

Do with line item.

ELSE.

WRITE /. <do >.

ENDIF.

Regards,

Bharani

Former Member
0 Kudos

I think you would have to loop on it_lines internal table in order to assign the tdlibe value to the variable.

Hope this helps.

Thanks!

Former Member
0 Kudos

Thank you so much. I got it.

amit_khare
Active Contributor
0 Kudos

it_lines is an internal table here...use LOOP or READ statement.