Application Development 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: 

in the read_text function module, how to find the lines

Former Member
0 Kudos

The coding follows like this,

call function 'READ_TEXT'

exporting

client = sy-mandt

id = id

language = sy-langu

name = name

object = object

importing

header = header

tables

lines = tab

exceptions

id = 1

language = 2

name = 3

not_found = 4

object = 5

reference_check = 6

wrong_access_to_archive = 7

others = 8.

can u provide me with the correct data form which i can read the lines.

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos

hi you need to provide Object ID, NAme properly....

for Object ID's you can refer these STXH,STXl tables

and find the ID's.

then pass them to FM, read the lines(<b>tab</b>) (lines will have text for that id).

regards

vijay

6 REPLIES 6

former_member181962
Active Contributor
0 Kudos

The internal table 'tab' will have the text.

You can read the lines from the 'tab' internal table.

Regards,

Ravi

Former Member
0 Kudos

Hi,

DATA: it_lines LIKE tline OCCURS 0 WITH HEADER LINE.

ID = ST(Standard Text)

NAME = Standard text name which you want to read

OBJECT = TEXT

LINES =

CALL FUNCTION 'READ_TEXT'

EXPORTING

id = 'ST'

language = sy-langu

name = 'ZSAMPLETEXT'

object = 'TEXT'

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.

Reward points if it helps you.

Regards,

Sudhakar.

Former Member
0 Kudos

I think this code will help you to read the lines

*--LOCAL VARIABLES

DATA : LV_NAME TYPE THEAD-TDNAME,

LV_TEMP(128) TYPE C ,

*--Structure to Hold the Header Data for Func Modules

*--Read_text

X_HEADER TYPE THEAD .

CLEAR : LV_NAME ,

LV_TEMP ,

V_IND_FG ,

X_HEADER ,

IT_TLINES ,

IT_TLINES[] .

LV_NAME = P_DELV_NO .

X_HEADER-TDOBJECT = 'VBBK'.

X_HEADER-TDNAME = LV_NAME .

X_HEADER-TDID = 'ZMAN'.

X_HEADER-TDSPRAS = 'E'.

CALL FUNCTION 'READ_TEXT'

EXPORTING

CLIENT = SY-MANDT

ID = X_HEADER-TDID

LANGUAGE = X_HEADER-TDSPRAS

NAME = X_HEADER-TDNAME

OBJECT = X_HEADER-TDOBJECT

TABLES

LINES = IT_TLINES

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.

ERROR.

CLEAR :IT_TEXT,

IT_TEXT[] .

V_IND_FG = 'X' .

EXIT .

ENDIF.

LOOP AT IT_TEXT .

IT_TLINES-TDFORMAT = '*'.

IT_TLINES-TDLINE = IT_TEXT-LINE.

APPEND IT_TLINES.

CLEAR IT_TLINES.

ENDLOOP.

Thanks,

Koshal

Former Member
0 Kudos

Hi,

After that IT_LINES will have the text which is in Standard Text. If you want to write that text:

Loop at IT_LINES.

WRITE 😕 IT_LINES.

Endloop.

Regards,

Sudhakar.

former_member188685
Active Contributor
0 Kudos

hi you need to provide Object ID, NAme properly....

for Object ID's you can refer these STXH,STXl tables

and find the ID's.

then pass them to FM, read the lines(<b>tab</b>) (lines will have text for that id).

regards

vijay

former_member188685
Active Contributor
0 Kudos

Find TDID,TDNAME from STXH(header),STXL(item) tables

and you can get the text corresponding...

loop that itab and write the text.

vijay