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: 

Help me its Urgent

Former Member
0 Kudos

Hi All,

VA43 (Dispaly Contract)

Execute the transation VA43 (Dispaly Contract) then we can found text for VBELN using navigation GOTO->ITEM->TEXT

we can read that text using FM READ_TEXT

BUT I DON'T KNOW HOW TO USE THAT FM

plz give me sample code to read that text for that VBELN

i look forward to your reply

Reward Points

Thanks & Regards

SEK

11 REPLIES 11

Former Member
0 Kudos

Hi Raja,

Enter in VA42 ( changing mode )

Open the text into plain page mode !

Then GoTo -> Header :

Here you can find the FM Read_text parameters, like name, objetc , ID, ...

This tips is available for all SAP std text !

Hope this helps,

Erwan

0 Kudos

Hi Erwan,

Thank you very much for your reply

ur given answer is very helpful for me

Thanks & Regards

SEK

0 Kudos

Hi Raja,

are the helpful answers solved your problem?

Regards, Dieter

Former Member

former_member181962
Active Contributor
0 Kudos

pass the following parameter:

name: concatenation of vbeln and posnr

Object: VBBP

ID: 0004

language: sy-langu.

REgards,

Ravi

Former Member
0 Kudos

Hi Raja,

When you double click on the text editor, it'll will take you to a MS-Word kind of editor.

Then from the Menu there, select GOTO-->HEADER.

there you'll get........

Text Name

Language

Text ID &

Text object

The text name contains the document number or concatenated doc no. with line item no.( depends on header or detail text ).

Just pass these parameters to the function module.

Former Member
0 Kudos

Hi,

READ_TEXT is used to read the "sapscript" text which is stored in transaction SE75 and SO10. You have standard text which is in SO10 and Text objects which is configured via SE75. For example, everywhere you see "long text" in a text editor on a screen, chances are that it is stored as a text object and can be pulled into your programs via the READ_TEXT function module.

Here is sample code for FM READ_TEXT

See this sample code

ABAP READ_TEXT functions to read the SAP Long Text

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 <b>'READ_TEXT'</b>

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.

http://www.sapdevelopment.co.uk/sapscript/sapscript_texts.htm

Also

*Internal table to store standard texts

DATA: IT_TEXTS like T_LINE occurs o with header line.

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

id = "Text ID

language = "Laguage

name = "Text name

object = "text object

  • ARCHIVE_HANDLE = 0

  • IMPORTING

  • HEADER =

tables

lines = IT_TEXTS "Internal table

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

Hope it's useful to u..

Regards,

Kumar

Message was edited by:

kumar kk

Former Member
0 Kudos

hi raja,

Call the FM like below

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

id = 'Z220'

language =

name = sales oere with line item

object = 'VBBP'

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

tables

lines = td_lines

  • EXCEPTIONS

  • ID = 1

  • LANGUAGE = 2

  • NAME = 3

  • NOT_FOUND = 4

  • OBJECT = 5

  • REFERENCE_CHECK = 6

  • WRONG_ACCESS_TO_ARCHIVE = 7

  • OTHERS = 8

Regards,

Satya

Former Member
0 Kudos

double click on the text ,u will taken to editor...then click GoTo -> Header

u will get ID,OBECT,NAME. .........pass this value to fn module

data : line like table of tline with header line.

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

ID = ID

LANGUAGE = 'E'

NAME = name

OBJECT = object

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

TABLES

LINES = line

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,

aswin.

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Check whether the sample code in this helps.

http://www.sapfans.com/forums/viewtopic.php?t=97079

Former Member
0 Kudos

Hi Raja,

here a short example:

DATA: BEGIN OF HEAD.

INCLUDE STRUCTURE THEAD.

DATA: END OF HEAD.

*

DATA: BEGIN OF LINE OCCURS 10.

INCLUDE STRUCTURE TLINE.

DATA: END OF LINE.

*

HEAD-TDID = '0001'.

HEAD-TDSPRAS = SY-LANGU.

HEAD-TDOBJECT = 'VBBP'.

*

concatenate vbap-vbeln vbap-posnr into HEAD-TDNAME.

*

CALL FUNCTION 'READ_TEXT'

EXPORTING

ID = HEAD-TDID

LANGUAGE = HEAD-TDSPRAS

NAME = HEAD-TDNAME

OBJECT = HEAD-TDOBJECT

IMPORTING

HEADER = HEAD

TABLES

LINES = LINE

EXCEPTIONS

NOT_FOUND = 01.

*

In table TTXOB (TTXOT) you can see the relevant Objects.

In table TTXID (TTXIT) you can see the relevant IDs.

In table STXH you can see the relevant Textheaders.

Hope it helps.

Regards, Dieter