0

I'm using this code to refresh my ALV-Grid:

CALL METHOD go_alv->refresh_table_display
EXPORTING
  is_stable = is_stable.

go_alv is TYPE REF TO cl_gui_alv_grid.
is_stable is TYPE lvc_s_stbl and set like this:

is_stable-row = 'X'.
is_stable-col = 'X'.

This works with no problems when the Report is started in SE80. But when I open the Report using the T-Code I created for it in SE93, the Grid does get refreshed, but the is_stabale parameter is somehow ignored. As a result, the scroll position is reseted.

I tried playing around with the GUI Options in the TCODE, but it didn't work.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Kevin Mueller
  • 628
  • 3
  • 10
  • 23
  • It behaves the same whatever it's started via a report or via the transaction code. Something else differs. Run a SAT trace with no aggregation for both cases, and compare the traces to know when it starts to behave differently. – Sandra Rossi Mar 05 '19 at 13:34
  • I noticed that when I execute via tcode, after the PBO, following method is executed: `if_system_uuid_static~create_uuid_x16` in class `CL_SYSTEM_UUID)`. This does not happen when executed via se80. – Kevin Mueller Mar 05 '19 at 14:17
  • Nope. If you don't use SAT, another option is to add a break point at the constructor of `CL_GUI_ALV_GRID`, because I think you have 2 instances of the ALV grid. – Sandra Rossi Mar 05 '19 at 15:04
  • I tried it, only hit the break point once. – Kevin Mueller Mar 05 '19 at 15:17

1 Answers1

3

It behaves the same whatever it's started via a report or via a transaction code.

You can check by yourself with this little program, then create a transaction code running this program and check whether the problem still occurs. If not, then check what's different in your code. If you don't find any difference, simplify your code, or recreate a separate program and transaction code, etc., anything which can help you solve the issue.

TABLES sscrfields.
DATA go_alv TYPE REF TO cl_gui_alv_grid.
DATA gt_sflight TYPE TABLE OF sflight.
PARAMETERS dummy.
SELECTION-SCREEN FUNCTION KEY 1.

AT SELECTION-SCREEN OUTPUT.
  sscrfields-functxt_01 = 'Refresh'.
  IF go_alv IS INITIAL.
    CREATE OBJECT go_alv
      EXPORTING
        i_parent = cl_gui_container=>screen0.
    SELECT * FROM sflight INTO TABLE gt_sflight.
    go_alv->set_table_for_first_display(
        EXPORTING i_structure_name = 'SFLIGHT'
        CHANGING it_outtab = gt_sflight ).
  ENDIF.

AT SELECTION-SCREEN.
  IF sscrfields-ucomm = 'FC01'.
    DATA gs_sflight TYPE sflight.
    MODIFY gt_sflight FROM gs_sflight TRANSPORTING price currency WHERE price <> 0.
    DATA: ls_stbl TYPE lvc_s_stbl.
    ls_stbl-col = abap_true.
    ls_stbl-row = abap_true.
    DATA: l_soft  TYPE char01.
    l_soft = abap_true. " do not recalculate totals
    go_alv->refresh_table_display(
          EXPORTING
            is_stable       = ls_stbl
            i_soft_refresh  = l_soft  " default = false
          EXCEPTIONS
            finished = 1 ).
  ENDIF.

AT SELECTION-SCREEN ON EXIT-COMMAND.
  go_alv->free( ).
  FREE go_alv.
Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48