Probleme mit GFW Klassen

Die Objektorientierung mit ABAP®: Vererbung, Dynamische Programmierung, GUI Controls (u.a. ALV im OO).
1 Beitrag • Seite 1 von 1
1 Beitrag Seite 1 von 1

Probleme mit GFW Klassen

Beitrag von scanner (ForumUser / 9 / 0 / 0 ) »
Hallo

ich habe Tabelle mit Daten in einem Dynpro. Dort drücke ich einen Button und eine Grafik mit GFW wird aufgebaut. Klappt super! Wenn ich nun das Grafikdynpro schliesse und die Daten und der Tabelle verändere und die Grafik wieder aufrufe werden die neuen Daten nicht genommen. Nur wenn ich das Programm verlasse und dann die Daten ändere werden die Daten übernommen! Was muss ich tun damit ich bei erneutem Aufruf die geänderten Daten angezeigt bekomme??


Danke für die Hilfe !

Gruss
Arne

retval = cl_gfw=>ok.
* if dc_manage is initial.
*erstellen und initallieren des Datencontainers
CREATE OBJECT dc_inst.
if sy-subrc <> 0.
clear dc_inst.
else.

dc_manage = dc_inst.
call method dc_manage->init
IMPORTING
id = my_id_at_dc
retval = retval.
if retval <> cl_gfw=>ok.
clear dc_inst.
clear dc_manage.
else.
**kann man mit Daten füllen
endif.
endif.
* endif.

if retval <> cl_gfw=>ok.
call method cl_gfw=>show_msg
EXPORTING
msgno = retval.
endif.
*****ENDE Erstellen eines Datencontainers

*Dem Datencontainer mitteilen, das Änderungen der Daten der Grafik mitgeteilt werden
if not dc_manage is initial.
call method dc_manage->distribute_changes
IMPORTING
retval = retval.

if retval <> cl_gfw=>ok.
CALL METHOD cl_gfw=>show_msg
EXPORTING
msgno = retval.
endif.
endif.

*Aktivierung des Multiplexers
CALL METHOD cl_gfw_mux=>activate
IMPORTING
retval = retval.

*Überprüfen ob start des Multiplexers erfolgreich war
if retval <> cl_gfw=>ok.
CALL METHOD cl_gfw=>show_msg
EXPORTING
msgno = retval.
endif.

*Objekt Chart daten anlegen!
* IF Chart_Daten IS INITIAL.
CREATE OBJECT Chart_Daten.
* ENDIF.
*________________________________
*Daten für den Chart füllen
Loop at IT_erg_anz where selected ne 'X'.

read table it_erg into wa_erg index sy-tabix.
CALL METHOD Chart_Daten->fuellen
EXPORTING
DC_MANAGE = dc_manage
wa_data = wa_erg
IMPORTING
RETVAL = retval.
CALL METHOD Chart_Daten->fuellen_ogw
EXPORTING
DC_MANAGE = dc_manage
wa_data = wa_erg
IMPORTING
RETVAL = retval.
CALL METHOD Chart_Daten->fuellen_ugw
EXPORTING
DC_MANAGE = dc_manage
wa_data = wa_erg
IMPORTING
RETVAL = retval.

endloop.
*---------------------------------
*Container erzeugen

create object custom_container
exporting container_name = 'LINE_DIAGRAMM'.
*DEM Grafik-proxy die Attribute mitteilen
CREATE OBJECT GP_INST.
* create, initialize and activate graphics proxy
CREATE OBJECT GP_INST.
CALL METHOD GP_INST->IF_GRAPHIC_PROXY~INIT
EXPORTING DC = DC_INST
PARENT = CUSTOM_CONTAINER
prod_id = cl_gui_gp_pres=>co_prod_chart
IMPORTING RETVAL = RETVAL.
IF RETVAL = CL_GFW=>OK.
* set DC names
CALL METHOD GP_INST->SET_DC_NAMES
EXPORTING
OBJ_ID = 'OBJID'
DIM1 = 'X_VAL'
DIM2 = 'Y_VAL'
GRP_ID = 'GRPID'
IMPORTING RETVAL = RETVAL.
ENDIF. "// set dc names
*-------------------------------------------------------------
*setzen von customizing einstellungen

