2006 Jun 23 4:39 PM
Hi,
I want to refresh ALV grid after a CALL TRANSACTION stmt. If I change some data after call transaction and when I come back, I am still seeing old data even after using the refresh functions. But It works if I do one of the following.
1. Click explicitly on Refresh button after coming back from Call Transaction.
2. If I put a break-point after call transaction stmt and click on continue processing.
Please help me in this regard.
Regards
Kasi
2006 Jun 23 4:45 PM
Hi,
Give a WAIT 2 seconds , command after call transaction and then call REFRESH ALV. This command would help only if you are doing some database updates.
There could also be a possibility that REFRESH ALV is not getting triggered. You will have to debug to find whether refresh alv is getting triggered after call transaction.
Best regards,
Prashant
2006 Jun 23 4:44 PM
After the call transaction did you have something like this?
rs_selefield-refresh = 'X'.
Regards,
ravi
2006 Jun 23 4:45 PM
Hi,
Give a WAIT 2 seconds , command after call transaction and then call REFRESH ALV. This command would help only if you are doing some database updates.
There could also be a possibility that REFRESH ALV is not getting triggered. You will have to debug to find whether refresh alv is getting triggered after call transaction.
Best regards,
Prashant
2006 Jun 23 5:02 PM
2006 Jun 23 4:45 PM
2006 Jun 23 5:00 PM
Hi,
You have to explicitly do this....just check it, it will work.
REPORT ZTEST_ALV_CHECK message-id zz .
TYPE-POOLS: SLIS.
DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
L_LAYOUT type slis_layout_alv,
x_events type slis_alv_event,
it_events type SLIS_T_EVENT.
DATA: BEGIN OF ITAB OCCURS 0,
VBELN LIKE VBAK-VBELN,
POSNR LIKE VBAP-POSNR,
CHK(1),
END OF ITAB.
<b>perform get_data.</b>
X_FIELDCAT-FIELDNAME = 'CHK'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 1.
X_FIELDCAT-INPUT = 'X'.
X_FIELDCAT-EDIT = 'X'.
X_FIELDCAT-CHECKBOX = 'X'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-SELTEXT_L = 'VBELN'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 2.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-SELTEXT_L = 'POSNR'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 3.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
x_events-NAME = SLIS_EV_END_OF_PAGE.
x_events-FORM = 'END_OF_PAGE'.
APPEND x_events TO iT_EVENTS.
CLEAR x_events .
x_events-NAME = SLIS_EV_TOP_OF_PAGE.
x_events-FORM = 'TOP_OF_PAGE'.
APPEND x_events TO iT_EVENTS.
CLEAR x_events .
x_events-NAME = slis_ev_end_of_list.
x_events-FORM = 'END_OF_LIST'.
APPEND x_events TO iT_EVENTS.
CLEAR x_events .
<b>perform display_report.</b>
*&---------------------------------------------------------------------*
*& Form STATUS
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_EXTAB text
*----------------------------------------------------------------------*
FORM STATUS USING P_EXTAB TYPE SLIS_T_EXTAB.
*- Pf status
SET PF-STATUS 'STATUS'.
ENDFORM. " STATUS
*&---------------------------------------------------------------------*
*& Form USER_COMMAND
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->R_UCOMM text
* -->RS_SELFIELD text
*----------------------------------------------------------------------*
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
case r_ucomm.
when 'BACK' or 'CANC' or 'EXIT'.
leave to screen 0.
when '&IC1'.
if rs_selfield-fieldname = 'VBELN'.
set parameter id 'AUN' field rs_selfield-value.
call transaction 'VA02' and skip first screen.
<b> RS_SELFIELD-exit = 'X'.
perform get_data.
perform display_report.</b>
endif.
endcase.
ENDFORM. "USER_COMMAND
*&---------------------------------------------------------------------*
*& Form get_data
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM get_data .
SELECT VBELN
POSNR
FROM VBAP
UP TO 20 ROWS
INTO TABLE ITAB.
ENDFORM. " get_data
*&---------------------------------------------------------------------*
*& Form display_report
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM display_report .
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IS_LAYOUT = L_LAYOUT
I_CALLBACK_PF_STATUS_SET = 'STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IT_FIELDCAT = IT_FIELDCAT
it_events = it_events
TABLES
T_OUTTAB = ITAB
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.
ENDFORM. " display_reportObserve the Bold Code.
Regards
vijay
2020 Oct 16 8:01 AM
2006 Jun 23 5:04 PM
I have understood that it is timing problem. I gave a wait of 2 seconds after call transacation and it works fine now. Thanks for all who have responded to my query.
2006 Jun 23 5:09 PM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |