ich habe zwei Dynpros! Dynpro 100 und 200. Auf Dynpro 100 zeige ich eine Liste mit Daten an. Drücke ich dort einen Button wird ein call screen 200 STARTING AT 20 1 ENDING AT 138 30.
ausgeführt und die Daten aus der Liste werden in einer Grafik angezeigt. Verlasse ich das Dynpro 200 mit dem Befehl leave to screen 0 komme zum Dypro 100 zurück und das neue Fenster wird geschlossen. Verändere ich nun die Daten in meiner Liste und rufe das Dynpro 200 wieder auf werden die geänderten Daten nicht in die Grafik übernommen.
Benutze ich allerdings zum verlassen des Dynpros 200 den Befehl leave to screen 100 wird das Fenster nicht geschlossen aber die Daten werden verändert in der Grafik angezeigt.
Wie schaffe ich es das Das Dynpro 200 geschlossen wird und die aktualisierten Daten aus Dynpro 100 in der Grafik angezeigt werden.
Im Dynpro 200 darf ggf. auch kein Foledynpro stehen. Solltest du mit ALV's arbeiten, muss ggf. ein Refresh der daten gamcht werden bzw. ein FLUSH an den GUI.
wie wird ein flush auf dem Gui gemacht? Wenn ich beim Verlassen von Dynpro 200 ein call schreen 100 mache funktioniert es ja! Nur dann schliesst sicht nicht das Modulare Fenster nicht sondern das Dynpro 100 erscheint in dem Modularen Fenster !
sorry ich meinte leave to screen 100 nicht call screen 100 ! nur wenn ich leave to screen 0 verwende wird die Grafik nicht aktualisiert! Bei leave to screen 100 schliesst sich das Modulare Fenster nicht
wenn das Folgedynpro im 200 leer ist und du einen leave screen machst, kommst du wieder in dein normales Dynpro 100. Im Dynpor 100 sollte im Folgedynpro auch nur 100 stehen und nicht 200.
Wenn du dein Dynpro 200 schließt, bist du wieder im Dynpro 100.
Wenn das die nicht weiter Hilft, solldest du vielleicht mal etwas Programm posten, damit man sieht wo der Fehler eventuell liegt.
Aufruf aus dynpro 100:
CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'.
call screen 200 STARTING AT 20 1
ENDING AT 138 30.
Code in Dynpro 200:
if not gp_inst is initial.
CLEAR GP_INST.
free gp_inst.
endif.
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.
*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'.
* 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.
* 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.
* 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.
* 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.
* 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.
* minor grid lines should be invisible
call method bundle_display->if_customizing~set
exporting attr_id = cl_cu_display_context=>co_visibility
value = gfw_false.
* copy display context into grid (for minor lines)
call method bundle_grid_x->if_customizing~set
exporting attr_id = cl_cu_grid=>co_minor_context
value = bundle_display.
* copy display context into grid (for major lines)
call method bundle_grid_x->if_customizing~set
exporting attr_id = cl_cu_grid=>co_MAJOR_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_grid_x
importing retval = retval.
***Y-ACHSE GRID
create object bundle_grid_y exporting instance_id = 'GFWTAYGRID'.
* prepare display context for grid
create object bundle_display exporting instance_id = 'dummy'.
* minor grid lines should be invisible
call method bundle_display->if_customizing~set
exporting attr_id = cl_cu_display_context=>co_visibility
value = gfw_false.
* copy display context into grid (for minor lines)
call method bundle_grid_y->if_customizing~set
exporting attr_id = cl_cu_grid=>co_minor_context
value = bundle_display.
* copy display context into grid (for major lines)
call method bundle_grid_y->if_customizing~set
exporting attr_id = cl_cu_grid=>co_MAJOR_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_y_prim_axis
bundle = bundle_grid_y
importing retval = retval.