Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Row freezing on ALV output #29

Open
stockbal opened this issue May 16, 2023 · 0 comments
Open

Row freezing on ALV output #29

stockbal opened this issue May 16, 2023 · 0 comments

Comments

@stockbal
Copy link
Member

Row freezing does not work correctly if the selected row index is greater than the number of visible rows.

Proposed solution

See class zcl_dbbr_output_grid

  METHOD change_fixed_rows.
    IF if_from_selection = abap_true.
      get_selected_rows( IMPORTING et_index_rows = DATA(lt_row) ).
      CHECK lt_row IS NOT INITIAL.
      get_first_visible_row( IMPORTING row = DATA(lv_first_visible_row) ).
      DATA(lv_selected_row) = CONV i( lt_row[ lines( lt_row ) ]-index ).
      set_fixed_rows( COND #(
        WHEN lv_first_visible_row = lv_selected_row OR lv_selected_row < lv_first_visible_row THEN
          lv_selected_row
        ELSE
          lv_selected_row - lv_first_visible_row ) ).
    ELSE.
      set_fixed_rows( iv_rows ).
    ENDIF.
  ENDMETHOD.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant