Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ALV doesn't go back

Former Member
0 Kudos

Hi Experts,

based on the SAP ALV example for "cl_salv_table" I wrote an ALV report. The first screen is for data selection. After this the ALV grid is displayed.

The problem is that the standard back button doesn't work as expected. So after clicking on "direct processing (F8)" in SE80 the selection screen is being opened. Here the back button works fine and it switches back to SE80.

When having selected some values and processed the report so the ALV grid is being displayed the click on back button results in an empty screen just with the title headline of the report. There I would expect the selection screen to be.

When clicking on the back button at this empty screen the report is being processed again and the ALV grid pops up. From there on its something like a endless loop: back to empty screen - back to ALV grid; back to empty screen - back to ALV grid; ...

The PF Status is defined. The OK-Code is defined. After clicking on the back button the standard PAI-Module is being loaded.

The following is the part where I declare the ALV grid:

TRY.
  cl_salv_table=>factory(
      EXPORTING
        list_display = IF_SALV_C_BOOL_SAP=>FALSE
      IMPORTING r_salv_table = alv
      CHANGING t_table = lt_report_tab ).

  alv->set_screen_status(
    pfstatus = 'MAIN'
    report = sy-repid
    set_functions = alv->c_functions_all ).

  alv_events = alv->get_event( ).
  create object event_handler.
  set handler event_handler->on_double_click for alv_events.

*  Set up selections.
  g_selections = alv->get_selections( ).
  g_selections->set_selection_mode( 1 ). "Single

  alv->display( ).
CATCH cx_salv_msg.
  MESSAGE 'ALV display was not possible' TYPE 'I' DISPLAY LIKE 'E'.
ENDTRY.

Any Ideas what could be wrong with my coding?

Many thanks in advance!

Best regards

Tobias

3 REPLIES 3

Former Member
0 Kudos

check by using the statement LEAVE TO SCREEN 0 whiile clicking the back button.

Former Member
0 Kudos

Hi Tobias,

What is the exact function code that you assigned to the back button in your GUI status ?

Nicolas

0 Kudos

The function code is: &F03

alternativley I already tried BACK with the same result.

Where shall I put the LEAVE TO SCREEN 0 when it's using the standard PAI Module which is NOT included within my Report?