Skip to Content
author's profile photo Former Member
Former Member

ALV and refresh list

The following is the part of my program to generate a list, and then go to 2nd page to do the update, add or delete. After I am done with the update, I press the "back" button at application tool bar, and it brings back the 1st page of list. But the list show the content before the update. Anyone can tell me how to refresh the list? or if you can show me how to add a refresh button at the bottom of the list will work too. Thank you in advance.

FORM SHOW_NEWRECD.

refresh: itab, i_zmytable, myitab.

DATA: GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.

select * from zmytable into table itab

where fidocnum = ''.

*------- Field Catalogue

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = sy-repid

i_internal_tabname = 'ITAB'

i_inclname = sy-repid

CHANGING

ct_fieldcat = alvfc

EXCEPTIONS

inconsistent_interface = 1

program_error = 2

OTHERS = 3.

*----


Display

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

it_fieldcat = alvfc

i_callback_program = sy-repid

i_callback_user_command = 'ITAB_USER_COMMAND'

i_screen_start_column = 10

i_screen_start_line = 5

i_screen_end_column = 115

i_screen_end_line = 25

TABLES

t_outtab = itab

EXCEPTIONS

program_error = 1

OTHERS = 2.

ENDFORM. "SHOW_NEWRECD

*----


  • CALL BACK FORM

*----


FORM itab_user_command USING whatcomm TYPE sy-ucomm whatrow TYPE

slis_selfield.

READ TABLE itab INDEX whatrow-tabindex.

*----


Select Data

select * from zmytable into table myitab

where field1 = itab-field1

and field2 = itab-field2

and field3 = itab-field3

and field4 = itab-field4

and SAKNR = itab-saknr.

  • Another testing using screen

call screen 500.

ENDFORM. "ITAB_user_command

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Oct 18, 2006 at 12:45 AM

    If you are directly updating the DB in screen 500, it could b as easy as this. Re-reading the db into ITAB and refresh the grid.

    
    form itab_user_command using whatcomm type sy-ucomm whatrow type
    slis_selfield.
    
      read table itab index whatrow-tabindex.
    
    *--------- Select Data
      select * from zmytable into table myitab
      where field1 = itab-field1
      and field2 = itab-field2
      and field3 = itab-field3
      and field4 = itab-field4
      and saknr = itab-saknr.
    
    *** Another testing using screen
      call screen 500.
    
    <b>
      select * from zmytable into table itab
                where fidocnum = ''.
      whatrow-refresh = 'X'.
      whatrow-col_stable  = 'X'.
      whatrow-row_stable = 'X'.</b>
    
    
    endform. "ITAB_user_command
    
    

    REgards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.