Posted: Sun Oct 14, 2007 5:58 pm Post subject: ABAP code to manipulate program textpools
From within ABAP you are able to manipulate a programs textpool(text elements). See code
below to see how to read, delete and add new entries to a textpool.
Code:
*Data declaration for textpool manipulation
DATA: PROGRAM(30) VALUE 'ZTESTPROG',
TAB LIKE TEXTPOOL OCCURS 50 WITH HEADER LINE.
*Read textpool
READ TEXTPOOL PROGRAM INTO TAB LANGUAGE SY-LANGU state 'A'.
*Delete textpool
DELETE TEXTPOOL program LANGUAGE 'E'.
*Add entry to text pool
READ TEXTPOOL PROGRAM INTO TAB LANGUAGE SY-LANGU state 'A'.
DELETE TEXTPOOL program LANGUAGE 'E'.
TAB-ID = 'S'. TAB-KEY = 'DATYP'. TAB-ENTRY = 'Date Type'.
APPEND TAB.
SORT TAB BY ID KEY.
INSERT TEXTPOOL PROGRAM FROM TAB LANGUAGE SY-LANGU.
Creating dynamically text elements in a program (text symbols, selection texts)
Code:
" Text elements creation
DATA : gt_texts TYPE STANDARD TABLE OF textpool WITH HEADER LINE.
" Text elements creation
gt_texts-id = 'I'. gt_texts-key = '300'. gt_texts-entry = 'Options'.
APPEND gt_texts.
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.