SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Demo: Presentation Graphics 2D - 3D - 4D



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Dialog Programming -> Graphics
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Mon Nov 05, 2007 1:03 pm    Post subject: Demo: Presentation Graphics 2D - 3D - 4D Reply with quote

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'.

DATA: TPROD1(9),
      TPROD2(9),
      TPROD3(9),
      TPROD4(9),
      TPROD5(9).

TPROD1 = TEXT-P01.
TPROD2 = TEXT-P02.
TPROD3 = TEXT-P03.
TPROD4 = TEXT-P04.
TPROD5 = TEXT-P05.

DATA: TLAND1(20),
      TLAND2(20),
      TLAND3(20),
      TLAND4(20),
      TLAND5(20),
      TLAND6(20).

TLAND1 = TEXT-L01.
TLAND2 = TEXT-L02.
TLAND3 = TEXT-L03.
TLAND4 = TEXT-L04.
TLAND5 = TEXT-L05.
TLAND6 = TEXT-L06.

DATA: INDEX     LIKE  SY-INDEX.
DATA: MAXD(3)    TYPE  P.
DATA: TYP.

FIELD-SYMBOLS: <F>.

SET PF-STATUS 'GRAF'.

PERFORM FILL_DATA.
MAXD = MAX-D1 * MAX-D2.
*----------------------------------------------------------------------*
* Ausgabe einer Liste:                                                 *
* Fuer 5 Laender jeweils 4 Jahresspalten und 5 Produktzeilen           *
*----------------------------------------------------------------------*
WRITE: / TLAND1.
INDEX = 1.
PERFORM LISTE.
*----------------------------------------------------------------------*

SKIP.
ULINE.
WRITE: / TLAND2.
INDEX = MAXD + 1.
PERFORM LISTE.

*----------------------------------------------------------------------*

NEW-PAGE.
WRITE: / TLAND3.
INDEX = 2 * MAXD + 1.
PERFORM LISTE.

*----------------------------------------------------------------------*

SKIP.
ULINE.
WRITE: / TLAND4.
INDEX = 3 * MAXD + 1.
PERFORM LISTE.

*----------------------------------------------------------------------*

NEW-PAGE.
WRITE: / TLAND5.
INDEX = 4 * MAXD + 1.
PERFORM LISTE.

*----------------------------------------------------------------------*
SKIP.
ULINE.
WRITE: / TLAND6.
INDEX = 5 * MAXD + 1.
PERFORM LISTE.


