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

Selection Screen Problem

Former Member
0 Likes
471

Folks,

I have strange requirements for my selection screen variant.I have 2 screen ,when i click on particular field on 1st selection screen the 2nd selection screen pops up.Now i have to save values of 2nd selection screen on the 1st selection screen as variant.It means that i have to pass selection data of 2nd screen to the first screen and save it on there.Can someone guide me how to do this.Thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
446

Checkout help on "Ranges".

Also, you can also try this.

In your PBO for the 2nd screen, insert values entered on 2nd screen to select options tables of the first screen. All select options are essentially tables. You can loop thru the select options table in Screen 2 and insert them into select options of the first screen. I would start by making sure that the PBO of the 2nd screen gets called when you close it, and also that PAI for the first screen is also triggered. PAI of the first screen can also be potentially used.

3 REPLIES 3
Read only

Former Member
0 Likes
447

Checkout help on "Ranges".

Also, you can also try this.

In your PBO for the 2nd screen, insert values entered on 2nd screen to select options tables of the first screen. All select options are essentially tables. You can loop thru the select options table in Screen 2 and insert them into select options of the first screen. I would start by making sure that the PBO of the 2nd screen gets called when you close it, and also that PAI for the first screen is also triggered. PAI of the first screen can also be potentially used.

Read only

Former Member
0 Likes
446

Read this blog in order to save a dynpro as a variant...

[Save a variant from a Dynpro screen|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/6618] [original link is broken] [original link is broken] [original link is broken];

Greetings,

Blag.

Read only

rahulkavuri
Active Contributor
0 Likes
446
CALL FUNCTION 'RS_VARIANT_SAVE_FROM_SELSCREEN'
       EXPORTING
            CURR_REPORT          = SY-REPID
            VARI_REPORT          = SY-REPID
       IMPORTING
            VARIANT              = W_VARIANT
       TABLES
            P_SSCR               = T_SELCTAB
       EXCEPTIONS
            ILLEGAL_VARIANT_NAME = 1
            NOT_AUTHORIZED       = 2
            NO_REPORT            = 3
            REPORT_NOT_EXISTENT  = 4
            REPORT_NOT_SUPPLIED  = 5
            OTHERS               = 6.

Check the above code where the SY-REPID will be the name of your program.

W_VARIANT will be the name of the variant where you want the data to be saved...

To read the values on the second selection screen.. please use the DYNP_READ function module.. then fill T_SELCTAB

T_SELCTAB will have the variant contents .. this will be the main part for you as you have to fill the values in it by reading the values in Second Selection screen...( paramater and selection screen)

Write this code in PAI of Second Selection Screen