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: Trigonometric Functions in SAP Statistical Graphics



 
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:05 pm    Post subject: Demo: Trigonometric Functions in SAP Statistical Graphics Reply with quote

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.

OPTS = '$'.
WRITE P_TMP TO OPTS+1.
APPEND OPTS.
OPTS = 'COLOR=7'.
APPEND OPTS.
OPTS = 'THICK=1'.
APPEND OPTS.
OPTS = 'LTEXT='.
WRITE TEXT-COS TO OPTS+6.
APPEND OPTS.
OPTS = 'DTEXT='.
WRITE TEXT-LE1 TO OPTS+6.
APPEND OPTS.

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



CALL FUNCTION 'STAT_GRAPH'
     EXPORTING
          TTEXT      = TEXT-TIT
          UTEXT      = TEXT-UTI
          TAXIS      = TEXT-AXE
          X_ART      = 'LIN'
          Y_ART      = 'LIN'
          SCALE      = 'MAN'
          XRNGL      = X1
          XRNGU      = X2
          YRNGL      = Y1
          YRNGU      = Y2
          XTCKS      = '13'
          YTCKS      = '11'
          MAIL_ALLOW = 'x'
     TABLES
          OPTS       = OPTS
          DATA       = DATA.

*Text elements
*----------------------------------------------------------
* AXE Angle in degrees
* COS Cosinus curve
* LE1 cos(w)
* LE2 sin(w)
* LE3 sin(w)*cos(w)
* SIC Sinus / Cosinus curve
* SIN Sinus curve
* TIT Trigonometric functions
* UTI Sinus and cosinus


*Selection texts
*----------------------------------------------------------
* ANZAHL         Number of basic values
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.