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

ALV GRID REFRESH ISSUE!!!

Hello all,

I added a refresh button on my ALV display List.

It should bring the latest sales data.

This is how it was handled.

  • List Header for Top-Of-Page

PERFORM comment_build.

  • Fill the Field Catlog details

PERFORM fieldcat_init USING 'IT_ALV_HBOM'.

  • Modify the Field Catalog

PERFORM modify_fieldcat.

  • Fill the necessary events

PERFORM eventtab_build USING gt_events.

  • Sort Fields

PERFORM sort.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • i_buffer_active = 'X'

i_callback_program = g_repid

i_callback_pf_status_set = gc_status

i_callback_user_command = gt_user_command

is_layout = gs_layout

it_fieldcat = v_fieldcat[]

i_save = g_save

is_variant = gs_variant

it_events = gt_events[]

it_sort = it_sort

  • IMPORTING

  • e_exit_caused_by_caller = g_exit_caused_by_caller

  • es_exit_caused_by_user = gs_exit_caused_by_user

TABLES

t_outtab = p_table

EXCEPTIONS

program_error = 1

OTHERS = 2.

FORM user_command USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield .

case sy-ucomm.

when refresh.

select latest data from database.

and all call the ALv display again.

  • List Header for Top-Of-Page

PERFORM comment_build.

  • Fill the Field Catlog details

PERFORM fieldcat_init USING 'IT_ALV_HBOM'.

  • Modify the Field Catalog

PERFORM modify_fieldcat.

  • Fill the necessary events

PERFORM eventtab_build USING gt_events.

  • Sort Fields

PERFORM sort.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • i_buffer_active = 'X'

i_callback_program = g_repid

i_callback_pf_status_set = gc_status

i_callback_user_command = gt_user_command

is_layout = gs_layout

it_fieldcat = v_fieldcat[]

i_save = g_save

is_variant = gs_variant

it_events = gt_events[]

it_sort = it_sort

  • IMPORTING

  • e_exit_caused_by_caller = g_exit_caused_by_caller

  • es_exit_caused_by_user = gs_exit_caused_by_user

TABLES

t_outtab = p_table

EXCEPTIONS

program_error = 1

OTHERS = 2.

endcase.

endform.

PROBLEM I AM FACING IS ..

I get a display of ALV, but when i say BACK or CANCEL it goes to the previous list of ALV.

How do i over come this issue?

Regards,

Manohar E

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Nov 24, 2004 at 01:13 PM

    There is no need to call reuse again within your callback routine.

    Just change the field refresh of structure Structure RS_SELFIELD as described in the online help.

    Christian

    RS_SELFIELD contains the following information:

    tabname : Name of the internal output table

    tabindex : Index of the internal output table

    fieldname: Field name

    endsum : Cursor is located on the totals line

    sumindex : If >0, the cursor is located on a subtotals line

    value : Value of the field on the list

    refresh : (Exporting) List should be set up again

    Christian

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 24, 2004 at 01:07 PM

    Hi Manohar,

    You should not call FM 'REUSE_ALV_GRID_DISPLAY' for the second time. In the callback routine USER_COMMAND you should just set the field REFRESH of structure rs_selfield.

    Regards,

    John.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 24, 2004 at 01:35 PM

    Damn!!! that was easy isnt it:).

    Thnx i got it.

    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.