Posted: Wed Aug 20, 2008 10:00 am Post subject: Find How Text in Stored to be Read by READ_TEXT
Code:
* Source Name is ZFINDTXT
REPORT ZFINDTXT MESSAGE-ID Zfi001 NO STANDARD PAGE HEADING
LINE-SIZE 132 LINE-COUNT 65.
**********************************************************************
* Author: Joe Mason - SAP Chicago *
* Purpose: To Find TEXT Description Data is Stored within SAP *
* so that it is possible to read TEXT using *
* FUNCTION Module 'READ_TEXT'. *
* To Start: Go into Functional Area of Interest and Create text *
* (example - add Text to Material Master) *
* Save KEY of Record *
* (example - save Material Number) *
* Execute this Program - Enter Key Data into Parameter *
* at Execution Time *
* What this Program Does: *
* Reads Table STXH, sees if Key (on Parameter) matches data *
* in Table STXH *
* - if it does - Prints Out Data Needed for Function READ_TEXT *
* - executes a Test on READ_TEXT *
* - if found -- Prints Out Data Found *
* - if not found - Reports Not FOUND *
* On Screen at Execution Time ENTER - key of file where text was *
* stored - i.e. Customer Number, Material, Order Number, etc. *
* What do You DO: *
* See if Text is FOUND & Matches TEXT you entered *
* If SO - you now know what to supply to READ_TEXT *
**********************************************************************
TABLES: STXH.
DATA: BEGIN OF TAB,
TDOBJECT LIKE STXH-TDOBJECT,
TDNAME LIKE STXH-TDNAME,
TDID LIKE STXH-TDID,
TDSPRAS LIKE STXH-TDSPRAS,
END OF TAB.
DATA: BEGIN OF LINES OCCURS 5.
INCLUDE STRUCTURE TLINE.
DATA: END OF LINES.
DATA: LINES-COUNT TYPE P.
DATA: FOUND-COUNT TYPE P.
PARAMETERS: KEYDATA LIKE STXH-TDNAME DEFAULT '????'.
SET BLANK LINES ON.
SELECT * FROM STXH.
IF STXH-TDNAME CS KEYDATA.
ADD 1 TO FOUND-COUNT.
WRITE: / 'Possible Hit'.
WRITE: / ' Object =', STXH-TDOBJECT.
WRITE: / ' Name =', STXH-TDNAME.
WRITE: / ' TextID =', STXH-TDID.
WRITE: / ' Language =', STXH-TDSPRAS.
WRITE: / ' '.
WRITE: / ' Test of Call to READ_TEXT'.
CLEAR TAB.
MOVE-CORRESPONDING STXH TO TAB.
CLEAR LINES-COUNT.
REFRESH LINES.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = TAB-TDID
LANGUAGE = TAB-TDSPRAS
NAME = TAB-TDNAME
OBJECT = TAB-TDOBJECT
* ARCHIVE_HANDLE = 0
* IMPORTING
* HEADER =
TABLES
LINES = LINES
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8.
DESCRIBE TABLE LINES LINES LINES-COUNT.
IF LINES-COUNT EQ 0.
WRITE: / ' STATUS - Match Not Found'.
ELSE.
LOOP AT LINES.
WRITE: / ' Found =', LINES(72).
ENDLOOP.
ENDIF.
WRITE: / '_________________________________________'.
ENDIF.
ENDSELECT.
IF FOUND-COUNT EQ 0.
WRITE: / 'DID NOT FIND ANY MATCHES USING', KEYDATA.
ENDIF.
INCLUDE ZCONINC3.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.