Skip to Content
This is the second blog of 3 blogs series explaining how variants can be saved and retrieved for selection screens created in Webdynpro for ABAP. The first blog gave the outline of the process involved. This blog will focus on saving variants. Our example consists of one *Main *View having *two select options, one for customer and other for plant*.  It has 2 buttons, one to save variant and other to get variants.  There are 2 others views, *Save_Variant_1* ( for saving dialog) and other is *Get_Variant_1* ( for showing the list of available variants and let user choose one).The example WDA component will use *WDR_SELECT_OPTIONS* as used component. image The 3 following attributes are also added to all 3 views. *M_HANDLER* type ref to IF_WD_SELECT_OPTIONS ( to keep the instance of select option handler class)0.1. *RANGE_TABLE_CUST* type ref to data ( to keep range table of customer select option)0.1. *RANGE_TABLE_PLANT* type ref to data ( to keep range table of plant select option)On *WDDOINIT *method of Main View, the used component instance is created, the instance of the select options handler class is obtained and two select options (for customer and plant) are added on the selection screen. The code for this is as following. image 

code is executed on *OnAction* event.

image 

First, we get the values and options entered by user in customer and plant select options and store them in view attributes and then fire navigational outbound plug to navigate to SAVE_VARAINT_1 view along with the parameters.  The SAVE_VARAINT_1 view will accept Variant name, description and Global indicator. It will look like as following.

Save Variant viewimage

To report this post you need to login first.

3 Comments

You must be Logged on to comment or reply to a post.

  1. Vara K
    Sharad,
    Thank you very much for putting this wonderful blog.This is very much usefull for beginners like me .

    I just started my first WD and rying to implement variants now.

    I am stuck at fire_out_to_save_variant_plug .. in ONACTIONSAVE method.
    You haven’t mentioned about this and I am getting a error message “Method fire_out_to_save_variant_plug is unknown or protected or private.

    Could you please help me out ?

    Rgds
    Vara

    (0) 
  2. Ariel Fisher
    Hi.
    I’ve developped a new version based on your’s without the need to design an additional abap program.
    The parameters definition and select-options are taken from the WD application.
    (0) 

Leave a Reply