SAP Function Modules

CNET_LOGIC_NETWORK SAP Function module - Example for the administration of network logic







CNET_LOGIC_NETWORK is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name CNET_LOGIC_NETWORK into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: CNET
Released Date: 16.04.1997
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM CNET_LOGIC_NETWORK - CNET LOGIC NETWORK





CALL FUNCTION 'CNET_LOGIC_NETWORK' "Example for the administration of network logic
* EXPORTING
*   confirm = SPACE             "               Indicator: Confirm mode
*   lg_mes = SPACE              " net_graph-gr_mes  Command
*   lg_mode = SPACE             " net_graph-gr_mode  Mode for inserting, duplicating
*   line_type_at_generation = '0'  " cng_lines-type  Type of generated links
  TABLES
    all_lines =                 " cng_lines     All links
    all_lvals =                 " net_lvals     Texts for all links
    all_nodes =                 " cng_inodes    All nodes
    all_nvals =                 " net_nvals     Attributes of all nodes
    deletions =                 " net_delete    Objects to be deleted
    lines =                     " cng_lines     Transfer table for links
    lvals =                     " net_lvals     Transfer table for link texts
    nodes =                     " cng_nodes     Nodes
    nvals =                     " net_nvals     Node attributes
    .  "  CNET_LOGIC_NETWORK

ABAP code example for Function Module CNET_LOGIC_NETWORK





The ABAP code below is a full code listing to execute function module CNET_LOGIC_NETWORK including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).

DATA:
it_all_lines  TYPE STANDARD TABLE OF CNG_LINES,"TABLES PARAM
wa_all_lines  LIKE LINE OF it_all_lines ,
it_all_lvals  TYPE STANDARD TABLE OF NET_LVALS,"TABLES PARAM
wa_all_lvals  LIKE LINE OF it_all_lvals ,
it_all_nodes  TYPE STANDARD TABLE OF CNG_INODES,"TABLES PARAM
wa_all_nodes  LIKE LINE OF it_all_nodes ,
it_all_nvals  TYPE STANDARD TABLE OF NET_NVALS,"TABLES PARAM
wa_all_nvals  LIKE LINE OF it_all_nvals ,
it_deletions  TYPE STANDARD TABLE OF NET_DELETE,"TABLES PARAM
wa_deletions  LIKE LINE OF it_deletions ,
it_lines  TYPE STANDARD TABLE OF CNG_LINES,"TABLES PARAM
wa_lines  LIKE LINE OF it_lines ,
it_lvals  TYPE STANDARD TABLE OF NET_LVALS,"TABLES PARAM
wa_lvals  LIKE LINE OF it_lvals ,
it_nodes  TYPE STANDARD TABLE OF CNG_NODES,"TABLES PARAM
wa_nodes  LIKE LINE OF it_nodes ,
it_nvals  TYPE STANDARD TABLE OF NET_NVALS,"TABLES PARAM
wa_nvals  LIKE LINE OF it_nvals .

DATA(ld_confirm) = 'some text here'.

DATA(ld_lg_mes) = some text here

DATA(ld_lg_mode) = some text here

DATA(ld_line_type_at_generation) = some text here

"populate fields of struture and append to itab
append wa_all_lines to it_all_lines.

"populate fields of struture and append to itab
append wa_all_lvals to it_all_lvals.

"populate fields of struture and append to itab
append wa_all_nodes to it_all_nodes.

"populate fields of struture and append to itab
append wa_all_nvals to it_all_nvals.

"populate fields of struture and append to itab
append wa_deletions to it_deletions.

"populate fields of struture and append to itab
append wa_lines to it_lines.

"populate fields of struture and append to itab
append wa_lvals to it_lvals.

"populate fields of struture and append to itab
append wa_nodes to it_nodes.

"populate fields of struture and append to itab
append wa_nvals to it_nvals. . CALL FUNCTION 'CNET_LOGIC_NETWORK' * EXPORTING * confirm = ld_confirm * lg_mes = ld_lg_mes * lg_mode = ld_lg_mode * line_type_at_generation = ld_line_type_at_generation TABLES all_lines = it_all_lines all_lvals = it_all_lvals all_nodes = it_all_nodes all_nvals = it_all_nvals deletions = it_deletions lines = it_lines lvals = it_lvals nodes = it_nodes nvals = it_nvals . " CNET_LOGIC_NETWORK
IF SY-SUBRC EQ 0. "All OK ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_confirm  TYPE STRING ,
it_all_lines  TYPE STANDARD TABLE OF CNG_LINES ,
wa_all_lines  LIKE LINE OF it_all_lines,
ld_lg_mes  TYPE NET_GRAPH-GR_MES ,
it_all_lvals  TYPE STANDARD TABLE OF NET_LVALS ,
wa_all_lvals  LIKE LINE OF it_all_lvals,
ld_lg_mode  TYPE NET_GRAPH-GR_MODE ,
it_all_nodes  TYPE STANDARD TABLE OF CNG_INODES ,
wa_all_nodes  LIKE LINE OF it_all_nodes,
ld_line_type_at_generation  TYPE CNG_LINES-TYPE ,
it_all_nvals  TYPE STANDARD TABLE OF NET_NVALS ,
wa_all_nvals  LIKE LINE OF it_all_nvals,
it_deletions  TYPE STANDARD TABLE OF NET_DELETE ,
wa_deletions  LIKE LINE OF it_deletions,
it_lines  TYPE STANDARD TABLE OF CNG_LINES ,
wa_lines  LIKE LINE OF it_lines,
it_lvals  TYPE STANDARD TABLE OF NET_LVALS ,
wa_lvals  LIKE LINE OF it_lvals,
it_nodes  TYPE STANDARD TABLE OF CNG_NODES ,
wa_nodes  LIKE LINE OF it_nodes,
it_nvals  TYPE STANDARD TABLE OF NET_NVALS ,
wa_nvals  LIKE LINE OF it_nvals.

ld_confirm = 'some text here'.

"populate fields of struture and append to itab
append wa_all_lines to it_all_lines.

ld_lg_mes = some text here

"populate fields of struture and append to itab
append wa_all_lvals to it_all_lvals.

ld_lg_mode = some text here

"populate fields of struture and append to itab
append wa_all_nodes to it_all_nodes.

ld_line_type_at_generation = some text here

"populate fields of struture and append to itab
append wa_all_nvals to it_all_nvals.

"populate fields of struture and append to itab
append wa_deletions to it_deletions.

"populate fields of struture and append to itab
append wa_lines to it_lines.

"populate fields of struture and append to itab
append wa_lvals to it_lvals.

"populate fields of struture and append to itab
append wa_nodes to it_nodes.

"populate fields of struture and append to itab
append wa_nvals to it_nvals.

SAP Documentation for FM CNET_LOGIC_NETWORK


To enable validations all data sent to the graphic must exist in ABAP.
This module is an example for updating the data in the tables Tabellen ...See here for full SAP fm documentation










Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name CNET_LOGIC_NETWORK or its description.