Escolar Documentos
Profissional Documentos
Cultura Documentos
Applies to:
SAP system with Web Dynpro functionality. For more information, visit the User Interface Technology
homepage.
Summary
As we are aware that there is no standard functionality in Web Dynpro for maintaining selection screen
variants as it is in ABAP. Here in this article, I have implemented custom logic to maintain selection screen
variants for following simple application. This logic can be applied to all Web Dynpro applications that use
selection screen.
Author Bio
Hi, I am Anand Kolte and I am working with Infosys from more than 3 years in SAP ABAP
technology. I got good exposure in SAP with variety of work in ABAP. I worked mainly on
Reports, FMs, Interfaces, BAPIs, User exits, SAP Scripts, performance analysis etc. As a
part of small development I also learned Web Dynpro and hence wanted to share my
knowledge on maintenance of variants in Web Dynpro through this document.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 1
Variant Maintenance for Selection Screen in Web Dynpro ABAP
Table of Contents
Step 1: Creating Web Dynpro Component ......................................................................................................... 3
Step 2: Creating Layout ...................................................................................................................................... 4
Step 3: Configuring Selection Screen ................................................................................................................. 5
Step 4: Creating Selection Screen ..................................................................................................................... 5
Step 5: Creating Custom Table .......................................................................................................................... 6
Step 6: Saving Variant ........................................................................................................................................ 7
Step 7: Loading Variant ...................................................................................................................................... 8
Step 8: Fetch Data ............................................................................................................................................ 10
Step 9: Demo! ................................................................................................................................................... 11
Related Content ................................................................................................................................................ 13
Disclaimer and Liability Notice .......................................................................................................................... 14
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 2
Variant Maintenance for Selection Screen in Web Dynpro ABAP
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 3
Variant Maintenance for Selection Screen in Web Dynpro ABAP
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 4
Variant Maintenance for Selection Screen in Web Dynpro ABAP
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 5
Variant Maintenance for Selection Screen in Web Dynpro ABAP
wd_this->m_wd_search =
wd_this->wd_cpifc_flight_selection( ).
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 6
Variant Maintenance for Selection Screen in Web Dynpro ABAP
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 7
Variant Maintenance for Selection Screen in Web Dynpro ABAP
EXPORTING
name = `VARIANT_NAME`
IMPORTING
value = lv_variant_name ).
ENDMETHOD.
-------------------------------------------------------------------------------------
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 8
Variant Maintenance for Selection Screen in Web Dynpro ABAP
EXPORTING
name = `VARIANT_NAME`
IMPORTING
value = lv_variant_name ).
lwa_key-prog_name = 'ZWD_VARIANT_TEST'.
lwa_key-vari_name = lv_variant_name.
lwa_key-uname = sy-uname.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 9
Variant Maintenance for Selection Screen in Web Dynpro ABAP
it_range_table = lt_valueset.
ENDMETHOD.
------------------------------------------------------------------------------------
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 10
Variant Maintenance for Selection Screen in Web Dynpro ABAP
Step 9: Demo!
DEMO TIME !!
Create a web dynpro application for our component and save it. After executing the application, we will get
following screen in Internet browser:
After executing the application we will get below screen:
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 11
Variant Maintenance for Selection Screen in Web Dynpro ABAP
We will populate some values in both the select options, give some variant name (‘test1’ in this case) in the
input field and hit SAVE button. This will save the user-specific variant in our table ZWDVARI.
Exit the application and run it once again. Now just give variant name (‘test1’ in this case) and hit LOAD
button. This will fetch the already saved variant from table ZWDVARI, extract the values for each select
option and then load those values back into selection fields.
On hitting the search button we will get below output:
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 12
Variant Maintenance for Selection Screen in Web Dynpro ABAP
Related Content
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/c09fec07-0dab-2a10-dbbe-c9a26bdff03e
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 13
Variant Maintenance for Selection Screen in Web Dynpro ABAP
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 14