Online Tutorials & Training Materials | STechies.com
Register Login

Problem in Tab index when double click the ALV Grid

|| || 1

Problem in Tab index when double click the ALV Grid
Stechies

Hi All,

If i double click the ALV grid row say 11, the details are displayed.

After the list has been sorted in ascending manner thru layout or ascending button in appln. tool bar, the list get sorted and the row which said above 11th row is now 132 as per sorting.

What i need is, 132 if i double click it is not displaying anything.

Can u pls help in this regard.

code snippet is shown below.

CONSTANTS : l_c_ic1 TYPE char3 VALUE 'LTR'.

CHECK p_r_ucomm EQ '&IC1'.
READ TABLE gi_objlist_c INTO lwa_objlist_c INDEX p_rs_selfield-tabindex.
SET PARAMETER ID l_c_ic1 FIELD lwa_objlist_c-obj_name.
CHECK lwa_objlist_c IS NOT INITIAL.


CASE p_rs_selfield-fieldname.
WHEN 'LTRL'. "Prog Fugr Clas
*** Literals for Prog

regards


Comments

  • 08 Nov 2012 4:23 am
    Hi Shailesh

    I faced the similar issue and after hours of searching i finally got the solution.

    I found that everybody says that While sorting or using filter in ALV (through programatically or externaly) internal table used in ALV automatically gets sorted or filtered.

    But nobody has talked about the scope of internal table used for ALV.

    I was using routine (with TABLES) for all my ALV related coding while passing a global internal table.

    for example :

    PERFORM f_dis_alv TABLES git_itab

    and

    FORM f_disp_alv TABLES lit_itab like git_itab

    CALL METHOD cl_salv_table=>factory
    IMPORTING
    r_salv_table = gr_table
    CHANGING
    t_table = lit_itab.



    Now, when we sort or filter, table lit_table will not be changed unless you come out of the routine f_disp_alv.


    Solution
    ========


    I solved this problem by using the global internal table straight into the ALV.

    Like this..

    PERFORM f_dis_alv."TABLES git_itab <-- no need for this parameter

    and


    FORM f_disp_alv TABLES lit_itab like git_itab

    CALL METHOD cl_salv_table=>factory
    IMPORTING
    r_salv_table = gr_table
    CHANGING
    t_table = git_itab. "instead of lit_itab



    Hope this will help


    Regards
    Dharmesh Kumar