Dynamic Parameter Texts in Selection Screen

By | April 27, 2009 | Tricks | 19,050 | 9

Dynamic Parameter Text on Selection Screen by coding

Sometimes, we need to display the Dynamic Parameter Text for the parameters in the selection screen.

We can use %_parameter_%_APP_%-TEXT to have the parameter text from the coding.

*---------------------------------------------------------------------
* Shows how to give the selection screen parameter name by
*  using coding
*---------------------------------------------------------------------
REPORT  ztest_np_tmp.
*
DATAw_carrid TYPE sflight-carrid.
*
** Selection Screen
SELECTION-SCREENBEGIN OF BLOCK blk1 WITH FRAME TITLE aaa.
SELECT-OPTIONS:   s_carrid FOR w_carrid.
SELECTION-SCREENEND   OF BLOCK blk1.
*
INITIALIZATION.
* Description for the parameter
  IF sy-uname 'TEST'.
    %_s_carrid_%_app_%-text 'Carrier ID'.
  ELSE.
    %_s_carrid_%_app_%-text 'Flight ID'.
  ENDIF.

Without the code, we would see the selection screen like this:

And with the code, selection screen would be like this:

We can use this trik:
* Dyanmic Parameter text
* While Sharing the example code

Like It? Share!!

Don't miss an Update

Get notified of the new post, right into your inbox

Naimesh Patel{272 articles}

I'm SAP ABAP Consultant for more than a decade. I like to experiment with ABAP especially OO. I have been SDN Top Contributor.
Follow :

Explore all of his 272 articles.

Load comments

9 Comments

  • Hello, it is almost what I need. I would fill the screen with several dynamic select options like values from a table. How can I do it?

    Tks, Regards.

  • Hello Raphael,

    You asked: I would fill the screen with several dynamic select options like values from a table. How can I do it?

    It would be very difficult to achieve. But you can check SE16. After creating the dynamic select options, you can use this get the text of the select options on the selection screen.

    Regards,
    Naimesh Patel

  • Pretty Cool! I don't know if I ever have a need for it, but it will look good in a prototype and test program.

  • Nice one. But instead of in INITIALIZATION, you should populate the text in PBO / AT SELECTION-SCREEN OUTPUT. That will be more "linked" to the screen. INITIALIZATION triggers only once. :)

  • Hi Naimesh!
    Nice Blog at all!
    Better Way to dynamically change the selection texts is to use one of these function modules:
    SELECTION_TEXTS_MODIFY
    SELECTION_TEXTS_MODIFY_DTEL

    Greetz Enno

  • Hello Enno,

    Thanks for sharing..

    Regards,
    Naimesh Patel

  • Anonymous

    Uhm… in "Tips for this blog" on your right lower side copying to Word does not remove formating. Instead copy it to Notepad. That would remove the formating completely.

  • Anonymous

    You asked: I would fill the screen with several dynamic select options like values from a table. How can I do it?

    Use FM : FREE_SELECTIONS_INIT and FREE_SELECTIONS_DIALOG

  • Nagaphani

    Thank you Very Muchhhhhhhh

Comments on this Post are now closed. If you have something important to share, you can always contact me.

You seem to be new here. Subscribe to stay connected.