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

problem in REFRESH button.

Former Member
0 Likes
1,750

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

9 REPLIES 9
Read only

Former Member
0 Likes
1,256

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.

Read only

0 Likes
1,256

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.

Read only

Former Member
0 Likes
1,256
*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.

Read only

0 Likes
1,256

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.

Read only

0 Likes
1,256

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

Read only

0 Likes
1,256

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.

Read only

Former Member
0 Likes
1,256

hi all,

i have heard of some functionality of ALV which refreshes the internal table passing to the ALV....

does anybody knows that??

Read only

0 Likes
1,256
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.

Read only

Former Member
0 Likes
1,256

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.