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: 

READ_TEXT Function Module

Former Member
0 Kudos
159

Hi ALL

Want to know the Concept Behind the Func. Module READ_TEXT.Why it is used and what should be the Export and Import Parameters and the Lines Table..Say for e.g.

I have a Standard Text named as zstandard1, ID is ST, language is EN. Now when I call this Funt. Module there are Some parameters along with these there is One More parameter named as Object. What is the Object Parameter can anybody let me know about this parameter..

Also pls let me know about the Lines Tables.....I am totally new to this Funct. Module....

Thanks & Regards

3 REPLIES 3

anversha_s
Active Contributor
0 Kudos
98

hi,

<b>if the field length in the data dictioray is unlimited .</b>

1.you need to create text object and link this object

with key fields of the table and reading this text and storing this text you need to use SAVE_TEXT and READ_TEXT fm's.

chk the sample code below.

1.create a text object using SE75 transaction .

2.Use FM : SAVE_TEXT to save this data with text object id.(data will be stored into STXH table).

3.Use READ_TEXT to retrive data.

sample code :

DATA: ws_thead LIKE thead,

i_tline LIKE TABLE OF tline WITH HEADER LINE.

data : x_matnr like mara-matnr.

c_mara(4) type c value 'MARA',

c_zid(4) type c value 'Z001'.

MOVE : x_matnr TO ws_thead-tdname, <-moving MATNR to store data

c_mara TO ws_thead-tdobject,

sy-langu TO ws_thead-tdspras,

c_zid TO ws_thead-tdid.

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

client = sy-mandt

header = ws_thead

savemode_direct = 'X'

TABLES

lines = i_tline

EXCEPTIONS

id = 1

language = 2

name = 3

object = 4

OTHERS = 5.

IF sy-subrc <> 0.

  • MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

  • WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

DATA: lws_id LIKE thead-tdid,

lws_name LIKE thead-tdname,

lws_object LIKE thead-tdobject.

lws_id = c_zid.

lws_name = x_matnr. <- reading data using key field(MATNR)

lws_object = c_mara.

CALL FUNCTION 'READ_TEXT'

EXPORTING

client = sy-mandt

id = lws_id

language = sy-langu

name = lws_name

object = lws_object

TABLES

lines = li_tline

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.

Regards

anver

pls mark points if useful

0 Kudos
98

Hi Anversha s

Thanks for your Valuable inputs.However I'll like to explain you the whole Scenario. See I have the Standard Texts now I want to call this FM and read the standard Text this can be done with the help of this FM. How do I do this . And I'll store the read text in an Internal Table ...

If u need any Clarifications Most Welcome...:)

Former Member
0 Kudos
98

Hi ,

Please check out the following post it has all the details that you want.

Thanks,