Posted: Mon Nov 05, 2007 1:01 pm Post subject: Demo: Business Graphics Sales Comparison
Code:
*----------------------------------------------------------------------*
* Beispiel mit Aufruf SAP Businessgrafik ueber Funktionbaustein 290191*
*----------------------------------------------------------------------*
REPORT G_BUSG_3.
*----------------------------------------------------------------------*
* Tabelle mit dem einer Textspalte (Bezeichnung 3. Dimension) *
* und 6 * 5 Wertspalten (6 Werte fuer die 1., 5 Werte fuer die 2. Dim. *
* Eine Zeile entspricht jeweils einem Wert fuer die 3. Dimension *
*----------------------------------------------------------------------*
DATA: BEGIN OF DATA OCCURS 1,
TEXT(25),
Y1L1 TYPE P,
Y2L1 TYPE P,
Y3L1 TYPE P,
Y4L1 TYPE P,
Y5L1 TYPE P,
Y6L1 TYPE P,
Y1L2 TYPE P,
Y2L2 TYPE P,
Y3L2 TYPE P,
Y4L2 TYPE P,
Y5L2 TYPE P,
Y6L2 TYPE P,
Y1L3 TYPE P,
Y2L3 TYPE P,
Y3L3 TYPE P,
Y4L3 TYPE P,
Y5L3 TYPE P,
Y6L3 TYPE P,
Y1L4 TYPE P,
Y2L4 TYPE P,
Y3L4 TYPE P,
Y4L4 TYPE P,
Y5L4 TYPE P,
Y6L4 TYPE P,
Y1L5 TYPE P,
Y2L5 TYPE P,
Y3L5 TYPE P,
Y4L5 TYPE P,
Y5L5 TYPE P,
Y6L5 TYPE P,
END OF DATA.
*--- Optionen-Tabelle -------------------------------------------------*
DATA: BEGIN OF OPTS OCCURS 1,
C(80) TYPE C,
END OF OPTS.
DATA: TYEAR1(5) VALUE '#1988',
TYEAR2(5) VALUE '#1989',
TYEAR3(5) VALUE '#1990',
TYEAR4(5) VALUE '#1991'.
*----------------------------------------------------------------------*
* PF11: 2D-Graphik einer Zeile *
* Von der 3.Dimension (Lдnder) wird das 1. Objekt ausgewдhlt. *
*----------------------------------------------------------------------*
AT PF05. "1-Jahr
DATA: 2D_ROW VALUE '1'.
*--- Spaltentext-Tabelle ----------------------------------------------*
DATA: BEGIN OF TYEAR OCCURS 1,
C(20) TYPE C,
END OF TYEAR.
*--- Spaltenbezeichnung mit in den Titel aufnehmen --------------------*
CASE 2D_ROW.
WHEN '1'.
WRITE TPROD1 TO TITLE+7.
WHEN '2'.
WRITE TPROD2 TO TITLE+7.
WHEN '3'.
WRITE TPROD3 TO TITLE+7.
WHEN '4'.
WRITE TPROD4 TO TITLE+7.
WHEN '5'.
WRITE TPROD5 TO TITLE+7.
ENDCASE.
MOVE TYEAR1 TO TYEAR-C. APPEND TYEAR.
MOVE TYEAR2 TO TYEAR-C. APPEND TYEAR.
MOVE TYEAR3 TO TYEAR-C. APPEND TYEAR.
MOVE TYEAR4 TO TYEAR-C. APPEND TYEAR.
CALL FUNCTION 'GRAPH_MATRIX_2D'
EXPORTING
TITL = TITLE
VALT = 'DM'
NROW = 2D_ROW
MAIL_ALLOW = 'X'
TABLES
DATA = DATA
OPTS = OPTS
TCOL = TYEAR.
*----------------------------------------------------------------------*
* PF12: 2D-Graphik einer Spalte *
* Von der 3.Dimension (Lдnder) wird das 1. Objekt ausgewдhlt. *
*----------------------------------------------------------------------*
AT PF06. "1-Jahr
*--- Spaltenbezeichnung mit in den Titel aufnehmen --------------------*
CASE 2D_COL.
WHEN '1'.
WRITE TYEAR1 TO TITLE+7.
WHEN '2'.
WRITE TYEAR2 TO TITLE+7.
WHEN '3'.
WRITE TYEAR3 TO TITLE+7.
WHEN '4'.
WRITE TYEAR4 TO TITLE+7.
ENDCASE.
CALL FUNCTION 'GRAPH_MATRIX_2D'
EXPORTING
TITL = TITLE
VALT = 'DM'
NCOL = 2D_COL
MAIL_ALLOW = 'X'
TABLES
DATA = DATA
OPTS = OPTS
TCOL = TYEAR.
*----------------------------------------------------------------------*
* PF13: 3D-Graphik *
* Von der 3.Dimension (Lдnder) wird das 1. Objekt ausgewдhlt. *
*----------------------------------------------------------------------*
AT PF07. "3-Jahre
*--- Erstes Bild: 3D --------------------------------------------------*
WRITE 'FIFRST = 3D' TO OPTS-C. APPEND OPTS.
*--- Art der Faerbung: abhaengig von den Zeilen------------------------*
WRITE 'P3CTYP = RO' TO OPTS-C. APPEND OPTS.
CALL FUNCTION 'GRAPH_MATRIX_3D'
EXPORTING
TITL = TEXT-VGL
VALT = 'DM'
DIM1 = TEXT-J00
DIM2 = TEXT-P00
COL1 = TYEAR1
COL2 = TYEAR2
COL4 = TYEAR4
MAIL_ALLOW = 'X'
TABLES
DATA = DATA
OPTS = OPTS.
*----------------------------------------------------------------------*
* PF14: 3D-Graphik *
* Aufruf der 3D-Graphik mit nur einer Spalte fuehrt zu einem *
* automatischen Umschalten auf 2D-Graphik beim 1. Bild *
* Von der 3.Dimension (Lдnder) wird das 1. Objekt ausgewдhlt. *
*----------------------------------------------------------------------*
AT PF08. "3-Jahre
*--- Erstes Bild: 3D --------------------------------------------------*
WRITE 'FIFRST = 3D' TO OPTS-C. APPEND OPTS.
*--- Art der Faerbung: abhдngig von den Zeilen ------------------------*
WRITE 'P3CTYP = RO' TO OPTS-C. APPEND OPTS.
*--- 2D-Graphiktyp: Vertikale Balken ----------------------------------*
WRITE 'P2TYPE = VB' TO OPTS-C. APPEND OPTS.
CALL FUNCTION 'GRAPH_MATRIX_3D'
EXPORTING
TITL = TEXT-VGL
VALT = 'DM'
DIM1 = TEXT-J00
DIM2 = TEXT-P00
COL2 = TYEAR2
MAIL_ALLOW = 'X'
TABLES
DATA = DATA
OPTS = OPTS.
*----------------------------------------------------------------------*
* PF15: 4D-Graphik *
*----------------------------------------------------------------------*
AT PF09. "3-Jahre, mehrere L#nder
*--- Erstes Bild: Auswaehlen ------------------------------------------*
WRITE 'FIFRST = PU' TO OPTS-C. APPEND OPTS.
*--- 2D-Graphiktyp: Perspektivische Balken ----------------------------*
WRITE 'P2TYPE = TD' TO OPTS-C. APPEND OPTS.
*--- Art der Faerbung: gleichmaessig ----------------------------------*
WRITE 'P3CTYP = PL' TO OPTS-C. APPEND OPTS.
CALL FUNCTION 'GRAPH_MATRIX_4D'
EXPORTING
TITL = TEXT-VGL
VALT = 'DM'
DIM1 = TEXT-J00
DIM2 = TEXT-L00
DIM3 = TEXT-P00
DIM1_1 = TYEAR1
DIM1_3 = TYEAR2
DIM1_4 = TYEAR4
DIM2_2 = TEXT-L02
DIM2_3 = TEXT-L03
DIM2_4 = TEXT-L04
DIM2_5 = TEXT-L05
MAIL_ALLOW = 'X'
TABLES
DATA = DATA
OPTS = OPTS.
*----------------------------------------------------------------------*
* PF15: 4D-Graphik *
* Aufruf der 3D-Graphik mit nur einer Spalte fuehrt zu einem *
* automatischen Umschalten auf 2D-Graphik beim 1. Bild *
*----------------------------------------------------------------------*
*Text elements
*----------------------------------------------------------
* J00 Years
* L00 Countries
* L01 Germany
* L02 France
* L03 England
* L04 Italy
* L05 Spain
* P00 Products
* P01 Motors
* P02 Gear transmission
* P03 Tyres
* P04 Other
* P05 Repair
* UMS Sales
* VGL Sales comparison
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.