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

possible to use CL_GUI_TIMER in ABAP with a graph function?

Former Member
0 Likes
1,221

Hi!

Would like to display a graph using a standard FM and, when CL_GUI_TIMER signals time is up, close the graph and re-display with latest data .... I can't figure out how to close the current graph. Anyone know how to do this?

Thanks!

Jim

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,175

see this example

REPORT ZGRAPHS_3D.

TYPES: BEGIN OF ttab_data,

dataname(15),

quantity1 TYPE i,

quantity2 TYPE i,

quantity3 TYPE i,

END OF ttab_data.

TYPES: BEGIN OF ttab_options,

option(20),

END OF ttab_options.

DATA: itab_data TYPE TABLE OF ttab_data,

xtab_data LIKE LINE OF itab_data.

DATA: itab_options TYPE TABLE OF ttab_options,

xtab_options LIKE LINE OF itab_options.

xtab_data-dataname = 'Screws'.

xtab_data-quantity1 = 5500.

xtab_data-quantity2 = 6200.

xtab_data-quantity3 = 5900.

APPEND xtab_data TO itab_data.

xtab_data-dataname = 'Nails'.

xtab_data-quantity1 = 3500.

xtab_data-quantity2 = 5200.

xtab_data-quantity3 = 4400.

APPEND xtab_data TO itab_data.

xtab_data-dataname = 'Nuts'.

xtab_data-quantity1 = 1800.

xtab_data-quantity2 = 2200.

xtab_data-quantity3 = 1900.

APPEND xtab_data TO itab_data.

xtab_data-dataname = 'Fastners'.

xtab_data-quantity1 = 5500.

xtab_data-quantity2 = 6200.

xtab_data-quantity3 = 5900.

APPEND xtab_data TO itab_data.

xtab_data-dataname = 'Bolts'.

xtab_data-quantity1 = 3500.

xtab_data-quantity2 = 5200.

xtab_data-quantity3 = 4400.

APPEND xtab_data TO itab_data.

xtab_data-dataname = 'Clamps'.

xtab_data-quantity1 = 1800.

xtab_data-quantity2 = 2200.

xtab_data-quantity3 = 1900.

APPEND xtab_data TO itab_data.

xtab_data-dataname = 'Hand Tools'.

xtab_data-quantity1 = 5500.

xtab_data-quantity2 = 6200.

xtab_data-quantity3 = 5900.

APPEND xtab_data TO itab_data.

xtab_data-dataname = 'Saws'.

xtab_data-quantity1 = 3500.

xtab_data-quantity2 = 5200.

xtab_data-quantity3 = 4400.

APPEND xtab_data TO itab_data.

xtab_data-dataname = 'Jigs'.

xtab_data-quantity1 = 1800.

xtab_data-quantity2 = 2200.

xtab_data-quantity3 = 1900.

APPEND xtab_data TO itab_data.

CALL FUNCTION 'GRAPH_MATRIX_3D'

EXPORTING

titl = 'Usage in $'

col1 = 'Materials'

TABLES

data = itab_data

opts = itab_options.

Hi!

Would like to display a graph using a standard FM and, when CL_GUI_TIMER signals time is up, close the graph and re-display with latest data .... I can't figure out how to close the current graph. Anyone know how to do this?

Thanks!

Jim

7 REPLIES 7
Read only

Former Member
0 Likes
1,176

see this example

REPORT ZGRAPHS_3D.

TYPES: BEGIN OF ttab_data,

dataname(15),

quantity1 TYPE i,

quantity2 TYPE i,

quantity3 TYPE i,

END OF ttab_data.

TYPES: BEGIN OF ttab_options,

option(20),

END OF ttab_options.

DATA: itab_data TYPE TABLE OF ttab_data,

xtab_data LIKE LINE OF itab_data.

DATA: itab_options TYPE TABLE OF ttab_options,

xtab_options LIKE LINE OF itab_options.

xtab_data-dataname = 'Screws'.

xtab_data-quantity1 = 5500.

xtab_data-quantity2 = 6200.

xtab_data-quantity3 = 5900.

APPEND xtab_data TO itab_data.

xtab_data-dataname = 'Nails'.

xtab_data-quantity1 = 3500.

xtab_data-quantity2 = 5200.

xtab_data-quantity3 = 4400.

APPEND xtab_data TO itab_data.

xtab_data-dataname = 'Nuts'.

xtab_data-quantity1 = 1800.

xtab_data-quantity2 = 2200.

xtab_data-quantity3 = 1900.

APPEND xtab_data TO itab_data.

xtab_data-dataname = 'Fastners'.

xtab_data-quantity1 = 5500.

xtab_data-quantity2 = 6200.

xtab_data-quantity3 = 5900.

APPEND xtab_data TO itab_data.

xtab_data-dataname = 'Bolts'.

xtab_data-quantity1 = 3500.

xtab_data-quantity2 = 5200.

xtab_data-quantity3 = 4400.

APPEND xtab_data TO itab_data.

xtab_data-dataname = 'Clamps'.

xtab_data-quantity1 = 1800.

xtab_data-quantity2 = 2200.

xtab_data-quantity3 = 1900.

APPEND xtab_data TO itab_data.

xtab_data-dataname = 'Hand Tools'.

xtab_data-quantity1 = 5500.

xtab_data-quantity2 = 6200.

xtab_data-quantity3 = 5900.

APPEND xtab_data TO itab_data.

xtab_data-dataname = 'Saws'.

xtab_data-quantity1 = 3500.

xtab_data-quantity2 = 5200.

xtab_data-quantity3 = 4400.

APPEND xtab_data TO itab_data.

xtab_data-dataname = 'Jigs'.

xtab_data-quantity1 = 1800.

xtab_data-quantity2 = 2200.

xtab_data-quantity3 = 1900.

APPEND xtab_data TO itab_data.

CALL FUNCTION 'GRAPH_MATRIX_3D'

EXPORTING

titl = 'Usage in $'

col1 = 'Materials'

TABLES

data = itab_data

opts = itab_options.

Read only

0 Likes
1,175

The question is: How programitically close the graph?

Read only

kai_gutenkunst
Product and Topic Expert
Product and Topic Expert
0 Likes
1,175

Hi,

The solution is to use a different chart technology instead!

Currently you use one of those outdated GRAPH* function modules where the graphics is displayed in a separate window, right?

Instead use a chart control directly in your dynpro, i.e. avoid this extra window!

Have a look at this [blog|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/13313] [original link is broken] [original link is broken] [original link is broken]; where you can see how to create a chart control easily.

Using such a chart updating the data is trivial.

Regards, Kai

Read only

0 Likes
1,175

Thanks, Kai, this looks like the ticket!

Am having a problem though with the program in your blog:

test_ce_tables2xml can't be created without prefixing with 'Z' and then, when program is executed, the screen is blank.

Would you be good enough to point me in the right direction?

Thanks in advance,

Jim

Read only

0 Likes
1,175

Kai -

False alarm ... the problem was all mine and please just ignore my previous post.

You've 'transformed' my life!

Best!

Jim

Read only

kai_gutenkunst
Product and Topic Expert
Product and Topic Expert
0 Likes
1,175

And this was just a 'simple transformation'

Regards, Kai

Read only

0 Likes
1,175

Hello Kai,

Can you provide the solution of how this was resolved, possibly the code.

Thanks.