* set default display context
create object bundle_display exporting instance_id = 'GFWTA'.

* set background color
call method bundle_display->if_customizing~set
exporting attr_id = cl_cu_display_context=>co_bg_clr_plt_id
value = 18. " grey

** gitterraster
* call method bundle_display->if_customizing~set
* exporting attr_id = cl_cu_display_context=>co_visibility
* value = 1.

* disable lines
call method bundle_display->if_customizing~set
exporting attr_id = cl_cu_display_context=>co_bl_style
value = 1. " no line

* call method bundle_display->if_customizing~set
* exporting attr_id = cl_cu_display_context=>co_pt_alignment
* value = '4'.

* tell the proxy where to use the bundle
call method gp_inst->if_graphic_proxy~add_cu_bundle
exporting port = if_graphic_proxy=>co_port_diagram
bundle = bundle_display
importing retval = retval.



* drawing area (used to set chart title)
create object bundle_drawing exporting instance_id = 'GFWTAS'.

* set title
call method bundle_drawing->if_customizing~set
exporting attr_id = cl_cu_drawing_area=>co_title
value = uschrift.
*call method bundle_drawing->if_customizing~set
* exporting attr_id = cl_cu_drawing_area=>CO_LEGEND_CONTEXT
* value = 1.

* tell the proxy where to use the bundle
call method gp_inst->if_graphic_proxy~add_cu_bundle
exporting port = if_graphic_proxy=>co_port_chart
bundle = bundle_drawing
importing retval = retval.


*Für Chart 1************************************************
* values (group 1)
create object bundle_values1 exporting instance_id = 'GFWTA1'.

* prepare display context for values
create object bundle_display exporting instance_id = 'dummy'.

* set color of line and markers
call method bundle_display->if_customizing~set
exporting attr_id = cl_cu_display_context=>co_bl_clr_plt_id
value = 1. " schwarz
call method bundle_display->if_customizing~set
exporting attr_id = cl_cu_display_context=>co_mr_style
value = 2.
call method bundle_display->if_customizing~set
exporting attr_id = cl_cu_display_context=>co_mr_bg_clr_plt_id
value = 1.

* copy display context into values
call method bundle_values1->if_customizing~set
exporting attr_id = cl_cu_values=>co_curve_context
value = bundle_display.

* set chart type
call method bundle_values1->if_customizing~set
exporting attr_id = cl_cu_values=>co_style
value = 34. " xy scatter

* tell the proxy where to use the bundle
call method gp_inst->if_graphic_proxy~add_cu_bundle
exporting port = if_graphic_proxy=>co_port_chart
key = 'Mittelwert'
bundle = bundle_values1
importing retval = retval.

*Für unterer Grenzertwert************************************************
* values (group 1)
create object bundle_values1 exporting instance_id = 'GFWTA2'.

* prepare display context for values
create object bundle_display exporting instance_id = 'dummy'.

* set color of line and markers
call method bundle_display->if_customizing~set
exporting attr_id = cl_cu_display_context=>co_bl_clr_plt_id
value = 3. " rot
call method bundle_display->if_customizing~set
exporting attr_id = cl_cu_display_context=>co_mr_style
value = 0.
call method bundle_display->if_customizing~set
exporting attr_id = cl_cu_display_context=>co_mr_bg_clr_plt_id
value = 2.

* copy display context into values
call method bundle_values1->if_customizing~set
exporting attr_id = cl_cu_values=>co_curve_context
value = bundle_display.

* set chart type
call method bundle_values1->if_customizing~set
exporting attr_id = cl_cu_values=>co_style
value = 34. " xy scatter

