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

refresh screen .

herzelhaimharel_gilor
Participant
0 Likes
2,659

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 .

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,176

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 0

Regards

vijay

6 REPLIES 6
Read only

Former Member
0 Likes
1,176

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

Read only

Former Member
0 Likes
1,176

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

Read only

Former Member
0 Likes
1,177

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 0

Regards

vijay

Read only

Former Member
0 Likes
1,176

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

Read only

venkat_o
Active Contributor
0 Likes
1,176

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>

Read only

Former Member
0 Likes
1,176

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,