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

Selection Text

Former Member
0 Likes
3,797

Hi,

I wonder is there any way to initial parameters display name without using SELECTION TEXT in TEXT ELEMENTS?

I want to do this because every time i copy my codes to others places i have to rewrite the display name in selection text.

1 ACCEPTED SOLUTION
Read only

Former Member
2,803

Hi,

You need to place the logic to assign text to labels at the Initialization of the screen. For selection screen, place the logic in the event INITIALIZATION.


suppose the screen elements are P_BUKRS and P_PLANT so the code will be like as following :


INITIALIZATION.

     %_P_BUKRS_%_APP_%-TEXT     = 'Company Code'.

     %_P_PLANT_%_APP_%-TEXT     = 'Plant'.



Similarly, you can change text of other parameters by replacing parameter name in

%_[parameter name]_APP_%-TEXT

and assigning the required label text to it.

Regards,

Ashish

5 REPLIES 5
Read only

yogendra_bhaskar
Contributor
0 Likes
2,803

Hi Vong ,

If you tick mark Dictionary ref. in selection text , it will automatically accept text defined for that element.

Other way will be if copy a program , then it will copy its selection text also.

Regards,

Yogendra Bhaskar

Read only

sivaganesh_krishnan
Contributor
0 Likes
2,803

Hi,

you can use SELECTION-SCREEN COMMENT 2(10) text-001 FOR FIELD fieldname.

By using this you can add your own text to field. At runtime you can use at selection screen output to pass your own text element name.

Regards,

Sivaganesh

Read only

0 Likes
2,803

This cannot apply to all parameter.i believe it only work on button and radio button.

Read only

Former Member
2,804

Hi,

You need to place the logic to assign text to labels at the Initialization of the screen. For selection screen, place the logic in the event INITIALIZATION.


suppose the screen elements are P_BUKRS and P_PLANT so the code will be like as following :


INITIALIZATION.

     %_P_BUKRS_%_APP_%-TEXT     = 'Company Code'.

     %_P_PLANT_%_APP_%-TEXT     = 'Plant'.



Similarly, you can change text of other parameters by replacing parameter name in

%_[parameter name]_APP_%-TEXT

and assigning the required label text to it.

Regards,

Ashish

Read only

rosenberg_eitan
Active Contributor
0 Likes
2,803

Hi ,

Another option is to use FUNCTION 'SELECTION_TEXTS_MODIFY'

Code:

PARAMETERS: p_sndr_1 TYPE adsmtp-smtp_addr .

SELECTION-SCREEN SKIP .

PARAMETERS: p_rcpn_1 TYPE adsmtp-smtp_addr .

PARAMETERS: p_rcpn_2 TYPE adsmtp-smtp_addr .

INITIALIZATION.
  PERFORM at_initialization .

FORM at_initialization .

  DATA: it_seltexts TYPE TABLE OF rsseltexts .
  DATA: st_seltexts LIKE LINE OF it_seltexts .

  st_seltexts-name = 'P_SNDR_1' .
  st_seltexts-kind = 'P' .
  st_seltexts-text = 'Sender mail '  .
  APPEND st_seltexts TO it_seltexts .

  st_seltexts-name = 'P_RCPN_1' .
  st_seltexts-kind = 'P' .
  st_seltexts-text = 'Recipient mail 1 '  .
  APPEND st_seltexts TO it_seltexts .

  st_seltexts-name = 'P_RCPN_2' .
  st_seltexts-kind = 'P' .
  st_seltexts-text = 'Recipient mail 2 '  .
  APPEND st_seltexts TO it_seltexts .

  CALL FUNCTION 'SELECTION_TEXTS_MODIFY'
    EXPORTING
      program                     = sy-cprog
    TABLES
      seltexts                    = it_seltexts
    EXCEPTIONS
      program_not_found           = 1
      program_cannot_be_generated = 2
      OTHERS                      = 3.


ENDFORM .                    "at_initialization
*----------------------------------------------------------------------*

Regards.