* tell the proxy where to use the bundle
call method gp_inst->if_graphic_proxy~add_cu_bundle
exporting port = if_graphic_proxy=>co_port_chart
key = 'u.Grenzwert' "Name
bundle = bundle_values1
importing retval = retval.

**Für oberer Grenzertwert************************************************
* values (group 1)
create object bundle_values1 exporting instance_id = 'GFWTA3'.

* prepare display context for values
create object bundle_display exporting instance_id = 'dummy'.

* set color of line and markers
call method bundle_display->if_customizing~set
exporting attr_id = cl_cu_display_context=>co_bl_clr_plt_id
value = 7. " schwarz


call method bundle_display->if_customizing~set
exporting attr_id = cl_cu_display_context=>co_mr_style
value = 0.
call method bundle_display->if_customizing~set
exporting attr_id = cl_cu_display_context=>co_mr_bg_clr_plt_id
value = 2.

* copy display context into values
call method bundle_values1->if_customizing~set
exporting attr_id = cl_cu_values=>co_curve_context
value = bundle_display.

* set chart type
call method bundle_values1->if_customizing~set
exporting attr_id = cl_cu_values=>co_style
value = 34. " xy scatter

* tell the proxy where to use the bundle
call method gp_inst->if_graphic_proxy~add_cu_bundle
exporting port = if_graphic_proxy=>co_port_chart
key = 'o.Grenzwert' "Name
bundle = bundle_values1
importing retval = retval.


****X-ACHSE
* primary x-axis
create object bundle_axis_x exporting instance_id = 'GFWTA_X'.

* prepare display context for axis title
create object bundle_display exporting instance_id = 'dummy'.

* disable axis title
call method bundle_display->if_customizing~set
exporting attr_id = cl_cu_display_context=>co_bl_style
value = 1.

call method bundle_axis_x->if_customizing~set
exporting attr_id = cl_cu_axis=>co_title
value = 'Zähler'.
* enable scrollbar of axis and set view port

call method bundle_axis_x->if_customizing~set
exporting attr_id = cl_cu_axis=>CO_VISIBLE_CATEGORIES_AUTO
value = gfw_false.

call method bundle_axis_x->if_customizing~set
exporting attr_id = cl_cu_axis=>CO_VISIBLE_CATEGORIES
value = 7.

call method bundle_axis_x->if_customizing~set
exporting attr_id = cl_cu_axis=>CO_START_CATEGORY
value = 1.

.
* copy display context into axis
call method bundle_axis_x->if_customizing~set
exporting attr_id = cl_cu_axis=>co_title_context
value = bundle_display.
* tell the proxy where to use the bundle
call method gp_inst->if_graphic_proxy~add_cu_bundle
exporting port = if_graphic_proxy=>co_port_chart_x_prim_axis
bundle = bundle_axis_x
importing retval = retval.



* tell the proxy where to use the bundle
call method gp_inst->if_graphic_proxy~add_cu_bundle
exporting port = if_graphic_proxy=>co_port_chart_y_prim_axis
bundle = bundle_grid_y
importing retval = retval.



*Y_ACHSE---------------------------------------------------
* primary y-axis
create object bundle_axis_y exporting instance_id = 'GFWTA_Y'.

create object bundle_display exporting instance_id = 'dummy'.

call method bundle_display->if_customizing~set
exporting attr_id = cl_cu_display_context=>co_visibility
value = gfw_false.



*min range title
CALL METHOD BUNDLE_AXIS_Y->IF_CUSTOMIZING~SET
EXPORTING ATTR_ID = CL_CU_AXIS=>CO_MIN_RANGE_TITLE
VALUE = 'MIN'.
CALL METHOD BUNDLE_AXIS_Y->IF_CUSTOMIZING~SET
EXPORTING ATTR_ID = CL_CU_AXIS=>CO_MIN_RANGE_VALUE
VALUE = 400.
CALL METHOD BUNDLE_AXIS_Y->IF_CUSTOMIZING~SET
EXPORTING ATTR_ID = CL_CU_AXIS=>CO_RANGE_CONTEXT
VALUE = BUNDLE_DISPLAY.
* prepare display context for axis title
create object bundle_display exporting instance_id = 'dummy'.