*----------------------------------------------------------------------*
* 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.

  DATA-P = 153470.
  APPEND DATA.
  DATA-P = 243470.
  APPEND DATA.
  DATA-P = 124567.
  APPEND DATA.
  DATA-P = 179037.
  APPEND DATA.
  DATA-P = 234980.
  APPEND DATA.
  DATA-P = 287513.
  APPEND DATA.
  DATA-P = 253430.
  APPEND DATA.
  DATA-P = 223440.
  APPEND DATA.
  DATA-P =  24567.
  APPEND DATA.
  DATA-P = 180037.
  APPEND DATA.
  DATA-P = 129830.
  APPEND DATA.
  DATA-P = 145530.
  APPEND DATA.
  DATA-P = 132470.
  APPEND DATA.
  DATA-P = 453470.
  APPEND DATA.
  DATA-P =  24456.
  APPEND DATA.
  DATA-P = 119807.
  APPEND DATA.
  DATA-P = 288710.
  APPEND DATA.
  DATA-P = 166656.
  APPEND DATA.
  DATA-P = 300430.
  APPEND DATA.
  DATA-P = 723110.
  APPEND DATA.
  DATA-P =  22767.
  APPEND DATA.
  DATA-P = 195522.
  APPEND DATA.
  DATA-P =  38970.
  APPEND DATA.
  DATA-P =  89635.
  APPEND DATA.
  DATA-P = 166970.
  APPEND DATA.
  DATA-P = 401470.
  APPEND DATA.
  DATA-P =  29967.
  APPEND DATA.
  DATA-P = 112957.
  APPEND DATA.
  DATA-P =  37860.
  APPEND DATA.
  DATA-P =  77450.
  APPEND DATA.
  DATA-P = 253150.
  APPEND DATA.
  DATA-P = 343570.
  APPEND DATA.
  DATA-P = 768867.
  APPEND DATA.
  DATA-P = 236790.
  APPEND DATA.
  DATA-P = 122750.
  APPEND DATA.
  DATA-P = 328760.
  APPEND DATA.
  DATA-P = 292150.
  APPEND DATA.
  DATA-P = 356570.
  APPEND DATA.
  DATA-P = 268867.
  APPEND DATA.
  DATA-P =  36790.
  APPEND DATA.
  DATA-P = 125680.
  APPEND DATA.
  DATA-P = 178893.
  APPEND DATA.
  DATA-P = 333150.
  APPEND DATA.
  DATA-P = 373570.
  APPEND DATA.
  DATA-P = 168867.
  APPEND DATA.
  DATA-P = 226790.
  APPEND DATA.
  DATA-P = 278940.
  APPEND DATA.
  DATA-P = 177784.
  APPEND DATA.
  DATA-P = 234150.
  APPEND DATA.
  DATA-P = 296570.
  APPEND DATA.
  DATA-P = 233867.
  APPEND DATA.
  DATA-P =  16790.
  APPEND DATA.
  DATA-P = 125590.
  APPEND DATA.
  DATA-P = 208760.
  APPEND DATA.
  DATA-P = 113150.
  APPEND DATA.
  DATA-P = 388570.
  APPEND DATA.
  DATA-P = 565867.
  APPEND DATA.
  DATA-P = 211790.
  APPEND DATA.
  DATA-P = 277480.
  APPEND DATA.
  DATA-P = 277489.
  APPEND DATA.
  DATA-P = 53470.
  APPEND DATA.
  DATA-P = 321560.
  APPEND DATA.
  DATA-P = 452456.
  APPEND DATA.
  DATA-P = 174695.
  APPEND DATA.
  DATA-P = 277590.
  APPEND DATA.
  DATA-P = 177490.
  APPEND DATA.
  DATA-P = 153470.
  APPEND DATA.
  DATA-P = 467560.
  APPEND DATA.
  DATA-P = 222456.
  APPEND DATA.
  DATA-P = 198695.
  APPEND DATA.
  DATA-P =  99470.
  APPEND DATA.
  DATA-P = 100340.
  APPEND DATA.
  DATA-P = 11470.
  APPEND DATA.
  DATA-P = 323560.
  APPEND DATA.
  DATA-P = 434456.
  APPEND DATA.
  DATA-P = 224695.
  APPEND DATA.
  DATA-P = 277490.
  APPEND DATA.
  DATA-P = 467890.
  APPEND DATA.
  DATA-P = 953470.
  APPEND DATA.
  DATA-P =  67560.
  APPEND DATA.
  DATA-P = 298456.
  APPEND DATA.
  DATA-P =  98695.
  APPEND DATA.
  DATA-P = 577900.
  APPEND DATA.
  DATA-P = 199490.
  APPEND DATA.
  DATA-P = 18470.
  APPEND DATA.
  DATA-P = 390560.
  APPEND DATA.
  DATA-P = 411456.
  APPEND DATA.
  DATA-P =  94695.
  APPEND DATA.
  DATA-P = 182000.
  APPEND DATA.
  DATA-P = 260570.
  APPEND DATA.
  DATA-P = 367356.
  APPEND DATA.
  DATA-P = 231850.
  APPEND DATA.
  DATA-P = 436645.
  APPEND DATA.
  DATA-P = 346650.
  APPEND DATA.
  DATA-P =  82500.
  APPEND DATA.
  DATA-P = 300560.
  APPEND DATA.
  DATA-P = 467109.
  APPEND DATA.
  DATA-P = 161850.
  APPEND DATA.
  DATA-P = 356470.
  APPEND DATA.
  DATA-P = 198840.
  APPEND DATA.
  DATA-P = 199000.
  APPEND DATA.
  DATA-P = 340570.
  APPEND DATA.
  DATA-P = 127356.
  APPEND DATA.
  DATA-P = 591850.
  APPEND DATA.
  DATA-P = 287460.
  APPEND DATA.
  DATA-P = 299770.
  APPEND DATA.
  DATA-P =  12500.
  APPEND DATA.
  DATA-P = 230560.
  APPEND DATA.
  DATA-P = 437109.
  APPEND DATA.
  DATA-P = 191850.
  APPEND DATA.
  DATA-P =  36780.
  APPEND DATA.
  DATA-P =  78789.
  APPEND DATA.
  DATA-P = 282000.
  APPEND DATA.
  DATA-P = 270570.
  APPEND DATA.
  DATA-P = 567356.
  APPEND DATA.
  DATA-P =  31850.
  APPEND DATA.
  DATA-P = 92410.
  APPEND DATA.
  DATA-P = 121350.
  APPEND DATA.
  DATA-P = 67356.
  APPEND DATA.
  DATA-P = 431891.
  APPEND DATA.

ENDFORM.

*Text elements
*----------------------------------------------------------
* J00 Years
* L00 Countries
* L01 Germany
* L02 France
* L03 England
* L04 Italy
* L05 Spain
* L06 Netherlands
* P00 Products
* P01 Motors
* P02 Gear transmission
* P03 Tyres
* P04 Iron
* P05 Glass
* VGL Sales comparison
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Dialog Programming -> Graphics All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
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.