cancel
Showing results for 
Search instead for 
Did you mean: 

Reg Field bseg-sgtxt in SAP SCRIPT

Former Member
0 Kudos

Hi All,

I post agian this question, cause its urgent............

I have to issue with bseg-sgtxt field. In my script i have field item text for this field is bseg-sgtxt. anf this field lenght is 50 char. but problem is i want item text more then 50 char in my script. for that i find long text button... this long text stored in EENO_DYNP and field name is ZEILE , but it is a structure...so i have 3 question

1) How can i retrive this long text field in my script

2) How can i concate bseg-sgtxt with EENO_DYNP-ZEILE

3) what i write in SAP SCRIPT???

Can you help me.........

Vishal

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Vishal,

The field for long text is EENO_DYNP-ZEILE as per the technical information in FB70.

However this long text cannot be directly read from any table.

In display mode , go into the editor for entering this long text. In the menu bar choose GO TO--> HEADER.

Here you can find Text name, Language, Text ID, Text object.

These parameters are needed to passed to function module READ_TEXT in your script form. You get the long text in table LINES of the FM.

e.g.,

If document number (BELNR) is 350000000 having 2 line items.

TDNAME - FR4035000000012010001 for the second line item long text.

The text name is got by concatenating company code (FR40 )+ document number(350000000) + year (2010)+ item number(002).

Item number can be got from BSEG table.

Though the reply is late.

Hope it helps you.

Former Member
0 Kudos

Hi vishal,

i am sending the program for extracting long text.

by using this program u get long text in one field and this field concatenate with

u r desired field.

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

kishore ale

former_member624107
Contributor
0 Kudos

Hi...

The long texts of a document are stored in a encrypted format in the STXH and STXL tables, where STXH stores the header information of the long text like TDOBJECT, which indicates which text object the long text belongs to, TDID which indicates the Text ID and TDNAME which is the actual name of the long text.

As these texts are stored in a encrypted format, the text cannot be read using a SELECT statement. You will have to use the function READ_TEXT. The easiest way of getting to know the parameter values is to go to a document, open the long text in a full screen mode. For example, when you wan to see the long text for a Purchase order, go to transaction ME23n. Assume, you want to see the parameters for the Header Text. In the first Tab Strip Control, click on the Texts tab and select the Header Text node on the left hand side, which will display the text on the right hand side. Now, double click on the text editor on the right hand side. This will open the text in the full screen mode. In the menu Go To --> Header, you should be able to see the values for all the three parameters we discussed above. We will have to do the same thing for whichever text parameters we want to see.

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

ID =

LANGUAGE =

NAME =

OBJECT =

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

TABLES

LINES =

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