* axis title
call method bundle_display->if_customizing~set
exporting attr_id = cl_cu_display_context=>co_bl_style
value = 1.

call method bundle_axis_y->if_customizing~set
exporting attr_id = cl_cu_axis=>co_title
value = wa_erg_anz-prueflosa.
* copy display context into axis
call method bundle_axis_y->if_customizing~set
exporting attr_id = cl_cu_axis=>co_title_context
value = bundle_display.

CALL METHOD GP_INST->IF_GRAPHIC_PROXY~ADD_CU_BUNDLE
EXPORTING PORT = IF_GRAPHIC_PROXY=>CO_PORT_CHART_Y_PRIM_AXIS
BUNDLE = BUNDLE_AXIS_Y
IMPORTING RETVAL = RETVAL.


IF RETVAL <> CL_GFW=>OK.
CALL METHOD GP_INST->IF_GRAPHIC_PROXY~FREE. "//ignore return value(keep 1st)
CALL METHOD dc_manage->FREE.
CLEAR GP_INST.
free gp_inst.
ELSE.
CALL METHOD GP_INST->IF_GRAPHIC_PROXY~ACTIVATE
IMPORTING RETVAL = RETVAL.

CALL METHOD dc_manage->FREE.
ENDIF.
IF RETVAL <> CL_GFW=>OK.
CALL METHOD CL_GFW=>SHOW_MSG EXPORTING MSGNO = RETVAL.
free gp_inst.
ENDIF.

gesponsert
Stellenangebote auf ABAPforum.com schalten
kostenfrei für Ausbildungsberufe und Werksstudenten


Seite 1 von 1

Vergleichbare Themen

8
Antw.
9063
Views
Architektur von Abap-Klassen (Klassen Attribute)
von snooze » 12.04.2005 12:56 • Verfasst in ABAP Objects®
20
Antw.
2677
Views
Globale Klassen oder Lokale Klassen
von ZF_SAPler » 29.11.2022 13:47 • Verfasst in ABAP® für Anfänger
9
Antw.
5445
Views
Lokale Klassen in globalen Klassen
von ralf.wenzel » 20.04.2020 22:55 • Verfasst in ABAP Objects®
1
Antw.
2055
Views
SAP HR Klassen
von Gast » 24.01.2005 13:41 • Verfasst in Human Resources
0
Antw.
1305
Views
Klassen als XML exportieren
von Michael.Nett » 21.12.2005 13:50 • Verfasst in ABAP® für Anfänger

Über diesen Beitrag

scanner
Unterstütze die Community und teile den Beitrag für mehr Leser und Austausch

Aktuelle Forenbeiträge

Dialog-Container mit Toolbar/Status
vor 10 Stunden von DeathAndPain gelöst 22 / 3007
Daten an Tabelle binden
vor 15 Stunden von Lukas Sanders 2 / 978
Zeilenumbrüche ersetzen
vor 2 Tagen von ralf.wenzel 6 / 543

Newsletter Anmeldung

Keine Beiträge verpassen! Wöchentlich versenden wir lesenwerte Beiträge aus unserer Community.
Die letzte Ausgabe findest du hier.
Details zum Versandverfahren und zu Ihren Widerrufsmöglichkeiten findest du in unserer Datenschutzerklärung.

Aktuelle Forenbeiträge

Dialog-Container mit Toolbar/Status
vor 10 Stunden von DeathAndPain gelöst 22 / 3007
Daten an Tabelle binden
vor 15 Stunden von Lukas Sanders 2 / 978
Zeilenumbrüche ersetzen
vor 2 Tagen von ralf.wenzel 6 / 543

Unbeantwortete Forenbeiträge

aRFC im OO-Kontext
vor 4 Wochen von ralf.wenzel 1 / 2558
Hilfe bei SWEC/SWE2
September 2024 von retsch 1 / 9137