Posted: Mon Nov 05, 2007 1:05 pm Post subject: Demo: Trigonometric Functions in SAP Statistical Graphics
Code:
*----------------------------------------------------------------------*
* Beispiel mit Aufruf der SAP-Statistik-Grafik ohne Dialog GL240991*
* temp-kommentar: STAT muss SILENT sein
*----------------------------------------------------------------------*
REPORT GRSTAT_1.
DATA: D TYPE F,
W TYPE F,
F TYPE F,
PI TYPE F.
DATA: BEGIN OF OPTS OCCURS 1,
C(80),
END OF OPTS.
DATA: BEGIN OF DATA OCCURS 1,
W TYPE P,
F TYPE F,
END OF DATA.
PARAMETER: ANZAHL(3) TYPE N DEFAULT 30.
PI = '3.14159' / 180.
D = 360 / ( ANZAHL - 1 ).
DO ANZAHL TIMES.
DATA-W = W.
DATA-F = COS( W * PI ).
APPEND DATA.
ADD D TO W.
ENDDO.
DATA P_TMP(6). "// GL 5.5.1993
UNPACK ANZAHL TO P_TMP.
W = 0.
DO ANZAHL TIMES.
DATA-W = W.
DATA-F = SIN( W * PI ).
APPEND DATA.
ADD D TO W.
ENDDO.
OPTS = '$'.
WRITE P_TMP TO OPTS+1.
APPEND OPTS.
OPTS = 'COLOR=4'.
APPEND OPTS.
OPTS = 'THICK=1'.
APPEND OPTS.
OPTS = 'LTEXT='.
WRITE TEXT-SIN TO OPTS+6.
APPEND OPTS.
OPTS = 'DTEXT='.
WRITE TEXT-LE2 TO OPTS+6.
APPEND OPTS.
W = 0.
DO ANZAHL TIMES.
DATA-W = W.
DATA-F = COS( W * PI ) * SIN( W * PI ).
APPEND DATA.
ADD D TO W.
ENDDO.
OPTS = '$'.
WRITE P_TMP TO OPTS+1.
APPEND OPTS.
OPTS = 'C_ART=1'.
APPEND OPTS.
OPTS = 'CTYPE=4'.
APPEND OPTS.
OPTS = 'COLOR=3'.
APPEND OPTS.
OPTS = 'LTEXT='.
WRITE TEXT-SIC TO OPTS+6.
APPEND OPTS.
OPTS = 'DTEXT='.
WRITE TEXT-LE3 TO OPTS+6.
APPEND OPTS.
*----------------------------------------------------------------------*
* Graphische Ausgabe *
*----------------------------------------------------------------------*
DATA X1 TYPE F VALUE '0'.
DATA X2 TYPE F VALUE '360'.
DATA Y1 TYPE F VALUE '-1.0'.
DATA Y2 TYPE F VALUE '1.0'.
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.