Problem solve Get help with specific problems with your technologies, process and projects.

Reporting long text

A simple way to locate the long text object you need.

Don't be intimidated by long text! I often have requirements to report long text (such as sales order notes or...

delivery notes). A simple way to locate the long text object you need is as follows:

1) In a test or production client, modify one line of the long text you want to report. For instance, VA02 can be used to update sales order text at the header or item level.

2) Use SE16 to browse table STXH. Enter the userid of the person who modified the long text (in field TDLUSER) and today's date (in field TDLDATE). The query should display just one record - the one that was just changed.

3) Use the keys from table STXH to call function module READ_TEXT. The keys are TDOBJECT, TDNAME, TDID, and TDSPRAS. Three of the four keys are constants, with TDNAME being the variable that contains the key of the sales order, delivery number, etc. READ_TEXT fills an internal table with the long text of the object desired. Loop at this table to unload as may lines of text as required.

Good luck!


 DATA: BEGIN OF ws_tline OCCURS 10.
        INCLUDE STRUCTURE tline.
DATA: END OF ws_tline.
CONSTANTS WS_TDID_EXT_NOTE LIKE THEAD-TDID VALUE 'ZDLE'.
CONSTANTS WS_TDSPRAS LIKE THEAD-TDSPRAS VALUE 'E'.
DATA WS_SO_AND_LINE LIKE THEAD-TDNAME.
CONSTANTS WS_TDOBJECT LIKE THEAD-TDOBJECT VALUE 'VBBP'.

* Build ws_so_and_line - don't use concatenate, it removes leading zeros
ws_so_and_line+0(10) = vbap-vbeln.
ws_so_and_line+10(6) = vbap-posnr.

CALL FUNCTION 'READ_TEXT'
     EXPORTING
          id                      = ws_tdid_ext_note
          language                = ws_tdspras
          name                    = ws_so_and_line
          object                  = ws_tdobject
     TABLES
          lines                   = ws_tline
     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.
  LOOP AT ws_tline.
*   ws_tline-tdline contains text line
    ...
    ...
  ENDLOOP.
ENDIF.

This was last published in May 2002

Dig Deeper on SAP ABAP

PRO+

Content

Find more PRO+ content and other member only offers, here.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchManufacturingERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchCRM

SearchContentManagement

SearchFinancialApplications

Close