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

Dynamically show key fields of table on selection screen

0 Likes
2,646

Hi Experts!

My aim is to dynamically display the key fields of the table in a selection screen after entering a table name.

The mandate should not be shown.

Here are two examples:

Here all the three key fields (carrid, connid & date) of table sflight should be displayed.

At VBAK it only would be one key field (vbeln).

Does anyone has any idea on how i could implement this?

Thanks!

1 ACCEPTED SOLUTION
Read only

Patrick_vN
Active Contributor
2,316

Ok, if you absolutely no idea why on earth you would have such a requirement, but I'll try and think along.

If the list of tables for which your program needs to work is known, and limited, I would create a dropdown for the table and separate selection blocks per table. That way you can show/hide those blocks depending on what table is chosen.

If this somehow has to work for all tables, then you have the option to generate a new report at runtime using the statement below.

INSERT REPORT <prog> FROM <program_table>.

For documentation see here: abapdocu

If neither option is to your liking, I'd suggest you take a look at how a transaction like SE16n works. That way you don't have to reinvent the wheel, but it'll require some debugging of standard code..

Also, I found that you can create parameters dynamically according to the abap docu, but the same isn't mentionned for select-options.

3 REPLIES 3
Read only

Patrick_vN
Active Contributor
2,317

Ok, if you absolutely no idea why on earth you would have such a requirement, but I'll try and think along.

If the list of tables for which your program needs to work is known, and limited, I would create a dropdown for the table and separate selection blocks per table. That way you can show/hide those blocks depending on what table is chosen.

If this somehow has to work for all tables, then you have the option to generate a new report at runtime using the statement below.

INSERT REPORT <prog> FROM <program_table>.

For documentation see here: abapdocu

If neither option is to your liking, I'd suggest you take a look at how a transaction like SE16n works. That way you don't have to reinvent the wheel, but it'll require some debugging of standard code..

Also, I found that you can create parameters dynamically according to the abap docu, but the same isn't mentionned for select-options.

Read only

Former Member
2,316

Hello Marlon,

You may try to use the Function modules FREE_SELECTIONS_INIT and FREE_SELECTIONS_DIALOG for this purpose.

Hope that helps.

Thanks,

Ahana

Read only

MateuszAdamus
Active Contributor
2,316

Hello lbldraw427

It's not possible to have the selection screen created dynamically. You either have to have a predefined set of parameters like pvnierop suggests, or use a function like ahana.sengupta suggests.

To have the selection screen dynamic you need to regenerate it every time a user selects a different table. This is also how SE16 works - it regenerates the program every time different selection criteria fields are selected.

Kind regards,

Mateusz