Posted: Mon Nov 05, 2007 1:24 pm Post subject: Demo: Pushbutton Graphics / 2
Code:
*----------------------------------------------------------------------*
* Beispiel fьr die graphische Darstellung einer Matrix als Push-Button *
* mit 2-Dimensionalen POPUP-Menu, ebenfalls als Push-Button-Matrix *
*
* Verhalten des Dialogs
*
* GL 24.09.91
*
* GL 15.09.1992 BUSG-3D-MAIL
*----------------------------------------------------------------------*
REPORT GRBMAT_2.
DATA: BEGIN OF MATRIX OCCURS 1,
COL1(20),
COL2 TYPE P,
COL3 TYPE P,
COL4 TYPE P,
COL5 TYPE P,
END OF MATRIX.
DATA: BEGIN OF ATTR OCCURS 1,
COL1(20),
COL2 TYPE P,
COL3 TYPE P,
COL4 TYPE P,
COL5 TYPE P,
END OF ATTR.
DATA: BEGIN OF SDATA OCCURS 1,
X TYPE P,
Y TYPE P,
END OF SDATA.
DATA: BEGIN OF SIZE OCCURS 1,
C(10) TYPE C,
END OF SIZE.
DATA: BEGIN OF MTEXT OCCURS 1,
TEXT(40),
END OF MTEXT.
DATA: BEGIN OF MENUE OCCURS 1,
TEXT(40),
TEXT2(20),
END OF MENUE.
DATA: BEGIN OF OPTS OCCURS 1,
C(80) TYPE C,
END OF OPTS.
DATA: BEGIN OF TCOL OCCURS 1,
C(20) TYPE C,
END OF TCOL.
DATA TEXT(64).
DATA WINID(10).
DATA INDEX LIKE SY-INDEX.
DATA BUSG_STAT.
DATA STAT_STAT.
DATA STAT_ART(3).
DATA BMAT_STAT.
DATA IND LIKE SY-INDEX.
DATA: NROW(2),
NCOL(1). "// chanced to ONE character
DATA: MENROW(2).
DATA: MENCOL(2). "// changed to ONE character
DATA: ANZAHL(8).
FIELD-SYMBOLS: <F>.
DATA: M_TYP(1), RBUF(40).
SET PF-STATUS 'GRAF'.
MENUE-TEXT = TEXT-GBU.
MENUE-TEXT2 = TEXT-GBU.
APPEND MENUE.
MENUE-TEXT = TEXT-GST.
MENUE-TEXT2 = TEXT-LOG.
APPEND MENUE. "// stat doesnt work yet here
CASE M_TYP.
WHEN 'D'.
EXIT.
WHEN ' '.
WHEN '0'. "// from non-BMAT-Window
IF WINID(4) = 'BUSG'.
BUSG_STAT = '2'. "// restart next time
ENDIF.
IF WINID(4) = 'STAT'.
STAT_STAT = '2'. "// restart next time
ENDIF.
WHEN 'Q'. "// should not happen (SUPER)
WHEN 'I'.
CASE MENROW.
WHEN 1.
REFRESH OPTS.
* keine Auswertung von MENCOL bei BUSG
IF NROW(1) EQ '1' AND NCOL(1) EQ '0'. " 3-D Graphik
CALL FUNCTION 'GRAPH_3D'
EXPORTING
TITL = TEXT
DIM1 = TEXT-SXX
DIM2 = TEXT-ZXX
STAT = BUSG_STAT
MAIL_ALLOW = 'X'
TABLES
DATA = MATRIX.
BUSG_STAT = '5'. " Daten nachlesen
ENDIF.
IF NROW(1) EQ '1' AND NCOL(1) NE '0'." 2-D Gr. Spalte
READ TABLE TCOL INDEX NCOL.
CALL FUNCTION 'GRAPH_MATRIX_2D'
EXPORTING
TITL = TCOL
NCOL = NCOL
STAT = BUSG_STAT
TABLES
DATA = MATRIX
OPTS = OPTS
TCOL = TCOL.
BUSG_STAT = '5'. " Daten nachlesen
ENDIF.
IF NROW(1) NE '1' AND NCOL(1) EQ '0'. " 2-D Gr. Zeile
NROW = NROW - 1.
READ TABLE MATRIX INDEX NROW.
CALL FUNCTION 'GRAPH_MATRIX_2D'
EXPORTING
TITL = MATRIX-COL1
NROW = NROW
STAT = BUSG_STAT
TABLES
DATA = MATRIX
OPTS = OPTS
TCOL = TCOL.
BUSG_STAT = '5'. " Daten nachlesen
ENDIF.
WHEN 2.
IF MENCOL(1) EQ '1'.
STAT_ART = 'LOG'.
ELSE.
STAT_ART = 'LIN'.
ENDIF.
* Fuer MENCOL = 1 gilt logarithmische Darstellung bei STAT
REFRESH SDATA.
REFRESH OPTS.
IF NROW(1) EQ '1' AND NCOL(1) EQ '0'. " 3-D Graphik
DO 4 TIMES.
IND = SY-INDEX.
DO 5 TIMES.
READ TABLE MATRIX INDEX SY-INDEX.
SDATA-X = SY-INDEX.
CASE IND.
WHEN 1.
SDATA-Y = MATRIX-COL2.
WHEN 2.
SDATA-Y = MATRIX-COL3.
WHEN 3.
SDATA-Y = MATRIX-COL4.
WHEN 4.
SDATA-Y = MATRIX-COL5.
ENDCASE.
APPEND SDATA.
ENDDO.
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.