Wednesday, July 13, 2016

READ_TEXT

Short texts are different from texts. These are saved mostly at transaction data. As there are different types of texts for each document ( eg : purchasing document ), SAP saves them in encrypted form.

'READ_TEXT' Function module is used to read this data. For using the FM, we need to know certain details of the texts we want to read.

The details can be found in below tables.
STXH - STXD SAPscript text file header
STXL - STXD SAPscript text file lines - This table has data encrypted. So need to use the FM to read it.


They can also be found using Tcode
SE75 - SAP Script Settings
















Below is the information needed to run the FM

OBJECT :
Go to Tcode SE75 and run it for ' Text Objects and IDs'
In Object ID , look for the base table for the text you are looking for.
For eg : Purchasing EKKO, EKPO;
             Sales Order VBBK, VBBP

NAME
This is the Document number ( with or with out item ) you are considering.
For eg : I need Shipping Instructions for Sales Document. So the Sales Order number is the NAME

ID
Once you know the OBJECT name in SE75, double click on the object name and it should give you all the available texts with its IDs. Get the ID you are looking for.
Eg : 001, 002 etc.

LANGUAGE
Language you need the text in.

You can also check entries in table 'STXL'  for a given document number. You get all the text maintained for it with it codes. you can double check it against the Tcode IDs

Once the FM is executed, LINES table should give you the text maintained. It will come in either single or multiple lines depending on how the text is maintained.

*** Reading the collection text
CALL FUNCTION 'READ_TEXT'
  EXPORTING
*   CLIENT                        = SY-MANDT
    ID                                   'ST'
    LANGUAGE                 'E'
    NAME                           lv_name
    OBJECT                        'TEXT'
*   ARCHIVE_HANDLE  = 0
*   LOCAL_CAT               = ' '
* IMPORTING
*   HEADER                      =
  TABLES
    LINES                            lt_line
 EXCEPTIONS
   ID                                    1
   LANGUAGE                  2
   NAME                            3
   NOT_FOUND                4
   OBJECT                          5
   REFERENCE_CHECK               6
   WRONG_ACCESS_TO_ARCHIVE       7
   OTHERS                        8
          .

No comments:

Post a Comment