‎2008 Mar 03 5:12 PM
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.
‎2008 Mar 03 5:53 PM
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.
‎2008 Mar 03 5:53 PM
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.
‎2008 Mar 03 7:07 PM
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.
‎2008 Mar 03 7:34 PM
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