Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

ALV grid refresh after user_command

Hi all,

i have a problem with my code, i use 2 alv grids in my code and sometimes i need to refresh the alv grids, the problem is that the method grid->REFRESH_TABLE_DISPLAY works only as long as the PAI of screen 100 is not triggerd, it means, when i click on something that has a function code and will cause the PAI of screen 100 to be triggered, i can no more change the alv grids, does any one know where the problem is? thanks in advance.
here is my code:

CALL SCREEN 100.

MODULE status_0100 OUTPUT.

SET PF-STATUS 'STATUS'.

SET TITLEBAR 'TITLE'.

IF init is initial.

CREATE OBJECT container

EXPORTING container_name = 'CUSTOM'.

CREATE OBJECT splitter

EXPORTING

parent = container

rows = 3

columns = 1.

CALL METHOD splitter->get_container

EXPORTING

row = 1

column = 1

RECEIVING

container = container_1.

CALL METHOD splitter->get_container

EXPORTING

row = 2

column = 1

RECEIVING

container = container_2.

CALL METHOD splitter->get_container

EXPORTING

row = 3

column = 1

RECEIVING

container = container_3.

CALL METHOD splitter->set_row_height

EXPORTING

id = 1

height = 57.

CALL METHOD splitter->set_row_height

EXPORTING

id = 3

height = 39.

CREATE OBJECT grid1

EXPORTING

i_parent = container_1.

CREATE OBJECT grid2

EXPORTING

i_parent = container_3.

CALL METHOD grid1->set_table_for_first_display

EXPORTING

I_SAVE = 'A'

I_DEFAULT = 'X'

I_STRUCTURE_NAME = 'TAB_1'

CHANGING

it_outtab = TAB1

it_fieldcatalog = T_FIELDALV

EXCEPTIONS

INVALID_PARAMETER_COMBINATION = 1

PROGRAM_ERROR = 2

TOO_MANY_LINES = 3

others = 4.

CALL METHOD grid2->set_table_for_first_display

EXPORTING

I_SAVE = 'A'

I_DEFAULT = 'X'

I_STRUCTURE_NAME = 'TAB_2'

CHANGING

it_outtab = TAB2

it_fieldcatalog = T_FIELDALV_2

EXCEPTIONS

INVALID_PARAMETER_COMBINATION = 1

PROGRAM_ERROR = 2

TOO_MANY_LINES = 3

others = 4.

CREATE OBJECT GR_EVENT_HANDLR.

SET HANDLER gr_event_handlr->handle_double_click FOR grid1.

CALL METHOD grid2->REFRESH_TABLE_DISPLAY.

ENDIF.

ENDMODULE.

MODULE user_command_0100 INPUT.

SAVE_OK = OK_CODE.

CLEAR OK_CODE.

CASE SAVE_OK.

WHEN 'BACK' OR 'CANCEL' OR 'EXIT'.

LEAVE TO SCREEN 0.

WHEN 'EXITPUSH'.

LEAVE TO SCREEN 0.

WHEN 'ADDPUSH'.

CALL SCREEN 200.

WHEN 'RADIO'.
IF r1 = 'X'.

PERFORM LOAD_GRID_TABLE1.

CALL METHOD grid1->REFRESH_TABLE_DISPLAY.

ENDIF.

IF r2 = 'X'

PERFORM LOAD_GRID_TABLE2.

CALL METHOD grid1->REFRESH_TABLE_DISPLAY.

ENDIF.

ENDCASE.

ENDMODULE.

MODULE user_command_0200 INPUT.

SAVE_OK = OK_CODE.

CLEAR OK_CODE.

CASE SAVE_OK.

WHEN 'BACK' OR 'CANCEL' OR 'EXIT'.

CLEAR ok_code.

LEAVE TO SCREEN 100.

ENDCASE.

ENDMODULE.

MODULE status_0200 OUTPUT.

SET PF-STATUS 'STATUS'.

SET TITLEBAR 'TITLE'.

ENDMODULE.

CLASS event_class IMPLEMENTATION.

METHOD handle_double_click.

READ TABLE TAB1 INTO T_TAB INDEX e_row-index.

SELECT ZINSURANCE~FAMILYMEMBER ZINSURANCE~DAMAGTYPE ZINSURANCE~VISITTYPE

ZINSURANCE~XDATE ZINSURANCE~PARATYPE ZINSURANCE~PAIDVAL ZINSURANCE~CONFIRMEDVAL ZINSURANCE~PUREVAL

ZINSURANCE~FRANSHIZ PA0002~VORNA PA0002~NACHN

FROM ZINSURANCE JOIN PA0002 ON ZINSURANCE~PERNR = PA0002~PERNR

INTO TABLE TAB2

WHERE ZINSURANCE~PERNR = T_TAB-PERNR

ORDER BY ZINSURANCE~XDATE.

CALL METHOD grid2->REFRESH_TABLE_DISPLAY.

ENDMETHOD.

ENDCLASS.

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question