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 with simple chart

Former Member
0 Likes
429

Hi everyone. I've got a problem with ABAP charts. I need to place a simple chart in screen's container.

REPORT ZWOP_TEST4 .

  • Contain the constants for the graph type

TYPE-POOLS: GFW.

DATA: VALUES TYPE TABLE OF GPRVAL WITH HEADER LINE.

DATA: COLUMN_TEXTS TYPE TABLE OF GPRTXT WITH HEADER LINE.

DATA: ok_code LIKE sy-ucomm.

DATA: my_container TYPE REF TO cl_gui_custom_container.

REFRESH VALUES.

REFRESH COLUMN_TEXTS.

VALUES-ROWTXT = 'Salary'.

VALUES-VAL1 = 50000.

VALUES-VAL2 = 51000.

APPEND VALUES.

VALUES-ROWTXT = 'Life cost'.

VALUES-VAL1 = 49000.

VALUES-VAL2 = 51200.

APPEND VALUES.

COLUMN_TEXTS-COLTXT = '2003'.

APPEND COLUMN_TEXTS.

COLUMN_TEXTS-COLTXT = '2004'.

APPEND COLUMN_TEXTS.

  • Call a chart into a standard container, this function could be used

  • for many different graphic types depending on the presentation_type

  • field :

  • gfw_prestype_lines

  • gfw_prestype_area

  • gfw_prestype_horizontal_bars

  • gfw_prestype_pie_chart

  • gfw_prestype_vertical_bars

  • gfw_prestype_time_axis

CALL SCREEN '1000'.

CALL FUNCTION 'GFW_PRES_SHOW'

EXPORTING

CONTAINER = 'CONTAINER' "A screen with an empty

  • container must be defined

PRESENTATION_TYPE = GFW_PRESTYPE_LINES

TABLES

VALUES = VALUES

COLUMN_TEXTS = COLUMN_TEXTS

EXCEPTIONS

ERROR_OCCURRED = 1

OTHERS = 2.

&----


*& Module STATUS_1000 OUTPUT

&----


  • text

----


MODULE STATUS_1000 OUTPUT.

SET PF-STATUS 'GUI_1000'.

  • SET TITLEBAR 'xxx'.

IF my_container IS INITIAL.

CREATE OBJECT my_container

EXPORTING container_name = 'CONTAINER'.

ENDIF.

ENDMODULE. " STATUS_1000 OUTPUT

&----


*& Module USER_COMMAND_1000 INPUT

&----


  • text

----


MODULE USER_COMMAND_1000 INPUT.

ok_code = sy-ucomm.

CASE ok_code.

WHEN 'EXIT'.

LEAVE TO SCREEN 0.

ENDCASE.

ENDMODULE. " USER_COMMAND_1000 INPUT

I created a screen 1000 in SCREENPAINTER, named it 'CONTAINER'. Then I try to launch code above and nothing appears on the screen. Could You give me some tip?

2 REPLIES 2
Read only

Lakshmant1
Active Contributor
0 Likes
381

Hi Piotr,

Have a look at demo program GFW_PROG_BAR.

Also look at GRAL transaction for more example programs.

Hope this helps

Thanks

Lakshman

Read only

Former Member
0 Likes
381

Hi,

delete this lines:

IF my_container IS INITIAL.

CREATE OBJECT my_container

EXPORTING container_name = 'CONTAINER'.

ENDIF.

then it should work.

R