cancel
Showing results for 
Search instead for 
Did you mean: 

Use of READ_TEXT IN SCRIPT

Former Member
0 Kudos

Hi Techis

Will u pls tell me IN DETAIL what is use of "PERFORM READ_TEXT" IN SAPSCRIPT .

PLS GIV EXAMPLE FOR EXPLANATION

Rewards will be given for every helpful ans

Regards

PERFORM READ_TEXT TABLES ITEXT USING 'BK06' 'VBBK' TEXTNAME.

READ TABLE ITEXT INDEX 1.

FORM READ_TEXT TABLES P_ITEXT STRUCTURE TLINE

USING VALUE(P_0769)

VALUE(P_0770)

P_TEXTNAME.

REFRESH ITEXT.

CALL FUNCTION 'READ_TEXT'

EXPORTING

CLIENT = SY-MANDT

ID = P_0769

LANGUAGE = SY-LANGU

NAME = P_TEXTNAME

OBJECT = P_0770

TABLES

LINES = ITEXT

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

NOT_FOUND = 4

OBJECT = 5

REFERENCE_CHECK = 6

WRONG_ACCESS_TO_ARCHIVE = 7

OTHERS = 8.

ENDFORM. " READ_TEXT

Accepted Solutions (1)

Accepted Solutions (1)

Simha_
Employee
Employee
0 Kudos

Hi,

ABAP READ_TEXT functions to read the SAP Long Text

All the long text can be retrieve using this method.

You have to used the READ_TEXT functions to read the SAP long text. e.g. Sales Order, Purchase Order Item text etc.

To check your long text header, go into the long text. Click Goto -> Header

In order to process text modules in application programs, all information about a text module must be transferred to internal work areas.

A text is read from the text file or text memory with this function module. It must be described fully by specifying OBJECT, NAME, ID, and LANGUAGE. Generic entries in these parameters are not valid.

When header information and text lines have been read successfully, they are transferred to the work areas HEADER and LINES.

Cheers,

SIMha.

Answers (3)

Answers (3)

Former Member
0 Kudos

SAPscript: Read text

In order to process text modules in application programs, all information about a text module must be transferred to internal work areas.

A text is read from the text file or text memory with this function module. It must be described fully by specifying OBJECT, NAME, ID, and LANGUAGE. Generic entries in these parameters are not valid.

When header information and text lines have been read successfully, they are transferred to the work areas HEADER and LINES.

http://help.sap.com/saphelp_nw04/helpdata/en/d6/0db764494511d182b70000e829fbfe/frameset.htm

in genral read_text FM is used to display the Text maintained in standardtransactions like ME21n/ va01 ,,, if u wanna display this text, u shud use READ_TEXT by passing th erelavnt parametsr like object, id, text, lang.

in case o f scripts, there is no need to call this FM, when u r including the standard text using menu--include -standard text, here u shud give the object, id, text, lang..(this is simialr to standard text) then script will display the text mainatined in the standard transactions.

It is used to fetch the Long Text details or

Header and Items texts of a application document

READ_TEXT

READ_TEXT provides a text for the application program in the specified work areas.

The function module reads the desired text from the text file, the text memory, or the archive. You must fully specify the text using OBJECT, NAME, ID, and LANGUAGE. An internal work area can hold only one text; therefore, generic specifications are not allowed with these options.

After successful reading, the system places header information and text lines into the work areas specified with HEADER and LINES.

If a reference text is used, SAPscript automatically processes the reference chain and provides the text lines found in the text at the end of the chain. If an error occurs, the system leaves the function module and triggers the exception REFERENCE_CHECK.

Function call:

CALL FUNCTION 'READ_TEXT'

EXPORTING CLIENT = SY-MANDT

OBJECT = ?...

NAME = ?...

ID = ?...

LANGUAGE = ?...

ARCHIVE_HANDLE = 0

IMPORTING HEADER =

TABLES LINES = ?...

EXCEPTIONS ID =

LANGUAGE =

NAME =

NOT_FOUND =

OBJECT =

REFERENCE_CHECK =

WRONG_ACCESS_TO_ARCHIVE =

Export parameters:

CLIENT

Specify the client under which the text is stored. If you omit this parameter, the system uses the current client as default.

Reference field: SY-MANDT

Default value: SY-MANDT

OBJECT

Enter the name of the text object to which the text is allocated. Table TTXOB contains the valid objects.

Reference field: THEAD-TDOBJECT

NAME

Enter the name of the text module. The name may be up to 70 characters long. Its internal structure depends on the text object used.

Reference field: THEAD-TDNAME

ID

Enter the text ID of the text module. Table TTXID contains the valid text IDs, depending on the text object.

Reference field: THEAD-TDID

LANGUAGE

Enter the language key of the text module. The system accepts only languages that are defined in table T002.

Reference field: THEAD-TDSPRAS

ARCHIVE_HANDLE

If you want to read the text from the archive, you must enter a handle here. The system uses it to access the archive. You can create the handle using the function module ACHIVE_OPEN_FOR_READ.

The value '0' indicates that you do not want to read the text from the archive.

Reference field: SY-TABIX

Default value: 0

Import parameters:

HEADER

If the system finds the desired text, it returns the text header in this parameter.

Structure: THEAD

Table parameters:

LINES

The table contains all text lines that belong to the text read.

Structure: TLINE

Exceptions:

ID

The text ID specified in the parameter ID does not exist in table TTXID. It must be defined there together with the object of the text module.

LANGUAGE

The parameter LANGUAGE contains a language key that does not exist in table T002.

NAME

The parameter NAME contains the name of a text module that does not correspond to the SAPscript conventions.

Possible errors:

The field contains only blanks.

The field contains the invalid characters ‘*’ or ‘,’.

OBJECT

The parameter OBJECT contains the name of a text object that does not exist in table TTXOB.

NOT_FOUND

The system did not find the specified text module.

REFERENCE_CHECK

The text module to be read has no text lines of its own but refers to the lines of another text module. This reference chain can include several levels. For the current text, the chain is interrupted, that is, one of the text modules referred to in the chain no longer exists.

WRONG_ACCESS_ TO_ARCHIVE

The exception WRONG_ACCESS_TO_ARCHIVE is triggered if an archive is accessed using an incorrect or non-existing archive handle or an incorrect mode (that is, read if the archive is open for writing or vice versa).

Reward if useful.

Former Member
0 Kudos

Hii

SAPscript: Read text

In order to process text modules in application programs, all information about a text module must be transferred to internal work areas.

A text is read from the text file or text memory with this function module. It must be described fully by specifying OBJECT, NAME, ID, and LANGUAGE. Generic entries in these parameters are not valid.

if u pass suitable OBJECT, NAME,ID values

for example

ID = gf_id

LANGUAGE = sy-langu

NAME = GF_NAME

OBJECT = 'J1IARE1'

GF_ID LIKE THEAD-TDID

GF_SPRAS LIKE THEAD-TDSPRAS

GF_OBJECT LIKE THEAD-TDOBJECT

GF_NAME LIKE THEAD-TDNAME

reward points if useful

regards

jaipal

RoySayak
Active Participant
0 Kudos

it is used to read the standard text stored in the database.

u can create ur own standard text by using SO10 tcode. & it's stored in the table STXH. but if u need to use in some program then u've to use read text. bu in case of sapscript or smart form u don' need to use this FM. u can directly access those by using insert->standard text in SAPSCRIPT & text module in SMARTFORM.

in case of report or adobe forms u have to use read text to feth the content of the standard text.

Reward if useful

Thanks

Sayak