wd select options 20. this document helps you to · pdf filegenerated by jive on...
TRANSCRIPT
Generated by Jive on 2013-08-02+02:001
How to Use New Select-OptionsWD_SELECT_OPTIONS_20.
This Document helps you to create new Select-Options WD_SELECT_OPTIONS_20.
Product Version : SAP NetWeaver 7.0 Enhancement Package 3
SAP NetWeaver 7.3 Enhancement Package 1.
Please check sap help WD_SELECT_OPTIONS_20.
http://help.sap.com/erp_hcm_ias_2012_03/helpdata/en/f4/418d5173434a1ebea11c4c505543e3/content.htm?frameset=/en/0b/2e4531d2aa444c87238124d8a3e76e/frameset.htm
Step 1 : Go to se80->create webDdynpro component with initial view and window.
Step 2 : Go to Component ->Under used components tab->Use standard componentWD_SELECT_OPTIONS_20 under component and give component use name asSELECT_OPTIONS.
How to Use New Select-Options WD_SELECT_OPTIONS_20.
Generated by Jive on 2013-08-02+02:002
Step 3 : Go to view->view properties tab->click on controller usage and select yourselect_options create just now.
How to Use New Select-Options WD_SELECT_OPTIONS_20.
Generated by Jive on 2013-08-02+02:003
Step 4 : Go to View layout tab-> Create view container ui element.
How to Use New Select-Options WD_SELECT_OPTIONS_20.
Generated by Jive on 2013-08-02+02:004
Step 5: Go to windows->right click on viewcontainer->embed your select optionscomponent.
How to Use New Select-Options WD_SELECT_OPTIONS_20.
Generated by Jive on 2013-08-02+02:005
After Embeding Select options to view container it looks like below.
How to Use New Select-Options WD_SELECT_OPTIONS_20.
Generated by Jive on 2013-08-02+02:006
Step 6 : Go to view WDDOINIT method-> Go to code wizard-> Select Instantiate usedcomponent->Click F4 Select Select_options.
How to Use New Select-Options WD_SELECT_OPTIONS_20.
Generated by Jive on 2013-08-02+02:007
How to Use New Select-Options WD_SELECT_OPTIONS_20.
Generated by Jive on 2013-08-02+02:008
Step 7 : Go to code wizard->Select Method call in Used Controller->Select Component->Select Method INIT_SELECT_OPTIONS.
How to Use New Select-Options WD_SELECT_OPTIONS_20.
Generated by Jive on 2013-08-02+02:009
How to Use New Select-Options WD_SELECT_OPTIONS_20.
Generated by Jive on 2013-08-02+02:0010
Step 8 : Write code to add Attributes to Selection Screen.
Here Complete code in WDDOINIT method.
method WDDOINIT .
method ONACTIONGET .
How to Use New Select-Options WD_SELECT_OPTIONS_20.
Generated by Jive on 2013-08-02+02:0011
*-- Instantiate the used component --*
data lo_cmp_usage type ref to if_wd_component_usage. lo_cmp_usage = wd_this-
>wd_cpuse_select_options( ).
if lo_cmp_usage->has_active_component( ) is initial. lo_cmp_usage->create_component( ). endif.
*-- To call the method in the used controller --*
DATA lo_INTERFACECONTROLLER TYPE REF TO IWCI_WD_SELECT_OPTIONS_20 .
lo_INTERFACECONTROLLER = wd_this->wd_cpifc_select_options( ). DATA lv_sel_opt_handler TYPE ref toif_wd_select_options_20.
lv_sel_opt_handler = lo_interfacecontroller->init_select_options( ).
*-- Add Attributes to Selection Screen --*
DATA lt_attributes TYPE TABLE OF WDR_SO_S_ATTRIBUTES.
DATA ls_attributes TYPE WDR_SO_S_ATTRIBUTES.
DATA lt_initial_data TYPE TABLE OF WDR_SO_S_VALUES.
DATA ls_initial_data TYPE WDR_SO_S_VALUES.
ls_attributes-ATTRIBUTE = 'VBELN'.
ls_attributes-ATTR_TYPE = if_wd_select_options_20=>e_attribute_types-id. ls_attributes-TEXT = 'Sales
Document'. ls_attributes-dataelement = 'VBELN_VA'.
How to Use New Select-Options WD_SELECT_OPTIONS_20.
Generated by Jive on 2013-08-02+02:0012
APPEND ls_attributes TO lt_attributes.
ls_attributes-ATTRIBUTE = 'MATNR'.
ls_attributes-ATTR_TYPE = if_wd_select_options_20=>e_attribute_types-id. ls_attributes-TEXT =
'Material'. ls_attributes-dataelement = 'MATNR'.
APPEND ls_attributes TO lt_attributes.
lv_sel_opt_handler->add_attribute( EXPORTING attributes = lt_attributes ).
endmethod.
Step 8 : Go to view context->create node with attributes.
How to Use New Select-Options WD_SELECT_OPTIONS_20.
Generated by Jive on 2013-08-02+02:0013
Step 9 : Go to view layout create one action button, using wizard create table.
How to Use New Select-Options WD_SELECT_OPTIONS_20.
Generated by Jive on 2013-08-02+02:0014
Step 10 : Go to button on action, and write below code.
*-- To call the method in the used controller --*
method ONACTIONGET .
DATA lo_INTERFACECONTROLLER TYPE REF TO IWCI_WD_SELECT_OPTIONS_20 .
lo_INTERFACECONTROLLER = wd_this->wd_cpifc_select_options( ). DATA lv_sel_opt_handler TYPE
ref to if_wd_select_options_20. lv_sel_opt_handler = lo_interfacecontroller->init_select_options( ). DATA
lo_nd_n_vbap TYPE REF TO if_wd_context_node. DATA lt_n_vbap TYPE wd_this->Elements_n_vbap.
DATA lt_input TYPE TABLE OF WDR_SO_S_VALUES. DATA ls_input TYPE WDR_SO_S_VALUES.
DATA lt_vbeln TYPE TABLE OF RANGE_VBELN_VA_WA. DATA ls_vbeln TYPE RANGE_VBELN_VA_WA.
How to Use New Select-Options WD_SELECT_OPTIONS_20.
Generated by Jive on 2013-08-02+02:0015
DATA rs_vbeln TYPE RANGE_VBELN_VA_WA. DATA lt_matnr TYPE TABLE OF RANGE_MATNR. DATA
ls_matnr TYPE RANGE_MATNR. DATA rs_matnr TYPE RANGE_MATNR. DATA lt_range_ref TYPE TABLE
OF wdr_so_s_range_ref. DATA ls_range_ref TYPE wdr_so_s_range_ref. DATA : rt_vbeln TYPE REF TO
data, rt_matnr TYPE REF TO data. field-symbols: <fs_vbeln> TYPE table, <fs_matnr> TYPE
table.
*-- Read Data and as range table --* lv_sel_opt_handler->get_input_complete_as_range( importing range_ref= lt_range_ref ). LOOP AT lt_range_ref INTO ls_range_ref. CASE ls_range_ref-attribute. WHEN'VBELN'. rt_vbeln = ls_range_ref-range. WHEN 'MATNR'. rt_matnr = ls_range_ref-range. ENDCASE. ENDLOOP. assign rt_vbeln->* to <fs_vbeln>. loop at <fs_vbeln> into rs_vbeln. ls_vbeln-sign = rs_vbeln-sign. ls_vbeln-option = rs_vbeln-option . ls_vbeln-low = rs_vbeln-low. ls_vbeln-high = rs_vbeln-high. APPEND ls_vbeln TO lt_vbeln. endloop. assign rt_matnr->* to <fs_matnr>. loop at <fs_matnr> into rs_matnr. ls_matnr-sign = rs_matnr-sign. ls_matnr-option = rs_matnr-option . ls_matnr-low = rs_matnr-low. ls_matnr-high = rs_matnr-high. APPEND ls_matnrTO lt_matnr. endloop.*-- Select Query --* SELECT vbeln posnr matnr arktx zmengFROM VBAP INTO CORRESPONDING FIELDS OF TABLE lt_n_vbap WHERE vbeln INlt_vbeln AND matnr IN lt_matnr.
*-- Bind Table --** navigate from <CONTEXT> to <N_VBAP> via lead selection lo_nd_n_vbap = wd_context-
>get_child_node( name = wd_this->wdctx_n_vbap ). lo_nd_n_vbap->bind_table( lt_n_vbap ).
endmethod.
Output : Selection Screen.
How to Use New Select-Options WD_SELECT_OPTIONS_20.
Generated by Jive on 2013-08-02+02:0016
Give input to execute Selection criteria.
Output :
How to Use New Select-Options WD_SELECT_OPTIONS_20.
Generated by Jive on 2013-08-02+02:0017