‎2008 Jan 23 8:50 AM
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?
‎2008 Jan 23 9:13 AM
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
‎2008 Jan 25 1:17 PM
Hi,
delete this lines:
IF my_container IS INITIAL.
CREATE OBJECT my_container
EXPORTING container_name = 'CONTAINER'.
ENDIF.
then it should work.
R