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

how to use READ_TEXT function module.

Former Member
0 Likes
5,643

hi experts,

Pls tell me how to use read_text FM.

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

id = '0001'

language = 'EN'

name = '0080000055'

object = 'VBBK'

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

tables

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.

what i have to put in that lines?

regards,

mani

13 REPLIES 13
Read only

Former Member
0 Likes
2,053

Lines is returned back from the FM . All you need to specify is an empty internal table definition.

Read only

Former Member
0 Likes
2,053

Hi,

make an internal table type TLINE.just pass it there you will get the text inside it..

Thnaks

<b><REMOVED BY MODERATOR></b>

vivekanand

Message was edited by:

Alvaro Tejada Galindo

Read only

0 Likes
2,053

pls make changes on the code.

Read only

0 Likes
2,053

data: text like tline occurs 0.

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

id = '0001'

language = 'EN'

name = '0080000055'

object = 'VBBK'

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

tables

lines = text

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.

add this

regards,

Prabhu

<b><REMOVED BY MODERATOR></b>

Message was edited by:

Alvaro Tejada Galindo

Read only

0 Likes
2,053

it is creating dump .

data itab like tline occurs 0.

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

id = '0001'

language = 'EN'

name = '0080000055'

object = 'VBBK'

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

tables

lines = itab.

Read only

Former Member
0 Likes
2,053

Hi,

Here is the sample code

CONSTANTS:

*For text reading like in LCNMMFTX / FORM SET_CONTROL_TEXT

text_id like thead-tdid value 'MATK',

text_obj like thead-tdobject value 'AUFK '.

data tlines like tline occurs 0 with header line.

data tdname like thead-tdname.

data tdheader like thead.

refresh tlines.

tdname = sy-mandt.

tdname+3 = it_proj-rsnum.

tdname+13 = it_proj-rspos.

tdname+17 = it_proj-rsart.

call function 'READ_TEXT'

exporting

id = text_id

language = it_proj-ltxsp

name = tdname

object = text_obj

importing

header = tdheader

tables

lines = tlines.

  • exceptions

  • not_found = 01.

Regards

Sudheer

Read only

Former Member
0 Likes
2,053

Hi,

This should be your approach

1.Do u want to fetch std text or texts maintained using std Tcodes?

std text : id = 'ST'

language = 'EN'

name = <text name>

object = 'TEXT'

for second u have to find out the details from respective Tcodes going to details

tab < go to - header>

2. delare internal table of type TLINE

3. pass this internal table as given below

tables

lines = itab_text

<b><REMOVED BY MODERATOR></b>

Message was edited by:

Alvaro Tejada Galindo

Read only

Former Member
0 Likes
2,053

put lines like tlines occurs 0.

dont forget to uncomment the exceptions, becouse u will get errors if there is no text maintained.

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

NOT_FOUND = 4

OBJECT = 5

REFERENCE_CHECK = 6

WRONG_ACCESS_TO_ARCHIVE = 7

OTHERS = 8

regards,

Prabhu

<b><REMOVED BY MODERATOR></b>

Message was edited by:

Alvaro Tejada Galindo

Read only

Former Member
0 Likes
2,053

what is the error u are geeting??

data itab type standard table of tline with header nie.

Read only

0 Likes
2,053

type conflict when calling fmodule

Read only

Former Member
0 Likes
2,053

check which field is creating type conflict

or else copy paste ur code

Read only

0 Likes
2,053

data itab like tline occurs 0.

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

id = '0001'

language = 'EN'

name = '0080000055'

object = 'VBBK'

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

tables

lines = itab.

Read only

Former Member
0 Likes
2,053

Uncomment export parameter

client = sy-mandt,

declare internal table like this:

data: itab type standard table of tline with header line

<b><REMOVED BY MODERATOR></b>

Message was edited by:

Alvaro Tejada Galindo