Application Development and Automation 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: 
Read only

clear alv container

Former Member
0 Likes
7,492

HI,

I am displaying my ALV grid in subscreen,i am using CALL METHOD g_alv_grid->set_table_for_first_display,it is working fine for first time but when user is changing input in first subscreen ,and click push button to call ALV grid in 2nd subscreen it is displaying previous records.how to clear the container ,I tried CALL METHOD g_alv_grid->refresh_table_display.but no result,

4 REPLIES 4
Read only

Former Member
2,384

In the End-of-selection event, use:

CALL METHOD g_alv_grid->free.

CLEAR g_alv_grid.

This should clear the contents of the ALV.

Reward Points, if ur query is resolved.

Rgds

Subbu

Read only

Former Member
0 Likes
2,384

i think you have to clear the instance of class CL_GUI_CUSTOM_CONTAINER.

call method FREE of CL_GUI_CUSTOM_CONTAINER.

Message was edited by: Sharath kumar R

Read only

Former Member
0 Likes
2,384

Hi,

that means the problem is not with the REFRESH. since you are editing the grid the values are not updated to frontend. did you call this method in the PAI of the screen if not call this and try.

MODULE PAI INPUT.
  CALL METHOD G_GRID->CHECK_CHANGED_DATA
    IMPORTING
      E_VALID = L_VALID.
  CALL METHOD CL_GUI_CFW=>FLUSH.
  CALL METHOD CL_GUI_CFW=>DISPATCH.
okcode hadnlings here...
.....
....
...
  CALL METHOD G_GRID->REFRESH_TABLE_DISPLAY
    EXCEPTIONS
      FINISHED = 1
      OTHERS   = 2.
  IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
ENDMODULE.                    "pai INPUT 

Regards

vijay

Read only

Former Member
0 Likes
2,384

Hi vinod,

after this method

CALL METHOD g_alv_grid->set_table_for_first_display

just write this

CALL METHOD g_alv_grid->refresh_table_display.

For more clarifications chk program BCALV_GRID_07 , line no 312