Friday 13 March 2015

Enabling Selection Mode in Object Oriented ALV ( OO ALV )

Object Oriented ALV using CL_SALV_TABLE also provide the factility to the programmer to determine whether and in which situation the user can select areas of the ALV output .it is possible to programmatically determine which area needs to be selected and which areas are not required to select. The user can select multiple columns and multiple rows in an Object Oriented ALV .

Similar to all other ALV applications , in order to achive this functionality you need to follow only 2 steps :
Step 1 : Get the object reference of class CL_SALV_SELECTIONS by calling the method get_selections( ) of class CL_SALV_TABLE.
DATA : lo_selections TYPE REF TO cl_salv_selections.
lo_selections = lo_alv->get_selections( ).
STEP 2 : Call the set_selection_mode( ) method of class CL_SALV_SELECTIONS
CALL METHOD lo_selections->set_selection_mode
EXPORTING
value = if_salv_c_selection_mode=>multiple.
Please refer to the following source codes :

REPORT ztestr_alv_9.
TYPES : BEGIN OF gy_bseg,
bukrs TYPE bukrs,
belnr TYPE belnr_d,
gjahr TYPE gjahr,
buzei TYPE buzei,
wrbtr TYPE wrbtr,
END OF gy_bseg.
DATA : gt_bseg TYPE STANDARD TABLE OF gy_bseg INITIAL SIZE 1.
REFRESH : gt_bseg[].
SELECT bukrs belnr gjahr buzei wrbtr
FROM bseg
INTO TABLE gt_bseg
UP TO 10 ROWS.
IF sy-subrc IS INITIAL.
SORT gt_bseg BY bukrs belnr gjahr buzei .
ENDIF.
DATA : lo_alv TYPE REF TO cl_salv_table.
TRY.
CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = lo_alv
CHANGING
t_table = gt_bseg.
CATCH cx_salv_msg .
ENDTRY.
*-- Enabling Selection Mode logic starts
DATA : lo_selections TYPE REF TO cl_salv_selections.
lo_selections = lo_alv->get_selections( ).
CALL METHOD lo_selections->set_selection_mode
EXPORTING
value = if_salv_c_selection_mode=>multiple.
*-- Enabling Selection Mode logic end
lo_alv->display( ).

5 comments:

  1. This article is truly a fastidious one it assists new net
    people, who are wishing for blogging.

    My webpage: Louis Vuitton Handbags

    ReplyDelete
    Replies
    1. Sap Abap : Enabling Selection Mode In Object Oriented Alv ( Oo Alv ) >>>>> Download Now

      >>>>> Download Full

      Sap Abap : Enabling Selection Mode In Object Oriented Alv ( Oo Alv ) >>>>> Download LINK

      >>>>> Download Now

      Sap Abap : Enabling Selection Mode In Object Oriented Alv ( Oo Alv ) >>>>> Download Full

      >>>>> Download LINK 8L

      Delete
  2. Thanks for a great information in your blog. I have read all the post of your blog. Great work on sap abap.
    http://thecreatingexperts.com/sap-abap-training-in-chennai/

    ReplyDelete
  3. Thanks a lot, that one really handful OO implementation, without damn FM's/

    ReplyDelete
  4. Sap Abap : Enabling Selection Mode In Object Oriented Alv ( Oo Alv ) >>>>> Download Now

    >>>>> Download Full

    Sap Abap : Enabling Selection Mode In Object Oriented Alv ( Oo Alv ) >>>>> Download LINK

    >>>>> Download Now

    Sap Abap : Enabling Selection Mode In Object Oriented Alv ( Oo Alv ) >>>>> Download Full

    >>>>> Download LINK io

    ReplyDelete