SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

ABAP code to manipulate program textpools



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Dynamic Programming | Динамическое программирование
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Sun Oct 14, 2007 5:58 pm    Post subject: ABAP code to manipulate program textpools Reply with quote

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.

gt_texts-id = 'I'. gt_texts-key = '301'.  gt_texts-entry = 'Criteria selection'.
APPEND gt_texts.

gt_texts-id = 'S'. gt_texts-key = 'P_LINES'. gt_texts-entry = 'Maximum No. of Hits'.
APPEND gt_texts.

SORT gt_texts BY id key.
INSERT TEXTPOOL p_prog FROM gt_texts LANGUAGE SY-LANGU.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Dynamic Programming | Динамическое программирование All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
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.