Application Development 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: 

Selection texts

Former Member
0 Kudos

Can you please help me to set the selection texts dynamically in a report ?

5 REPLIES 5

naimesh_patel
Active Contributor
0 Kudos

Hello,

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(10) AAA FOR FIELD P1.

PARAMETERS: P1 LIKE SAPLANE-PLANETYPE, P2(5), P3(1).

SELECTION-SCREEN END OF LINE.

Initilization.

AAA = 'Selection'.

regards,

Naimesh

0 Kudos

Hi,

I want to set the name of P1 dynamically.

0 Kudos

Hello,

Try...

INSERT TEXTPOOL PROGRAM FROM TAB LANGUAGE SY-LANGU.

Regards,

Naimesh

Former Member

Hi sabyasachi,

1. simple.

2. suppose your field name is MYFIELD,

then the label/text can be changed/accessed

like this.

%_<b>MYFIELD</b>_%_APP_%-TEXT

3. just copy paste this small program.

Enter any thing in the text box,

and it will dynanmially change the text.

4.

*----


*

*

*

*

*

*

*

*

*----


REPORT ZTRN_SCREEN_ELEMENTS.

*----


Block

selection-screen begin of block b1 with frame title text-001.

parameters : myfield(25) type c default 'Type and press Enter'.

selection-screen end of block b1.

*----


at selection-screen output.

%_MYFIELD_%_APP_%-TEXT = myfield.

regards,

amit m.

vinod_gunaware2
Active Contributor
0 Kudos

<b>Dynamic Dictionary Reference</b>

If you want the data type of a parameter to refer dynamically to a data type from the ABAP Dictionary, use the following syntax:

PARAMETERS <p> LIKE (<name>) ...

At the time the selection screen is called, field <name> must contain the name from a data type of the ABAP Dictionary. Currently, parameters can only refer to fields of database tables, views and structures. The parameter dynamically adopts the attributes of the Dictionary type, that is, technical properties and help texts. If you do not create a selection text for the parameter in the program, the field label from the Dictionary appears as the description on the selection screen. Otherwise, the selection text is displayed.

The contents of field <name> are taken from the program in which the selection screen is defined. If the selection screen is defined in the selection part of a logical database, then field <name> of the associated database program is used.

REPORT DEMO.

DATA NAME(20) TYPE C.

SELECTION-SCREEN BEGIN OF SCREEN 500.

PARAMETERS P_CARR LIKE (NAME).

SELECTION-SCREEN END OF SCREEN 500.

NAME = 'SPFLI-CARRID'.

CALL SELECTION-SCREEN 500.

regards

vinod