2012 Sep 27 8:25 AM
I have generated a graph screen using a custom table. Now I want to AUTO REFRESH the same without any user interaction. Is it possible?
Please find the code I used:
REPORT ymoh_graphics.
TYPE-POOLS : slis.
DATA: BEGIN OF data OCCURS 1,
text(36), feld1 TYPE p,
END OF data,
BEGIN OF opts OCCURS 1,
c(80) TYPE c,
END OF opts,
BEGIN OF titl OCCURS 1,
text(256),
END OF titl,
BEGIN OF tyear OCCURS 1,
c(20) TYPE c,
END OF tyear.
DATA: BEGIN OF gt_ypick OCCURS 0.
INCLUDE STRUCTURE ypick.
DATA: END OF gt_ypick.
opts-c = 'P2TYPE = TO'.
APPEND opts.
opts-c = 'CLPALT = C'.
APPEND opts.
opts-c = 'P2ACLR = X'.
APPEND opts.
opts-c = 'TIFULL = X'.
APPEND opts.
opts-c = 'P2PCNT = X'.
APPEND opts.
titl-text = 'PICK STATUS TODAY'.
APPEND titl.
PERFORM get_data.
*&---------------------------------------------------------------------*
*& Form GET_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM get_data .
SELECT * FROM ypick INTO TABLE gt_ypick.
READ TABLE gt_ypick INDEX 1.
data-text = 'PENDING'.
data-feld1 = gt_ypick-pending.
APPEND data.
data-text = 'COMPLETED'.
data-feld1 = gt_ypick-completed.
APPEND data.
PERFORM rfc_wait.
CALL FUNCTION 'GRAPH_MATRIX_2D'
EXPORTING
titl = titl
* stat = 'R'
winszx = '500'
winszy = '500'
TABLES
data = data
opts = opts
tcol = tyear
EXCEPTIONS
col_invalid = 1
opt_invalid = 2
OTHERS = 3.
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. " GET_DATA
2012 Sep 27 10:23 AM
Hi Mohankumar,
Using the function GRAPH_MATRIX_2D will not allow to refresh it without any user interaction and that is because once fired this function saves the data "as is" at the time of generation, so even if you would loop on it, still the user will have to exit the graph window in order to refresh it.
Best,
Iftah
2012 Sep 27 10:23 AM
Hi Mohankumar,
Using the function GRAPH_MATRIX_2D will not allow to refresh it without any user interaction and that is because once fired this function saves the data "as is" at the time of generation, so even if you would loop on it, still the user will have to exit the graph window in order to refresh it.
Best,
Iftah