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

Read_text

Former Member
0 Likes
1,704

I to ptintout the text by using

Text object = vbbk

Text id = z003

Text Name = vbak-vbeln

By using Read_text Function module..

Can anybody send a sample code for this ....

pls tell me out declare the internal table for this ... n how to import and export the data...

pls provide a code for this

Regards,

pandu.

9 REPLIES 9
Read only

Former Member
0 Likes
1,202

Hi,

DATA: zid TYPE thead-tdid,

zname TYPE thead-tdname.

CONSTANTS: c_language TYPE thead-tdspras VALUE 'D',

c_object TYPE thead-tdobject VALUE 'KONP'.

DATA: it_lines TYPE STANDARD TABLE OF tline WITH HEADER LINE.

CALL FUNCTION 'READ_TEXT'

EXPORTING

id = zid

language = c_language

name = zname

object = c_object

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.

regards

Nicole

Read only

former_member188827
Active Contributor
0 Likes
1,202

data tline1 type TABLE OF tline WITH HEADER LINE.

DATA:ZNAME TYPE STXL-TDname.

MOVE VBAK-VBELN TO ZNAME..

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

id = 'Z003'

language = 'E'

name = Zname

object = 'VBBK'

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

tables

lines = tline1

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.

LOOP AT TLINE1.

WRITE/ TLINE1-TDLINE.

ENDLOOP.

Message was edited by:

user_15

Read only

0 Likes
1,202

Hi

I have excuted the program what u had given the code. Syntactically its correct but

but iam not getting the output in write statement ..

SY-SUBRC is giving the value as 1 ...

Can u ple tell me what ia wrong in that...

Regards,

pandu.

Read only

0 Likes
1,202

pls send me the code for read_text Function module ..

Read only

0 Likes
1,202

hai,

this is sample code for read_text

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..

Regards

kish

Read only

0 Likes
1,202

Hi,

which code from all of the solutions did you get?

Read only

0 Likes
1,202

iam trying to do for quotation.

Pandu.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,202

Look at this thread

But you should look for online help and FM online documentation too.

Regards

Read only

Former Member
0 Likes
1,202

Hi Pandu,

Try this...

TYPES : BEGIN OF tp_tline.

INCLUDE STRUCTURE tline.

TYPES : END OF tp_tline.

DATA : tt_lines TYPE tp_tline OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'READ_TEXT'

EXPORTING

id = 'z003'

language = sy-langu

name = vbak-vbeln

object = 'vbbk'

TABLES

lines = tt_lines

EXCEPTIONS

id = 1

language = 2

name = 3

not_found = 4

object = 5

reference_check = 6

wrong_access_to_archive = 7

OTHERS = 8.