‎2008 Jul 16 7:52 AM
hi guys,
my refresh button is refreshing the alv grid after clicking it twice.....what could be the possible reason for the same.
FORM refresh USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'REFRESH'.
CASE sy-ucomm.
WHEN '&REFRESH'.
PERFORM update.
selfield-refresh = 'X'.
ENDCASE. "Copy of 'STANDARD' pf_status from fgroup SALV
form update.
SELECT *
FROM ztmt_ticket
INTO CORRESPONDING FIELDS OF TABLE it_zticket
WHERE ticketno IN so_tktno AND zsystem IN so_synam
AND zmodule3 IN p_sapm AND cus_sys IN p_sys
AND status IN p_tsta AND type IN p_ttyp
AND priority IN p_prty AND fun_con IN p_fun
AND abap_con IN p_abap AND rcd_dt IN p_trec
AND rtd_dt IN p_trat AND start_dt IN p_start
AND int_dt IN p_icomp AND res_dt IN p_res
AND comp_dt IN p_comp AND int_descr IN p_intd
AND ticket_descr IN p_desc
*This change is done to remove all tickets for which deletion indicator
*is set from report
AND del_ind NE 'X'.
gs_layout-zebra = 'X'.
IF sy-subrc = 0.
REFRESH it_ticket.
LOOP AT it_zticket.
MOVE it_zticket TO it_ticket.
APPEND it_ticket.
ENDLOOP.
ENDIF.
ENDFORM. " update
‎2008 Jul 16 7:59 AM
Hi saurabh,
1. In the subroutine update,
the code seems something wrong.
IF sy-subrc = 0.
REFRESH it_ticket. <----
LOOP AT it_zticket.
MOVE it_zticket TO it_ticket.
..
Endloop.
2. This Refresh statement clears the whole internal table,
in which the select query data comes in.
regards,
amit m.
‎2008 Jul 16 8:55 AM
hi ,
i am refreshing it_ticket because my new select query under refresh is getting data into it_zticket.
the data is all fine ...its getting refreshed also.
but the problem is that it is getting updated on doubleclicking of refresh button.
‎2008 Jul 16 9:01 AM
*REFRESH it_ticket.The above refresh Removes the content , then you will left with zero records in it_zticket, then what purpose you are looping it.
LOOP AT it_zticket.
MOVE it_zticket TO it_ticket.
APPEND it_ticket.
ENDLOOP.
‎2008 Jul 16 9:04 AM
hi
REFRESH it_ticket.
LOOP AT it_zticket.
MOVE it_zticket TO it_ticket.
APPEND it_ticket.
ENDLOOP.
from above code.....i am refreshing it_ticket and after that i am loooping it_zticket.
so again i am appending my new fetched table to the it_ticket which i have refreshed.
‎2008 Jul 16 9:05 AM
Hi Guys,
He is just refreshing it_ticket. and he is populating from it_zticket. Its fine
the problem is not with the logic.
This is really strange..
But i guess you are missing something in the progtam flow. where do you call this refresh subroutine?
Cheers
Kothand
‎2008 Jul 16 9:07 AM
ok , and one think are you using the Update in user_Command form or in PF-status form.
i can see that you included in PF-status form. or you showed it wrongly.
FORM USER_COMMAND using ucomm type sy-ucomm
selfield type slis_selfield.
CASE sy-ucomm.
WHEN '&REFRESH'.
PERFORM update.
selfield-refresh = 'X'.
ENDCASE. "Copy of 'STANDARD' pf_status from fgroup SALV
endform.
‎2008 Jul 16 9:21 AM
hi all,
i have heard of some functionality of ALV which refreshes the internal table passing to the ALV....
does anybody knows that??
‎2008 Jul 16 9:23 AM
selfield-refresh = 'X'.will show the updated content.
are you checking usercommand
Case sy-ucomm in side the user-command form or some where else.
‎2008 Jul 17 6:59 AM
hi all please see the bove code n tell me how to refresh the same
w_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = w_repid
i_callback_pf_status_set = 'PF_STATUS_SET'
*begin of addition by SND on 15072008
i_callback_pf_status_set = 'REFRESH'
*end of addition by SND on 15072008
i_callback_user_command = 'USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
is_layout = gs_layout
it_fieldcat = wa_fldcat1
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
it_event_exit = lt_event_exit
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = it_ticket
EXCEPTIONS
program_error = 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.
ENDIF.