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: 

Reading Text

Former Member
0 Kudos

hi ,

what is the purpose of READ_TEXT FM ,,

can u give explanaiton with example.

4 REPLIES 4

Former Member
0 Kudos

Hi,

Please refer to the link below :

http://www.sapdev.co.uk/fmodules/fms_readtext.htm

Please find below documentation from SE37

FU READ_TEXT

____________________________________________________

Text

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.

Parameters

CLIENT

ID

LANGUAGE

NAME

OBJECT

ARCHIVE_HANDLE

LOCAL_CAT

HEADER

LINES

Exceptions

ID

LANGUAGE

NAME

NOT_FOUND

OBJECT

REFERENCE_CHECK

WRONG_ACCESS_TO_ARCHIVE

Thanks,

Sriram POnna.

Edited by: Sriram Ponna on Feb 12, 2008 3:41 PM

Former Member
0 Kudos

Hi,

By passing ID,LANGUAGE,NAME and OBJECT you can get 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

Rgds,

Bujji

Former Member
0 Kudos

Here it is..

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

Example of READ_TEXT functions reading tables PBIM - Independent requirements for material.

REPORT ZTEXT .

TABLES: PBIM.

  • stxh, stxl, stxb - trans tables for text

  • ttxit - text on text-ids

  • ttxot - Short texts on text objects

  • Transaction MD63

SELECT-OPTIONS: S_MATNR FOR PBIM-MATNR,

S_WERKS FOR PBIM-WERKS.

DATA: BEGIN OF HTEXT.

INCLUDE STRUCTURE THEAD.

DATA: END OF HTEXT.

DATA: BEGIN OF LTEXT OCCURS 50.

INCLUDE STRUCTURE TLINE.

DATA: END OF LTEXT.

DATA: BEGIN OF DTEXT OCCURS 50.

DATA: MATNR LIKE PBIM-MATNR.

INCLUDE STRUCTURE TLINE.

DATA: END OF DTEXT.

DATA: TNAME LIKE THEAD-TDNAME.

SELECT * FROM PBIM WHERE WERKS IN S_WERKS.

MOVE PBIM-BDZEI TO TNAME.

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

ID = 'PB'

LANGUAGE = 'E'

NAME = TNAME

OBJECT = 'PBPT'

  • ARCHIVE_HANDLE = 0

IMPORTING

HEADER = HTEXT

TABLES

LINES = LTEXT

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

NOT_FOUND = 4

OBJECT = 5

REFERENCE_CHECK = 6

WRONG_ACCESS_TO_ARCHIVE = 7

OTHERS = 8.

LOOP AT LTEXT.

IF LTEXT-TDLINE NE ''.

MOVE LTEXT-TDLINE TO DTEXT-TDLINE.

MOVE PBIM-MATNR TO DTEXT-MATNR.

APPEND DTEXT.

ENDIF.

ENDLOOP.

ENDSELECT.

LOOP AT DTEXT.

WRITE:/ DTEXT-MATNR, DTEXT-TDLINE.

ENDLOOP.

What is the purpose of READ_TEXT functuion module and how to get text id value in this scenario(TDID)?

In business process, there are so many transactions that take place in every day, like purchase orders, sales orders, delivery, gooodsmovement etc... SAP provided a feature to maintain some text descriptions.

Read_Text Function module is used to retrieve the text for a particular objects.

To find the Text id these are the following steps. Let us take an example of Billing document Header text.

1. goto VF03, enter Billing doc Number

2. from menuselect Goto>Header-->header Text..... New window will be displayed

3. select the Header Text. here you can see all the text.

4. click on the TEXT (which you want to know the Text id) , then press log ICON (you can find in bottom right of the text window) it looks like a rolled paper.

5. in the Next window you will find Text Name. Text ID, Language. etc...

Former Member
0 Kudos

well like it´s name tells, its purpose is to Read texts.

it can read any kind of texts an often is used to read header texts or position texts in SD.

all the (standard)texts you create and edit with TA SO10 can be read with this FM.