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: 

Dynamic selection screen for user input parameter

Iqbol
Explorer
0 Kudos

I would like to add button in selection screen with text "Add a member comission". if user clicks the button two input parameter fields should be added/appeared on the selection screen: one parameter for member position, another parameter for member full name. If the user clicks "Add a member comission" button again, similarly another comission member should be added on the screen with its two parameters (position and fullname). Maximum comission members can be upto 15 members depending on user clicks on the button. At the end of selection screen, all comission members details (member position and member fullname) should be collected one internal table. How can it be implemented, please help. Thanks.

1 ACCEPTED SOLUTION

GK817
Active Contributor

Hello,

One option is to have all selection screen fields for 15 new members and then hide/unhide them based on the button click. You will have to save the button click counter somewhere(probably shared memory or one selection screen field which is hidden, but values gets updated for each click). At end of screen, just read values from all selection-screen fields.

To hide/unhide values, use LOOP AT SCREEN. Lots of information regarding that on SAP Community. Link

Or you may decide to generate selection-screen dynamically - Follow this link

4 REPLIES 4

GK817
Active Contributor

Hello,

One option is to have all selection screen fields for 15 new members and then hide/unhide them based on the button click. You will have to save the button click counter somewhere(probably shared memory or one selection screen field which is hidden, but values gets updated for each click). At end of screen, just read values from all selection-screen fields.

To hide/unhide values, use LOOP AT SCREEN. Lots of information regarding that on SAP Community. Link

Or you may decide to generate selection-screen dynamically - Follow this link

Sandra_Rossi
Active Contributor
0 Kudos

It's not the purpose of a selection screen to type data to save it into database. You would better do it via a dynpro.

But if it's for ABAP training, fine.

former_member1716
Active Contributor

iqbol.adahamjonov,

Your Requirement doesn't suit to Selection screen, instead Recommend you to opt for Module Pool Programming.

In case your requirement grows later, Module Pool should be a better choice than selection screen. Also considering the fact that you need to collect the data in an internal table this should be a better choice.

Regards!

In selection screen get the number of members u need to add, accordingly u design your internal table with editable fields. Add the custom button like add item or delete item, so that the user can add or remove the records. Write the process logic to update the same.

Best Regards,

Santhosh...