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

Code:
*----------------------------------------------------------------------*
* Beispiel mit SAP Statistik Grafik                           Bui010791*
*----------------------------------------------------------------------*
REPORT GRSTAT_2.

DATA: D  TYPE F,
      W  TYPE F,
      F  TYPE F,
      X  TYPE F,
      PI TYPE F,
      STEP TYPE F.
DATA  REP_NAME LIKE SY-REPID.
DATA: BEGIN OF OPTS OCCURS 1,
        C(80),
      END OF OPTS.
DATA: BEGIN OF DATA OCCURS 1,
        W TYPE F,
        F TYPE F,
      END OF DATA.

PARAMETER: FORMEL(40) DEFAULT 'x*cos(x)',
           VON_X TYPE P DEFAULT '1',
           BIS_X TYPE P DEFAULT '10',
           ANZAHL TYPE P DEFAULT '100'.

MOVE SY-REPID TO REP_NAME.
STEP = ( BIS_X - VON_X ) / ( ANZAHL - 1 ).
PI = '3.1415'.

X = VON_X.
DO ANZAHL TIMES.
  CALL FUNCTION 'EVAL_FORMULA'
       EXPORTING
            FORMULA = FORMEL
            PROGRAM = REP_NAME
            ROUTINE = 'VAR_GET'
       IMPORTING
            VALUE   = DATA-F.
  DATA-W = X. APPEND DATA.
  X = X + STEP.
ENDDO.

DATA: P_TMP(6).                        "// GL 5.5.1993
UNPACK ANZAHL TO P_TMP.

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

*----------------------------------------------------------------------*
* Graphische Ausgabe                                                   *
*----------------------------------------------------------------------*

CALL FUNCTION 'STAT_GRAPH'
     EXPORTING
          TTEXT        = TEXT-TIT
          UTEXT        = FORMEL
          TAXIS        = TEXT-AXE
     TABLES
          OPTS         = OPTS
          DATA         = DATA
     EXCEPTIONS
          OUT_OF_RANGE = 01.

IF SY-SUBRC NE 0.
  WRITE: / 'Out of Range'.
ENDIF.

*---------------------------------------------------------------------*
*       FORM VAR_GET                                                  *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
*  -->  VALUE(NAME)                                                   *
*  -->  VALUE(VALUE)                                                  *
*  -->  VALUE(SUBRC)                                                  *
*---------------------------------------------------------------------*
FORM VAR_GET USING VALUE(NAME)
             CHANGING VALUE(VALUE)
                      VALUE(SUBRC).
  SUBRC = 0.
  VALUE = 0.
  CASE NAME.
    WHEN 'X'.
      VALUE = X.
    WHEN 'PI'.
      VALUE = PI.
  ENDCASE.
ENDFORM.

*Text elements
*----------------------------------------------------------
* AXE X-axis
* LE1 User-defined function
* TIT Function


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