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: Network Graphics in Display Mode



 
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:50 pm    Post subject: Demo: Network Graphics in Display Mode Reply with quote

Code:
REPORT NETZ_BO1.

INCLUDE LCNETDAT.                      "allg. Datendeklarationen
INCLUDE LCNETCON.                      "Konstanten

* Erzeugen der Knoten
PERFORM MAKE_NODES TABLES NET_NODES_TAB NVALS_TAB.

* Erzeugen der Kanten
PERFORM MAKE_LINES TABLES LINES_TAB LVALS_TAB.

DO.
* Aufrufen der Netzplangrafik
  CALL FUNCTION 'CNET_GRAPHIC_NETWORK'
       EXPORTING
            STAT      = STAT
       IMPORTING
            M_TYP     = M_TYP
       TABLES
            CLUSTERS  = CLUSTERS_TAB
            CVALS     = CVALS_TAB
            DELETIONS = DELETE_TAB
            INODES    = INODES_TAB
            LINES     = LINES_TAB
            LVALS     = LVALS_TAB
            NODES     = NET_NODES_TAB
            NVALS     = NVALS_TAB
            POSITIONS = POSITIONS_TAB.

  CASE M_TYP.
    WHEN NET_CONST-M_TYP_D.
      EXIT.
    WHEN NET_CONST-M_TYP_I.
      STAT = NET_CONST-STAT_4.
  ENDCASE.
ENDDO.

*---------------------------------------------------------------------*
*       FORM MAKE_NODES                                               *
*---------------------------------------------------------------------*
*       Erzeugen der Knoten                                           *
*---------------------------------------------------------------------*
*  -->  NODES                                                         *
*  -->  NVALS                                                         *
*---------------------------------------------------------------------*
FORM MAKE_NODES TABLES NODES STRUCTURE CNG_NODES
                       NVALS STRUCTURE NET_NVALS.

  NODES-ID   = '1'.
  APPEND NODES.
  NVALS-ID   = NODES-ID.
  NVALS-FL   = NET_CONST-TEXT_INDEX_0.
  NVALS-VAL  = TEXT-001.                                    "Node 1
  APPEND NVALS.

  NODES-ID   = '2'.
  APPEND NODES.
  NVALS-ID   = NODES-ID.
  NVALS-FL   = NET_CONST-TEXT_INDEX_0.
  NVALS-VAL  = TEXT-002.                                    "Node 2
  APPEND NVALS.

  NODES-ID   = '3'.
  APPEND NODES.
  NVALS-ID   = NODES-ID.
  NVALS-FL   = NET_CONST-TEXT_INDEX_0.
  NVALS-VAL  = TEXT-003.                                    "Node 3
  APPEND NVALS.

  NODES-ID   = '4'.
  APPEND NODES.
  NVALS-ID   = NODES-ID.
  NVALS-FL   = NET_CONST-TEXT_INDEX_0.
  NVALS-VAL  = TEXT-004.                                    "Node 4
  APPEND NVALS.

  NODES-ID   = '5'.
  APPEND NODES.
  NVALS-ID   = NODES-ID.
  NVALS-FL   = NET_CONST-TEXT_INDEX_0.
  NVALS-VAL  = TEXT-005.                                    "Node 5
  APPEND NVALS.

  NODES-ID   = '6'.
  APPEND NODES.
  NVALS-ID   = NODES-ID.
  NVALS-FL   = NET_CONST-TEXT_INDEX_0.
  NVALS-VAL  = TEXT-006.                                    "Node 6
  APPEND NVALS.

ENDFORM.


*---------------------------------------------------------------------*
*       FORM MAKE_LINES                                               *
*---------------------------------------------------------------------*
*       Erzeugen der Kanten                                           *
*---------------------------------------------------------------------*
*  -->  LINES                                                         *
*  -->  LVALS                                                         *
*---------------------------------------------------------------------*
FORM MAKE_LINES TABLES LINES STRUCTURE CNG_LINES
                       LVALS STRUCTURE NET_LVALS.

  LINES-ID   = '1'.
  LINES-PRE  = '1'.
  LINES-SUC  = '2'.
  LINES-AB   = NET_CONST-AOB_EA.       "Normalbeziehung
  APPEND LINES.
  LVALS-ID   = LINES-ID.
  LVALS-FL   = NET_CONST-TEXT_INDEX_0.
  LVALS-VAL  = LINES-AB.
  APPEND LVALS.

  LINES-ID   = '2'.
  LINES-PRE  = '2'.
  LINES-SUC  = '4'.
  LINES-AB   = NET_CONST-AOB_EA.       "Normalbeziehung
  APPEND LINES.
  LVALS-ID   = LINES-ID.
  LVALS-FL   = NET_CONST-TEXT_INDEX_0.
  LVALS-VAL  = LINES-AB.
  APPEND LVALS.

  LINES-ID   = '3'.
  LINES-PRE  = '1'.
  LINES-SUC  = '3'.
  LINES-AB   = NET_CONST-AOB_EA.       "Normalbeziehung
  APPEND LINES.
  LVALS-ID   = LINES-ID.
  LVALS-FL   = NET_CONST-TEXT_INDEX_0.
  LVALS-VAL  = LINES-AB.
  APPEND LVALS.

  LINES-ID   = '4'.
  LINES-PRE  = '3'.
  LINES-SUC  = '4'.
  LINES-AB   = NET_CONST-AOB_EA.       "Normalbeziehung
  APPEND LINES.
  LVALS-ID   = LINES-ID.
  LVALS-FL   = NET_CONST-TEXT_INDEX_0.
  LVALS-VAL  = LINES-AB.
  APPEND LVALS.

  LINES-ID   = '5'.
  LINES-PRE  = '4'.
  LINES-SUC  = '5'.
  LINES-AB   = NET_CONST-AOB_EA.       "Normalbeziehung
  APPEND LINES.
  LVALS-ID   = LINES-ID.
  LVALS-FL   = NET_CONST-TEXT_INDEX_0.
  LVALS-VAL  = LINES-AB.
  APPEND LVALS.

  LINES-ID   = '6'.
  LINES-PRE  = '5'.
  LINES-SUC  = '6'.
  LINES-AB   = NET_CONST-AOB_EA.       "Normalbeziehung
  APPEND LINES.
  LVALS-ID   = LINES-ID.
  LVALS-FL   = NET_CONST-TEXT_INDEX_0.
  LVALS-VAL  = LINES-AB.
  APPEND LVALS.

ENDFORM.


*Text elements
*----------------------------------------------------------
* 001 Node 1
* 002 Node 2
* 003 Node 3
* 004 Node 4
* 005 Node 5
* 006 Node 6
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.