Posted: Mon Nov 05, 2007 1:03 pm Post subject: Demo: Presentation Graphics 2D - 3D - 4D
Code:
*----------------------------------------------------------------------*
* Beispiel mit Aufruf SAP Businessgrafik ueber Funktionbaustein 290191*
*----------------------------------------------------------------------*
REPORT GRBUSG_4.
DATA: BEGIN OF DATA OCCURS 1,
P TYPE P,
END OF DATA.
*--- Optionen-Tabelle -------------------------------------------------*
DATA: BEGIN OF OPTS OCCURS 1,
C(80) TYPE C,
END OF OPTS.
DATA: BEGIN OF TDIM1 OCCURS 1,
C(80) TYPE C,
END OF TDIM1.
DATA: BEGIN OF TDIM2 OCCURS 1,
C(80) TYPE C,
END OF TDIM2.
DATA: BEGIN OF TDIM3 OCCURS 1,
C(80) TYPE C,
END OF TDIM3.
DATA: BEGIN OF MAX OCCURS 1,
D1(3) TYPE P VALUE 4,
D2(3) TYPE P VALUE 5,
D3(3) TYPE P VALUE 6,
END OF MAX.
DATA: TYEAR1(5) VALUE '#1991',
TYEAR2(5) VALUE '#1992',
TYEAR3(5) VALUE '#1993',
TYEAR4(5) VALUE '#1994'.
*----------------------------------------------------------------------*
* PF05: 4D-Graphik, allgemeiner Funktionsbaustein *
*----------------------------------------------------------------------*
AT PF05.
REFRESH OPTS.
*--- 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.
*--- Dimension 1
REFRESH TDIM1.
MOVE TYEAR1 TO TDIM1.
APPEND TDIM1.
MOVE TYEAR2 TO TDIM1.
APPEND TDIM1.
MOVE SPACE TO TDIM1.
APPEND TDIM1.
MOVE TYEAR4 TO TDIM1.
APPEND TDIM1.
*--- Dimension 2
REFRESH TDIM2.
MOVE SPACE TO TDIM2.
APPEND TDIM2.
MOVE TPROD2 TO TDIM2.
APPEND TDIM2.
MOVE TPROD3 TO TDIM2.
APPEND TDIM2.
MOVE TPROD4 TO TDIM2.
APPEND TDIM2.
MOVE SPACE TO TDIM2.
APPEND TDIM2.
*--- Dimension 3
REFRESH TDIM3.
MOVE TLAND1 TO TDIM3.
APPEND TDIM3.
MOVE SPACE TO TDIM3.
APPEND TDIM3.
MOVE TLAND3 TO TDIM3.
APPEND TDIM3.
MOVE TLAND4 TO TDIM3.
APPEND TDIM3.
MOVE SPACE TO TDIM3.
APPEND TDIM3.
MOVE SPACE TO TDIM3.
APPEND TDIM3.
CALL FUNCTION 'GRAPH_MATRIX'
EXPORTING
TITL = TEXT-VGL
VALT = 'DM'
DIM1 = TEXT-J00
DIM2 = TEXT-P00
DIM3 = TEXT-L00
TABLES
DATA = DATA
TDIM1 = TDIM1
TDIM2 = TDIM2
TDIM3 = TDIM3
OPTS = OPTS.
*----------------------------------------------------------------------*
* PF06: 3D-Graphik, allgemeiner Funktionsbaustein *
*----------------------------------------------------------------------*
AT PF06.
REFRESH OPTS.
*--- 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.
*--- Dimension 1
REFRESH TDIM1.
MOVE TYEAR1 TO TDIM1.
APPEND TDIM1.
MOVE SPACE TO TDIM1.
APPEND TDIM1.
MOVE TYEAR3 TO TDIM1.
APPEND TDIM1.
MOVE TYEAR4 TO TDIM1.
APPEND TDIM1.
*--- Dimension 2
REFRESH TDIM2.
MOVE TPROD1 TO TDIM2.
APPEND TDIM2.
MOVE SPACE TO TDIM2.
APPEND TDIM2.
MOVE TPROD3 TO TDIM2.
APPEND TDIM2.
MOVE SPACE TO TDIM2.
APPEND TDIM2.
MOVE TPROD5 TO TDIM2.
APPEND TDIM2.
REFRESH TDIM3.
CALL FUNCTION 'GRAPH_MATRIX'
EXPORTING
TITL = TEXT-VGL
VALT = 'DM'
DIM1 = TEXT-J00
DIM2 = TEXT-P00
TABLES
DATA = DATA
TDIM1 = TDIM1
TDIM2 = TDIM2
TDIM3 = TDIM3
OPTS = OPTS.
*----------------------------------------------------------------------*
* PF07: 2D-Graphik, allgemeiner Funktionsbaustein *
*----------------------------------------------------------------------*
AT PF07.
REFRESH OPTS.
*--- 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.
*--- Dimension 1
REFRESH TDIM1.
MOVE TYEAR1 TO TDIM1.
APPEND TDIM1.
MOVE SPACE TO TDIM1.
APPEND TDIM1.
MOVE TYEAR3 TO TDIM1.
APPEND TDIM1.
MOVE TYEAR4 TO TDIM1.
APPEND TDIM1.
REFRESH TDIM2.
REFRESH TDIM3.
CALL FUNCTION 'GRAPH_MATRIX'
EXPORTING
TITL = TEXT-VGL
VALT = 'DM'
DIM1 = TEXT-J00
TABLES
DATA = DATA
TDIM1 = TDIM1
TDIM2 = TDIM2
TDIM3 = TDIM3
OPTS = OPTS.
*---------------------------------------------------------------------*
* FORM LISTE *
*---------------------------------------------------------------------*
* Die Routine gibt eine Liste mit Umsaetzen aus, die nach *
* Produkten und Jahren aufgeschluesselt sind. *
*---------------------------------------------------------------------*
FORM LISTE.
DATA: CNT_MOD LIKE SY-TABIX.
DATA: CNT_DIV LIKE SY-TABIX.
WRITE: / TEXT-P00,22 TYEAR1,39 TYEAR2,56 TYEAR3, 73 TYEAR4.
SKIP 2.
DO MAXD TIMES.
READ TABLE DATA INDEX INDEX.
IF SY-SUBRC NE 0. EXIT. ENDIF.
INDEX = INDEX + 1.
CNT_MOD = SY-INDEX MOD MAX-D1.
CNT_DIV = SY-INDEX DIV MAX-D1.
IF CNT_MOD EQ 1.
CASE CNT_DIV.
WHEN 0.
WRITE: / TPROD1, ' '.
WHEN 1.
WRITE: / TPROD2, ' '.
WHEN 2.
WRITE: / TPROD3, ' '.
WHEN 3.
WRITE: / TPROD4, ' '.
WHEN 4.
WRITE: / TPROD5, ' '.
ENDCASE.
ENDIF.
WRITE: DATA-P.
ENDDO.
ENDFORM.
*---------------------------------------------------------------------*
* FORM FILL_DATA *
*---------------------------------------------------------------------*
* Die Routine fuellt die Daten-Tabelle. *
*---------------------------------------------------------------------*
FORM FILL_DATA.
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.