‎2006 Jun 14 8:08 AM
Hi Folks ,
i got a problem with ALV Grid .
here's the case :
i use an ALV grid inside tabstrip control .
when i going to first display the screen everything goes OK , but when i click on BACK button which says "leave to screen 0 " and afterwards comes again to the screen with the ALV Grid the remain as is and the screen shows non relevant data inside the grid .
when i leave to screen 0 i refresh the whole data of ALV Object by writing the free command .
i'll be thankfull if you guys have any idea about to olve this issue .
Thx .
‎2006 Jun 14 8:20 AM
Hi,
did you call this method to refresh the grid.
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.and in your BACK button
before calling leave to screen 0.
do this also..
when 'BACK'.
<b> CALL METHOD G_GRID1->FREE.
CALL METHOD G_CUSTOM_CONTAINER->FREE.
CALL METHOD CL_GUI_CFW=>FLUSH.</b>
leave to screen 0Regards
vijay
‎2006 Jun 14 8:15 AM
Herzel,
You can see same example if you can go through the below link.
http://www.sapgenie.com/abap/controls/alvgrid.htm
Hope this will help you.
rgds,
TM
‎2006 Jun 14 8:16 AM
Hi,
You have to refresh the display of your ALV grid. You can use CL_SALV_TABLE->REFRESH( ) method if you are using CL_SALV_TABLE.
If you change the settings for your output table, you may need to refresh the display. To do this, use the method REFRESH. To speed up the process, however, you do not absolutely have to rebuild the entire output table. You are able to choose between the following:
SOFT
This is the quickest way to refresh the display. You use it, for example, when you are only changing the sequence or selection of columns, but the number and sequence of the rows displayed remains the same.
FULL
You use this variant when you have also changed the metadata, forexample, when you have applied different sorting or another filter.
Parameters
S_STABLE
Optional
Rows and/or column position stay the same; Type LVC_S_STBL
REFRESH_MODE
Optional
Depth of refresh; Type SALV_DE_CONSTANT (IF_SALV_C_REFRESH)
Refresh Constant Value
No refresh NONE 0
Minimal refresh SOFT 1
Complete refresh FULL 2
Thanks and Regards,
Bharat Kumar Reddy.V
‎2006 Jun 14 8:20 AM
Hi,
did you call this method to refresh the grid.
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.and in your BACK button
before calling leave to screen 0.
do this also..
when 'BACK'.
<b> CALL METHOD G_GRID1->FREE.
CALL METHOD G_CUSTOM_CONTAINER->FREE.
CALL METHOD CL_GUI_CFW=>FLUSH.</b>
leave to screen 0Regards
vijay
‎2006 Jun 14 8:22 AM
Hi,
To refresh the display
Refresh the table if it has already been displayed
once.
CALL METHOD o_alvgrid->refresh_table_display
EXPORTING
i_soft_refresh = gc_true.
Sameena
‎2006 Jun 14 8:26 AM
Herzel Elmalme,
1.
Call this method before Leave to screen Statement.
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.
<b>Thanks,
Venkat.O</b>
‎2006 Jun 14 8:29 AM
Hi,
1. Try "Free".
IF DATA_GRID IS NOT INITIAL.
CALL METHOD DATA_GRID->free
EXCEPTIONS cntl_error = 1
cntl_system_error = 2.
FREE DATA_GRID. "** May be you forgot this statement**"
ENDIF. 2. If "Free" still doesn't work, Try "REFRESH".
IF DATA_GRID IS NOT INITIAL.
REFRESH <dyn_table>.
CALL METHOD DATA_GRID->refresh_table_display.
ENDIF.Regards,