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.
*
DATA: w_carrid TYPE sflight-carrid.
*
** Selection Screen
SELECTION-SCREEN: BEGIN OF BLOCK blk1 WITH FRAME TITLE aaa.
SELECT-OPTIONS: s_carrid FOR w_carrid.
SELECTION-SCREEN: END 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
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.
Thank you Very Muchhhhhhhh
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
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.
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