cancel
Showing results for 
Search instead for 
Did you mean: 

Select Options use in ALV Report in ABAP Webdynpro

Former Member
0 Kudos

Hello Experts,

I Already Done ALV Report In webdynpro with use of view Container UI element.But i do not know ALV  report with help of select option.so

Kindly Give Me simple Example of Use in select Option In ALV.

Reply ASAP.

Regards,

Ameya Karadkhedkar

Accepted Solutions (1)

Accepted Solutions (1)

bustamantejt
Explorer
0 Kudos

First you need to add the component WDR_SELECT_OPTIONS to the tab "Used components" of your Web Dynpro component and then also in the properties tab of your view. In the layout you need to create another view container and embed the view WND_SELECTION_SCREEN of the new used component to it.

Then in the WDDOINIT method of your view you can write this code (where SEL_OPT is the given name for the used component) in order to set the select option (This example is a select option for a date):


DATA: lo_cmp_usage           TYPE REF TO if_wd_component_usage,

      lo_interfacecontroller TYPE REF TO iwci_wdr_select_options,

      lo_r_helper_class      TYPE REF TO if_wd_select_options,

      rt_range_date          TYPE REF TO data.

* Instantiate used component WDR_SELECT_OPTIONS (SEL_OPT)

lo_cmp_usage = wd_this->wd_cpuse_sel_opt( ).

IF lo_cmp_usage->has_active_component( ) IS INITIAL.

  lo_cmp_usage->create_component( ).

ENDIF.

* Call method in used controller

lo_interfacecontroller = wd_this->wd_cpifc_sel_opt( ).

lo_r_helper_class = lo_interfacecontroller->init_selection_screen( ).

* Create select option for the date

CALL METHOD lo_r_helper_class->create_range_table

  EXPORTING

    i_typename    = 'DATS'

  RECEIVING

    rt_range_table = rt_range_date.

CALL METHOD lo_r_helper_class->add_selection_field

  EXPORTING

    i_id          = 'DATS'

    it_result     = rt_range_date

    i_read_only   = ABAP_FALSE.

* Hide unnecessary buttons

CALL METHOD lo_r_helper_class->set_global_options

  EXPORTING

    i_display_btn_cancel  = abap_false

    i_display_btn_check   = abap_false

    i_display_btn_reset   = abap_false

    i_display_btn_execute = abap_false.

Finally you need to write the following code in the action of the button in order to fetch the range table selected by the user.


DATA: lo_cmp_usage            TYPE REF TO if_wd_component_usage,

      lo_interfacecontroller  TYPE REF TO iwci_wdr_select_options,

      lo_r_helper_class       TYPE REF TO if_wd_select_options,

      rt_date                 TYPE REF TO data.

FIELD-SYMBOLS: <fs_date> TYPE table.

* Instantiate used component WDR_SELECT_OPTIONS (SEL_OPT)

lo_cmp_usage = wd_this->wd_cpuse_sel_opt( ).

IF lo_cmp_usage->has_active_component( ) IS INITIAL.

  lo_cmp_usage->create_component( ).

ENDIF.

* Call method in used controller

lo_interfacecontroller = wd_this->wd_cpifc_sel_opt( ).

lo_r_helper_class = lo_interfacecontroller->init_selection_screen( ).

* get selected range of inspections date

CALL METHOD lo_r_helper_class->get_range_table_of_sel_field

  EXPORTING

    i_id          = 'DATS'

  RECEIVING

    rt_range_table = rt_date.

ASSIGN rt_date->* TO <fs_date>.

Then you can use the value that is assigned to the field symbol <fs_date> to continue with your ALV.

Former Member
0 Kudos

Hi Tomas Bustamante,

Thanks. For quick and easy useful reply..Problem Solved...

Thnaks&Regards,

Ameya Karadkhedkar

Answers (2)

Answers (2)

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi,

You need to use two VC UI elements

1)Select options ( component to be used is WDR_SELECT_OPTIONS)

2)ALV Table ( component to be used is SALV_WD_TABLE).

Thanks

KH

Former Member
0 Kudos

Hello katrice Hawkins,

Kindly Explain With help of Example how should i write a code in select option component? in which method? kindly eleborate me with simple example..

thanks&regards,

Ameya Karadkhedkar