0

I have two dialogs, that one call another. To clarify what I mean, let's take a look at the first dialog:

enter image description here

As you can see on the screen, it contains ALV. When I click on the row, it will open the second dialog:
enter image description here

When I close the second dialog, I want to trigger PBO on the first is screen to do rerender ALV. How to archive it?

Update Code, that call the second screen:

  METHOD handle_double_click.

    FIELD-SYMBOLS <lt_task> TYPE STANDARD TABLE.
    FIELD-SYMBOLS <ls_task> TYPE any.
    FIELD-SYMBOLS <ls_clicked_data> TYPE any.

    DATA(lo_task_provider) = lcl_alv_task_provider=>get_instance( ).
    DATA(lt_task) = lo_task_provider->c_gt_data.

    ASSIGN lt_task->* TO <lt_task>.

    IF sy-subrc <> 0 OR <lt_task>[] IS INITIAL.
      RETURN.
    ENDIF.

    CREATE DATA lo_task_provider->c_gs_clicked_data LIKE LINE OF <lt_task>.
    ASSIGN lo_task_provider->c_gs_clicked_data->* TO <ls_clicked_data>.

    READ TABLE <lt_task> ASSIGNING <ls_task> INDEX e_row.
    <ls_clicked_data> = <ls_task>.

    zdp2_planning_split = me->fill_splitt_info( <ls_task> ).

    DATA(ls_planning_split_alv) = VALUE zdp2_planning_split_alv( matnr = zdp2_planning_split-matnr
                                                                 lfdat = zdp2_planning_split-lfdat
                                                                 sollmng = zdp2_planning_split-sollmng
                                                                 meins = zdp2_planning_split-meins ).
    DATA(lt_planning_split_alv) = VALUE zdp2_planning_split_alv_t( ).
    INSERT ls_planning_split_alv INTO TABLE lt_planning_split_alv.

    lcl_alv_split_provider=>get_instance( )->insert_data( lt_planning_split_alv ).

    CALL SCREEN '0100' STARTING AT 8 8.

  ENDMETHOD. 

Update

I think the pictures do not clarify what I mean. Now this should be better:

enter image description here

The first modal call the second modal. When the second modal get closed, then the ALV on the first screen should be refreshed. I can't refresh it, because the PBO on the first screen does not get executed after the second modal get closed.

4
  • Is the second dialog replace the first? Could you please attach the code that navigates from the first to the second?
    – Dorad
    Jan 8, 2019 at 7:47
  • The first does not replace the second dialog. I posted the code, where the second screen get called. Jan 8, 2019 at 7:50
  • Question also asked on SCN : answers.sap.com/questions/722555/… Jan 8, 2019 at 8:53
  • @zero_coding your latest update (Jan 8 at 14:22) reflects what I understood initially. Cf my answer (the PBO is not called but you can still update the alv grid; if you really want your pbo to be called then you can force the PAI/PBO to be triggered) Jan 11, 2019 at 15:39

2 Answers 2

1

I guess that the method HANDLE_DOUBLE_CLICK is triggered on event DOUBLE_CLICK of CL_GUI_ALV_GRID. This event only triggers a method, it doesn't start the PAI (consequently the PBO is not triggered too).

If you want to trigger the PAI, just add this line (you have to indicate a function code, here "ZZZ") :

cl_gui_cfw=>set_new_ok_code( new_code = 'ZZZ' ).

But instead, after CALL SCREEN, why don't you just refresh the ALV grid.

Assuming that you programmed the ALV grid with class CL_GUI_ALV_GRID, add this code :

" first update the internal table of the ALV
...

" transfer the internal table to the control, it also does an "update_view"
alv_grid->refresh_table_display( ).
0

You should not use CALL SCREEN '0100' STARTING AT 8 8.

Following is the sample code to call popup screen, when popup screen is close then you can write code to refresh first ALV screen data.

  TYPES: BEGIN OF alv_line,
             carrid   TYPE spfli-carrid,
             connid   TYPE spfli-connid,
             cityfrom TYPE spfli-cityfrom,
             cityto   TYPE spfli-cityto,
           END OF alv_line.
    DATA   alv_tab    TYPE TABLE OF alv_line.
    SELECT carrid, connid, cityfrom, cityto
           FROM spfli
           WHERE carrid = @carrid
           INTO CORRESPONDING FIELDS OF TABLE @alv_tab.
    IF sy-subrc <> 0.
      MESSAGE e007(sabapdemos).
    ENDIF.
    TRY.
        cl_salv_table=>factory(
          IMPORTING r_salv_table = DATA(alv)
          CHANGING  t_table = alv_tab ).
        alv->set_screen_popup( start_column = 1
                               end_column   = 60
                               start_line   = 1
                               end_line     = 12 ).
        alv->display( ).
      CATCH cx_salv_msg.
        MESSAGE 'ALV display not possible' TYPE 'I'
                DISPLAY LIKE 'E'.
    ENDTRY.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.