Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Creating text elements dynamically by program

Former Member
0 Likes
1,526

Hi all,

Do you know how I can create text symbols or selection texts dynamically by program? (calling a FM or editing a table?)

What's the table for text elements?

Thanks in advance,

Mathieu

1 ACCEPTED SOLUTION
Read only

vinod_vemuru2
Active Contributor
0 Likes
722

Hi,

Not sure of FM. But programically u can do.

Check the statement

INSERT TEXTPOOL PROGRAM FROM TAB LANGUAGE

SY-LANGU.

This creates the text elements in the specifies program and in specified language.

Not only text elements but also list headings u can create.

Check below sample code given by SAP.


DATA: PROGRAM(8) VALUE 'PROGRAM',
      TAB LIKE TEXTPOOL OCCURS 50 WITH HEADER LINE.

TAB-ID = 'T'. TAB-KEY = SPACE.  TAB-ENTRY = 'Sales'.
APPEND TAB.
TAB-ID = 'I'. TAB-KEY = '200'.  TAB-ENTRY = 'Tax'.
APPEND TAB.
TAB-ID = 'H'. TAB-KEY = '001'.  TAB-ENTRY = 'Name   Age'.
APPEND TAB.
TAB-ID = 'S'. TAB-KEY = 'CUST'. TAB-ENTRY = 'Customer'.
APPEND TAB.
TAB-ID = 'R'. TAB-KEY = SPACE.  TAB-ENTRY = 'Test program'.
APPEND TAB.

SORT TAB BY ID KEY.
INSERT TEXTPOOL PROGRAM FROM TAB LANGUAGE SY-LANGU.

eg:TAB-ID = 'I'.                 For Text elements
TAB-KEY = '200'.             Text element number
 TAB-ENTRY = 'Tax'.        Actual text

But use it only for new developments. Bucause it may overwrite the existing texts.

Thanks,

Vinod.

Edited by: Vinod Reddy Vemuru on Aug 8, 2008 2:48 PM

3 REPLIES 3
Read only

former_member787646
Contributor
0 Likes
722

Hi

Create a BDC recording using the TCODE: SHDB for the Transaction SE32 and write the code in your program accordingly.

Hope it helps.

Murthy

Read only

vinod_vemuru2
Active Contributor
0 Likes
723

Hi,

Not sure of FM. But programically u can do.

Check the statement

INSERT TEXTPOOL PROGRAM FROM TAB LANGUAGE

SY-LANGU.

This creates the text elements in the specifies program and in specified language.

Not only text elements but also list headings u can create.

Check below sample code given by SAP.


DATA: PROGRAM(8) VALUE 'PROGRAM',
      TAB LIKE TEXTPOOL OCCURS 50 WITH HEADER LINE.

TAB-ID = 'T'. TAB-KEY = SPACE.  TAB-ENTRY = 'Sales'.
APPEND TAB.
TAB-ID = 'I'. TAB-KEY = '200'.  TAB-ENTRY = 'Tax'.
APPEND TAB.
TAB-ID = 'H'. TAB-KEY = '001'.  TAB-ENTRY = 'Name   Age'.
APPEND TAB.
TAB-ID = 'S'. TAB-KEY = 'CUST'. TAB-ENTRY = 'Customer'.
APPEND TAB.
TAB-ID = 'R'. TAB-KEY = SPACE.  TAB-ENTRY = 'Test program'.
APPEND TAB.

SORT TAB BY ID KEY.
INSERT TEXTPOOL PROGRAM FROM TAB LANGUAGE SY-LANGU.

eg:TAB-ID = 'I'.                 For Text elements
TAB-KEY = '200'.             Text element number
 TAB-ENTRY = 'Tax'.        Actual text

But use it only for new developments. Bucause it may overwrite the existing texts.

Thanks,

Vinod.

Edited by: Vinod Reddy Vemuru on Aug 8, 2008 2:48 PM

Read only

0 Likes
722

Thanks, it's working fine...