Posted: Mon Nov 05, 2007 1:33 pm Post subject: Demo: Portfolio Graphics Presentation
Code:
REPORT GRPORT_0
NO STANDARD PAGE HEADING
LINE-SIZE 180.
*---------------------------------------------------------------------*
* DEKLARATIONSTEIL *
*---------------------------------------------------------------------*
* In dem Deklarationsteil werden die erforderlichen Tabellen *
* und Variablen deklariert *
*---------------------------------------------------------------------*
*** Druckaufbereitungsfelder *
DATA: PRINTPOS TYPE P, " *** Druckposition im Puffer
COLSIZE TYPE P, " *** Breite der Textspalte
PRINTBUFFER1(360), " *** Zeilenpuffer 1
PRINTBUFFER2(360). " *** Zeilenpuffer 2
DATA: TITLE1(160),
TITLE2(160).
DATA: RFELD TYPE P DECIMALS 2.
DATA: BEGIN OF SP_POS OCCURS 1,
POSITION TYPE P,
END OF SP_POS.
DATA: BEGIN OF SP_BR OCCURS 1,
BREITE TYPE P,
END OF SP_BR.
DATA: BEGIN OF AXIS OCCURS 4.
INCLUDE STRUCTURE GPOAXIS.
DATA: END OF AXIS.
DATA: BEGIN OF OBJT OCCURS 1. "// Objekt-Attibute
INCLUDE STRUCTURE GPOOBJT.
DATA: END OF OBJT.
DATA: BEGIN OF COL_TEXT OCCURS 1, "// Wertspalten
C(40),
END OF COL_TEXT.
DATA: BEGIN OF VALUES OCCURS 1, "// Objekt-Kennzahlen
P1 TYPE P DECIMALS 2,
P2 TYPE P DECIMALS 2,
P3 TYPE P DECIMALS 2,
P4 TYPE P DECIMALS 2,
P5 TYPE P DECIMALS 2,
P6 TYPE P DECIMALS 2,
P7 TYPE P DECIMALS 2,
P8 TYPE P DECIMALS 2,
P9 TYPE P DECIMALS 2,
END OF VALUES.
DATA: BEGIN OF FL_AXIS,
POS(10),
BACKCLR(20),
TEXTCLR(20),
SCALCLR(20),
SHADOW(1),
TICKS(10),
START(10),
END(10),
END OF FL_AXIS.
DATA: TREND_JN(1).
DATA: OBJEKTGR TYPE I.
DATA: XLOW TYPE P DECIMALS 2 VALUE 10000000,
YLOW TYPE P DECIMALS 2 VALUE 10000000,
XHIGH TYPE P DECIMALS 2 VALUE 0,
YHIGH TYPE P DECIMALS 2 VALUE 0.
*---------------------------------------------------------------------*
* PROGRAMMSTEUERUNG *
*---------------------------------------------------------------------*
* In der Programmsteuerung werden zunдchst die PF-Tasten *
* aktiviert, setzt die Attribute der Portfoliodarstellung *
* und zeigt das 1. Demo an. *
*---------------------------------------------------------------------*
*** Funktionstasten *
SET PF-STATUS 'PORT'.
*** Achsenattribute der *
*** rechten Achse *
*---------------------------------------------------------------------*
* INTERUPT-STEUERUNG *
*---------------------------------------------------------------------*
* Diese Routine ermittelt die gedrьckte Taste oder das *
* aktivierte Menь *
*---------------------------------------------------------------------*
*---------------------------------------------------------------------*
* FORM ANZEIGEN - LISTAUSGABE *
*---------------------------------------------------------------------*
* Diese Routine ermittelt die Spaltenbreiten und -position *
* anhand der Texttabelle und gibt die Datentabelle *
*---------------------------------------------------------------------*
*** Positionszeilen drucken
LOOP AT OBJT.
READ TABLE VALUES INDEX SY-TABIX. "*** paralleles Lesen der Werte
PRINTBUFFER1 = '....................'. "*** Vorfьllen der Druck-
PRINTBUFFER2 = '....................'. "*** puffer zur Lдngenbest.
WRITE OBJT-TITLE TO PRINTBUFFER2+0(20).
PRINTPOS = 0.
LOOP AT SP_POS.
READ TABLE SP_BR INDEX SY-TABIX.
PRINTPOS = SP_POS-position.
COLSIZE = SP_BR-breite.
CASE SY-TABIX.
WHEN 1.
WRITE VALUES-P1 TO PRINTBUFFER2+PRINTPOS(COLSIZE).
WHEN 2.
WRITE VALUES-P2 TO PRINTBUFFER2+PRINTPOS(COLSIZE).
WHEN 3.
WRITE VALUES-P3 TO PRINTBUFFER2+PRINTPOS(COLSIZE).
WHEN 4.
WRITE VALUES-P4 TO PRINTBUFFER2+PRINTPOS(COLSIZE).
WHEN 5.
WRITE VALUES-P5 TO PRINTBUFFER2+PRINTPOS(COLSIZE).
WHEN 6.
WRITE VALUES-P6 TO PRINTBUFFER2+PRINTPOS(COLSIZE).
WHEN 7.
WRITE VALUES-P7 TO PRINTBUFFER2+PRINTPOS(COLSIZE).
WHEN 8.
WRITE VALUES-P8 TO PRINTBUFFER2+PRINTPOS(COLSIZE).
WHEN 9.
WRITE VALUES-P9 TO PRINTBUFFER2+PRINTPOS(COLSIZE).
ENDCASE.
ENDLOOP.
WRITE:/ PRINTBUFFER2.
PRINTBUFFER2 = SPACE.
ENDLOOP.
ENDFORM.
*---------------------------------------------------------------------*
* FORM DEMO1 *
*---------------------------------------------------------------------*
* Dieses Demo versorgt die Portfoliografik mit Produktsparte, *
* Einzelprodukte und einer Segmentierung ьber Verpackungs- *
* arten *
*---------------------------------------------------------------------*
*---------------------------------------------------------------------*
* FORM DEMO2 *
*---------------------------------------------------------------------*
* Dieses Demo verfolg den Lebenszyklus zweier Produkte ьber *
* einen Zeitraum von mehreren Jahren *
*---------------------------------------------------------------------*
*---------------------------------------------------------------------*
* FORM DEMO3 *
*---------------------------------------------------------------------*
* Dieses Demo versorgt die Portfolio mit Angaben ьber den *
* Umsatz dreier Produkte mit Anzeige ьber den bereits *
* verbrauchten Werbeetat *
*---------------------------------------------------------------------*
*---------------------------------------------------------------------*
* FORM DEMO4 *
*---------------------------------------------------------------------*
* Dieses Demo versorgt die Portfolio mit Angaben ьber den *
* Umsatz dreier Produkte mit Anzeige ьber den bereits *
* verbrauchten Werbeetat *
*---------------------------------------------------------------------*
FORM DEMO4 TABLES OBJT STRUCTURE GPOOBJT
COL_TEXT
VALUES STRUCTURE VALUES
USING TITLE_TITLE TITLE_INFO.
DATA: RFELD1 TYPE P VALUE 12345.
DATA: RFELD2 TYPE P VALUE 23456.
DATA: RFELD3 TYPE P VALUE 0.
DATA: RFELD4 TYPE P VALUE 13557.
DATA: RFELD5 TYPE P VALUE 93751.
DATA: RFELD6 TYPE P VALUE 19753.
DATA: RFELD7 TYPE P VALUE 93751.
DATA: RFELD8 TYPE P VALUE 96751.
DATA: RFELD9 TYPE P VALUE 12653.
DATA: RFELD10 TYPE P VALUE 97751.
DATA: CFELD1(10).
DATA: BEGIN OF CFELD2,
FILLER1(2),
CFELD3(5),
FILLER2(2),
END OF CFELD2.
*---------------------------------------------------------------------*
* FORM ACHSEN_STANDARD_SETZTEN *
*---------------------------------------------------------------------*
* Diese Routine setzt die Standardwerte der in der Grafik *
* angezeigten Achsen *
*---------------------------------------------------------------------*
FORM ACHSEN_STANDARD_SETZTEN TABLES AXIS STRUCTURE GPOAXIS.
*** Achsenattribute der
*** rechten Achse
*---------------------------------------------------------------------*
* FORM PORTFOLIO_ANZEIGEN *
*---------------------------------------------------------------------*
* Ьbergabe der Parameter und Werte an die Grafikroutine *
* (Anzeigen der Grafik) *
*---------------------------------------------------------------------*
FORM PORTFOLIO_ANZEIGEN TABLES COL_TEXT AXIS OBJT VALUES.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.