Posted: Mon Nov 05, 2007 1:57 pm Post subject: Demo: Network Graphics in Maintenance Mode
Code:
PROGRAM NETZ_BO2 MESSAGE-ID CG.
INCLUDE LCNETDAT. "allg. Datendeklarationen
INCLUDE LCNETCON. "Konstanten
DATA: BEGIN OF ALL_NODES_TAB OCCURS 0. "Alle Knoten
INCLUDE STRUCTURE CNG_INODES.
DATA: END OF ALL_NODES_TAB.
DATA: BEGIN OF ALL_NVALS_TAB OCCURS 0. "Werte zu allen Knoten
INCLUDE STRUCTURE NET_NVALS.
DATA: END OF ALL_NVALS_TAB.
DATA: BEGIN OF ALL_LINES_TAB OCCURS 0. "Alle Kanten
INCLUDE STRUCTURE CNG_LINES.
DATA: END OF ALL_LINES_TAB.
DATA: BEGIN OF ALL_LVALS_TAB OCCURS 0. "Werte zu allen Kanten
INCLUDE STRUCTURE NET_LVALS.
DATA: END OF ALL_LVALS_TAB.
DATA: BEGIN OF FIELD_TAB OCCURS 0, "Modifizieren der Knoten und Kanten
ID LIKE CNG_INODES-ID,
FL LIKE NET_NVALS-FL,
VAL LIKE NET_NVALS-VAL,
COLOR LIKE THLT-BG_COL,
END OF FIELD_TAB.
DATA: BEGIN OF NODE_LINE, "Modifizieren der Knoten und Kanten
ID LIKE CNG_INODES-ID,
TYPE LIKE CNG_INODES-TYPE,
END OF NODE_LINE.
DATA: BEGIN OF SCROLL_TAB OCCURS 0, "Blфttern in Sel. u. Pos.
FLAG(1) TYPE C,
END OF SCROLL_TAB.
DATA: ANZ TYPE I,
ANZ_L TYPE I,
ANZ_N TYPE I,
ENTRY_ACT TYPE I,
ENTRY_TO TYPE I,
ENTRY_NEW TYPE I,
LINE_COUNT TYPE I VALUE 4,
LINE_COUNT_1 TYPE I VALUE 10,
OK-CODE(4) TYPE C,
RELOAD_DATA(1) TYPE C,
SAVE_OK-CODE LIKE OK-CODE,
SWAP_POS(1) TYPE C,
TIME_EGG_TEXT LIKE NET_NVALS-VAL.
PARAMETER: PRF_GRUP LIKE TCNGT-PRF_GRUPPE DEFAULT 'DEMO',
PRF_NAME LIKE TCNGT-PRF_NAME DEFAULT '000000000001',
PRF_INDX LIKE TCNGT-PRF_INDEX DEFAULT '1'.
* Attribute der Legendenknoten wieder lіschen
LOOP AT LEGEND_TAB.
LOOP AT ALL_NVALS_TAB WHERE ID = LEGEND_TAB-ID.
DELETE ALL_NVALS_TAB.
ENDLOOP.
ENDLOOP.
STAT = NET_CONST-STAT_1. "Open Window, Transfer Data, Wait for Input
ABAP_CMD = SPACE.
*----------------------------------------------------------------------*
WHEN NET_CONST-GET_POSITIONS. "Positionen
IF SWAP_POS = SPACE
AND RELOAD_DATA = SPACE.
SORT POSITIONS_TAB BY OBJ_TYPE ID.
ENTRY_ACT = 1.
CALL SCREEN 103 STARTING AT 10 10 ENDING AT 38 23.
ABAP_CMD = NET_CONST-ASK_FOR_MODIFY.
*---------------------------------------------------------------------*
* FORM FIELD_TO_TEXTINDEX_LVALS *
*---------------------------------------------------------------------*
* Feldname in Textindex umwandeln *
*---------------------------------------------------------------------*
FORM FIELD_TO_TEXTINDEX_LVALS TABLES LVALS STRUCTURE NET_LVALS
ALL_LINES STRUCTURE CNG_LINES.
LOOP AT ALL_LINES WHERE ID = LVALS-ID.
EXIT.
ENDLOOP.
IF SY-SUBRC IS INITIAL.
CALL FUNCTION 'CNET_FIELD_TO_INDEX_LVALS'
EXPORTING
LINE_TYPE = ALL_LINES-TYPE
TABLES
LVALS = LVALS.
ENDIF. "if SY-SUBRC is initial
ENDFORM. "form FIELD_TO_TEXTINDEX_LVALS
*---------------------------------------------------------------------*
* FORM FIELD_TO_TEXTINDEX_NVALS *
*---------------------------------------------------------------------*
* Feldname in Textindex umwandeln *
*---------------------------------------------------------------------*
FORM FIELD_TO_TEXTINDEX_NVALS TABLES NVALS STRUCTURE NET_NVALS
ALL_NODES STRUCTURE CNG_INODES.
LOOP AT ALL_NODES WHERE ID = NVALS-ID.
EXIT.
ENDLOOP.
IF SY-SUBRC IS INITIAL.
CALL FUNCTION 'CNET_FIELD_TO_INDEX_NVALS'
EXPORTING
NODE_TYPE = ALL_NODES-TYPE
TABLES
NVALS = NVALS.
ENDIF. "if SY-SUBRC is initial
*---------------------------------------------------------------------*
* FORM SET_CUA_STATUS. *
*---------------------------------------------------------------------*
* Pflegen der CUA-Oberflфche ќber den CUA-Painter *
*---------------------------------------------------------------------*
FORM SET_CUA_STATUS.
DATA: BEGIN OF EXCLUDING_TAB OCCURS 0.
INCLUDE STRUCTURE SGRCEXCLUD.
DATA: END OF EXCLUDING_TAB.
DATA: PROG LIKE SY-REPID.
PROG = SY-REPID.
* CUA-Status
CALL FUNCTION 'GRAPH_SET_CUA_STATUS'
EXPORTING
PROGRAM = PROG
STATUS = 'GRAFIK'
TABLES
EXCLUDING = EXCLUDING_TAB
EXCEPTIONS
INV_CUA_INFO = 1.
CALL FUNCTION 'CNET_MAKE_BOXES'
TABLES
BOXES = BOXES
BVALS = BVALS.
ENDFORM. "SET_TITLE_BOX
*---------------------------------------------------------------------*
* FORM SET_TIME_EGG_TEXT *
*---------------------------------------------------------------------*
* Setzen Text im Zeitei *
*---------------------------------------------------------------------*
FORM SET_TIME_EGG_TEXT.
TIME_EGG_TEXT = TEXT-021.
CALL FUNCTION 'CNET_SET_TIMEEGG_TEXT'
EXPORTING
TEXT = TIME_EGG_TEXT.
ENDFORM. "SET_TIME_EGG_TEXT
*---------------------------------------------------------------------*
* MODULE SET_PF-STATUS_0100 OUTPUT *
*---------------------------------------------------------------------*
* Status zur Modifikation der Knoteninhalte *
*---------------------------------------------------------------------*
MODULE SET_PF-STATUS_0100 OUTPUT.
SET PF-STATUS 'MOD_TYPE'.
SET TITLEBAR '001'.
ENDMODULE. "module SET_PF-STATUS_0100 OUTPUT
*---------------------------------------------------------------------*
* MODULE SET_PF-STATUS_0101 OUTPUT *
*---------------------------------------------------------------------*
* Status + мberschrift zur Modifikation der Kanten *
*---------------------------------------------------------------------*
MODULE SET_PF-STATUS_0101 OUTPUT.
*---------------------------------------------------------------------*
* MODULE SET_PF-STATUS_0103 OUTPUT *
*---------------------------------------------------------------------*
* Status: Positionen der Objekte der Grafik anzeigen *
*---------------------------------------------------------------------*
MODULE SET_PF-STATUS_0103 OUTPUT.
SET PF-STATUS 'MOD_TYPE'.
SET TITLEBAR '004'.
ENDMODULE. "module SET_PF-STATUS_0103 OUTPUT
*---------------------------------------------------------------------*
* MODULE MODIFY_TAB_0100 INPUT *
*---------------------------------------------------------------------*
* Modifikation der Knoten bzw. Kanten der Grafik *
*---------------------------------------------------------------------*
MODULE MODIFY_TAB_0100 INPUT.
LOOP AT FIELD_TAB.
CLEAR NVALS_TAB.
MOVE-CORRESPONDING FIELD_TAB TO NVALS_TAB.
APPEND NVALS_TAB.
IF FIELD_TAB-COLOR <> SPACE.
CLEAR NVALS_TAB.
READ TABLE NVALS_TAB INDEX SY-TABIX.
WRITE NVALS_TAB-FL TO NVALS_TAB-VAL.
WRITE '/' TO NVALS_TAB-VAL+2(1).
WRITE FIELD_TAB-COLOR TO NVALS_TAB-VAL+3.
CONDENSE NVALS_TAB-VAL NO-GAPS.
NVALS_TAB-FL = NET_CONST-COLOR.
APPEND NVALS_TAB.
ENDIF.
ENDLOOP.
WHEN NET_CONST-LINE_OBJECT. "Kante
CLEAR LVALS_TAB.
REFRESH LVALS_TAB.
LOOP AT FIELD_TAB CURSOR ENTRY_ACT.
ENDLOOP.
*
PROCESS AFTER INPUT.
LOOP AT FIELD_TAB.
CHAIN.
FIELD FIELD_TAB-COLOR
SELECT * FROM TWCOL WHERE COLOR = FIELD_TAB-COLOR.
ENDCHAIN.
CHAIN.
FIELD: FIELD_TAB-FL.
FIELD: FIELD_TAB-VAL.
FIELD: FIELD_TAB-COLOR.
MODULE MODIFY_TAB_0100 ON CHAIN-REQUEST.
ENDCHAIN.
ENDLOOP.
MODULE OK_CODE_0100.
****************************************************************
* This file was generated by Direct Download Enterprise. *
* Please do not change it manually. *
****************************************************************
%_DYNPRO
NETZ_BO2
0101
620
40
%_HEADER
NETZ_BO2 0101M0101 9 48192 0 0 0 10 48101GXD 19960520141344
%_DESCRIPTION
Change link
%_FIELDS
TEXT1 CHAR 48 00 00 00 30 00 1 2 0 0 0 4 R 0 0 102 Link
IDENTIFIKATION 3 CHAR 20 00 00 00 38 00 2 3 0 0 0 0 0 0 0 Identification
NODE_LINE-ID C CHAR 10 80 00 80 70 00 2 24 0 0 0 0 0 0 0 __________
TYPE 3 CHAR 10 00 00 00 38 00 3 3 0 0 0 0 0 0 0 Type
NODE_LINE-TYPE C CHAR 1 80 00 80 40 00 3 24 0 0 0 0 0 0 0 _
TEXT2 CHAR 48 00 00 00 30 00 5 2 0 0 0 5 R 0 0 103 Field attributes
FIELD CHAR 4 00 00 00 38 00 6 3 0 0 0 0 0 0 0 Fld
TEXT CHAR 4 00 00 00 38 00 6 9 0 0 0 0 0 0 0 Text
FIELD_TAB-FL C CHAR 2 80 00 88 40 00 7 3 L 101 1 2 0 0 0 0 __
FIELD_TAB-VAL C CHAR 40 80 02 80 40 00 7 9 L 101 1 2 0 0 0 0 ________________________________________
OK-CODE CHAR 4 80 10 00 40 00 255 255 O 0 0 0 0 0 0 0 ____
%_FLOWLOGIC
PROCESS BEFORE OUTPUT.
MODULE SET_PF-STATUS_0101.
LOOP AT FIELD_TAB CURSOR ENTRY_ACT.
ENDLOOP.
*
PROCESS AFTER INPUT.
LOOP AT FIELD_TAB.
CHAIN.
FIELD: FIELD_TAB-FL.
FIELD: FIELD_TAB-VAL.
MODULE MODIFY_TAB_0100 ON CHAIN-REQUEST.
ENDCHAIN.
ENDLOOP.
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.