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: 

how to pass the table and field name dynamically in select option

Former Member
0 Kudos

I want to pass the table and field name at run time in select-option.

select-option: val for sflight-carrid. instead of this

select-option: val for tablename-fieldname.

help me to pass the value or provide some other way.

2 REPLIES 2

Ryan-Crosby
Active Contributor
0 Kudos

Hi,

This is the example directly from the help:


PARAMETERS: dbtab  TYPE c LENGTH 30,
            column TYPE c LENGTH 30.

DATA name(80) TYPE c.

SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW.
SELECT-OPTIONS selcrit FOR (name).
SELECTION-SCREEN END OF SCREEN 500.

CONCATENATE dbtab '-' column INTO name.

This the supporting text the describes the overall usage:

Effect

If you specify this addition, columns low and high in the selection table are created with the data type c with a length of 45. The input fields are displayed on the selection screen but in a length and with a field and input help that matches the data type specified in name.

For name, you must specify a flat character-like data object that contains the name of a component in a flat structure from the ABAP Dictionary in block capitals when the selection screen is accessed. If the text pool currently loaded does not contain a selection text for the parameter, the output field displays the corresponding field label from the ABAP Dictionary. When data is transported from the input field to the selection table, the content is converted as if it were assigned by the corresponding ABAP data type (no formatting characters, period as a decimal separator, date format YYYYMMDD, and so on).

If the content of name is not a structure component in the ABAP Dictionary, the input fields are displayed according to the actual type of columns low and high. If a selection text for the parameter is not created in the text pool currently loaded, the output field contains the text "Generic Selection Option".

Regards,

Ryan Crosby

0 Kudos

Hi Ryan,


Thank you for your idea. Really its very helpful for me to do the dynamic program easily.