SELECT-OPTIONS: s_langu FOR sy-langu.

 

 

*$*$1

* Class definition

    METHODS:

      add_selection_conditions.

*$*$1

 

 

 

*$*$2

* In the method GENERATE_ALV

        me->add_selection_conditions( ).

*$*$2

 

 

 

*$*$3

* Class Implementation

  METHOD add_selection_conditions.

 

* Get condition factory

    DATA(lo_cond_factory) = o_salv_ida->condition_factory( ).

 

* Fixed range

    DATA(lt_fixed_ranges) = 

       VALUE if_salv_service_types=>yt_named_ranges(

          ( NAME = 'MSGNR' SIGN = 'I' OPTION = 'BT' LOW = '000' HIGH = '010'  )

       ).

 

* From Selection screen

    DATA(lo_ranges) = NEW cl_salv_range_tab_collector( ).

    lo_ranges->add_ranges_for_name( iv_name = 'SPRSL' it_ranges = s_langu[] ).

    lo_ranges->get_collected_ranges( 

       IMPORTING et_named_ranges = DATA(lt_name_range_pairs)  ).

 

* Final range

    APPEND LINES OF lt_fixed_ranges TO lt_name_range_pairs.

 

    o_salv_ida->set_select_options(

*   Ranges

      it_ranges = lt_name_range_pairs

 

*   condition object

      io_condition = 

        lo_cond_factory->equals( NAME = 'SPRSL' VALUE = sy-langu )->AND(

          lo_cond_factory->equals( NAME = 'ARBGB' VALUE = '00' )->OR(

            lo_cond_factory->equals( NAME = 'ARBGB' VALUE = '01' )

              )

          )

      ).

 

  ENDMETHOD.

*$*$3


Serkan AKKAVAK

Computer Engineer BSc

SAP Department Deputy Manager

Contact : serkurumsal@yandex.com