landina
 

 Method: Network.Maintain 

With the Maintain BAPI of the Network business object you can edit networks, network activities, and relationships. The BAPI encapsulates a complete transaction in itself. Therefore, several operations on network objects can be processed by only one call. The R/3 Project System determines in which order the operations are to be executed on the objects. The caller can choose the operations in any order.

As a result the processing is very speedy and effective. However, this transaction concept does not include the use and combination of other SAP BAPIs in the same LUW.

Procedure

The Network business object is a facade to networks, their activities, and relationships.

If you want to edit a network object enter a command for an object type. In addition, enter the object key and a reference to its attributes.

In the table of the IMethodProject parameter, enter the object type, the command and the object key. As a reference enter the index of the object data table of the relevant object type. In the object data table enter the information on the object.

If necessary, use an update structure for the object. When entering Objecttype and Method in the IMethodProject table remember that the entries are case sensitive.

To finish the transaction and store the data in the R/3 database, enter the Save command. If you only want to test whether the changes can be carried out do not use the Save command.

In general, you cannot change the keys of objects.

The Return return parameter indicates whether errors occurred during processing. After the call you find the error messages that were created during processing in the EmessageTable table.

For more information, see the documentation of the ABAP function module BAPI_NETWORK_MAINTAIN .

Commands of the Object Types

Object type Network

The network number is the key that identifies each network object type.

Command: Create

Creating a network using the specified network number. The network number is determined by the external system. For the network enter a network profile that exists in the R/3 Project System. The network profile has to be assigned to a network type supporting external number assignment.

Always enter the network number in uppercase.

Depending on the scheduling type, enter a start or end date.

Creating a network with the network number TRAINING0001 . Enter the key of the network object in the command table under OBJECTKEY and in the data table under NETWORK . The reference number \'000001\' of the IMethodProject command table refers to the index of the data table.

IMethodProject

OBJECTTYPE

METHOD

OBJECTKEY

REFNUMBER

Network

Create

TRAINING0001

000001

 

Save

   

 

INetwork

Index

NETWORK

SHORT_TEXT

FINISH_DATE

PROFILE

...

1

TRAINING0001

New network

04.12.1999

EPS40_1

...

 

 

Command: Update

Changing a network that exists in the R/3 Project System.

Using the update structure

You want to change only certain values in an existing network and keep the other values. Using the update structure you specify exactly the attributes you want to change. Therefore, you need not fill all the attributes of the network structure.

If you are working with the update structures, pay attention to the fact that the table of the update structure must also be filled for the other commands of the network. The reference number of the command table has to match the same index of the network table and the table containing the update structures.

Changing the description of the existing network TRAINING0001.

 

IMethodProject

OBJECTTYPE

METHOD

OBJECTKEY

REFNUMBER

Network

Update

TRAINING0001

000001

 

Save

   

INetwork

Index

NETWORK

SHORT_TEXT

FINISH_DATE

PROFILE

...

1

TRAINING0001

description changed

   

...

INetworkUpdate

Index

NETWORK

SHORT_TEXT

FINISH_DATE

PROFILE

...

1

 

X

 

 

...

 

Command: Delete (from R/3 release 4.5A)

Deleting a network that already exists in the R/3 Project System. The network has the system status deletion flag which can be revoked in the R/3 Project System. Therefore, the network remains in the database physically.

Deleting the network TRAINING0001 .

IMethodProject

OBJECTTYPE

METHOD

OBJECTKEY

REFNUMBER

Network

Delete

TRAINING0001

000001

 

Save

 

 

INetwork

Index

NETWORK

...

1

TRAINING0001

...

 

Command: Schedule

Scheduling a network.

The network TRAINING0001 is rescheduled.

IMethodProject

OBJECTTYPE

METHOD

OBJECTKEY

REFNUMBER

Network

Schedule

TRAINING0001

000001

 

Save

 

 

INetwork

Index

NETWORK

SHORT_TEXT

FINISH_DATE

PROFILE

...

1

TRAINING0001

 

 

 

...

 

Command: Calculate

Calculating costs for a network.

Calculating costs for the network TRAINING0001 .

IMethodProject

OBJECTTYPE

METHOD

OBJECTKEY

REFNUMBER

Network

Calculate

TRAINING0001

000001

 

Save

 

 

INetwork

Index

NETWORK

SHORT_TEXT

FINISH_DATE

PROFILE

...

1

TRAINING0001

 

 

 

...

 

Command: Release (from R/3 release 4.5A)

Releasing a network with all its activities.

Releasing the network TRAINING0001 .

IMethodProject

OBJECTTYPE

METHOD

OBJECTKEY

REFNUMBER

Network

Release

TRAINING0001

000001

 

Save

 

 

INetwork

Index

NETWORK

SHORT_TEXT

FINISH_DATE

PROFILE

...

1

TRAINING0001

 

 

 

...

 

Command: Lock (from R/3 release 4.6A)

Locking a network

The "locked" system status is set for the network.

 

Locking the network TRAINING0001 .

IMethodProject

OBJECTTYPE

METHOD

OBJECTKEY

REFNUMBER

Network

Lock

TRAINING0001

000001

 

Save

   

INetwork

Index

NETWORK

SHORT_TEXT

FINISH_DATE

PROFILE

...

1

TRAINING0001

     

...

 

Command: Unlock (from R/3 release 4.6A)

Unlocking a network

The "locked" system status is removed from the network.

 

Unlocking the network TRAINING0001 .

IMethodProject

OBJECTTYPE

METHOD

OBJECTKEY

REFNUMBER

Network

Unlock

TRAINING0001

000001

 

Save

   

INetwork

Index

NETWORK

SHORT_TEXT

FINISH_DATE

PROFILE

...

1

TRAINING0001

     

...

 

Object type NetworkActivity

The key of the network activity object is composed of the network number and the activity number.

If you want to apply a command to the network activity you must always include the superior network in the same call in the table of the INetwork parameter.

Command: Create

Creating a new activity in a network.

Creating a new network activity with the number 0010 in network TRAINING0001 .

IMethodProject

OBJECTTYPE

METHOD

OBJECTKEY

REFNUMBER

NetworkActivity

Create

TRAINING00010010

000001

 

Save

 

 

IActivity

Index

NETWORK

ACTIVITY

DESCRIPTION

...

1

TRAINING0001

0010

Activity 10

...

INetwork

Index

NETWORK

...

1

TRAINING0001

...

 

Command: Update

Changing an activity that already exists in the R/3 Project System.

Use the update structure analogous to the network.

Changing the description of the activity 0010 in network TRAINING0001.

IMethodProject

OBJECTTYPE

METHOD

OBJECTKEY

REFNUMBER

NetworkActivity

Update

TRAINING00010010

000001

 

Save

 

 

IActivity

Index

NETWORK

ACTIVITY

DESCRIPTION

...

1

TRAINING0001

0010

Activity 10 changed

...

IActivityUpdate

Index

NETWORK

ACTIVITY

DESCRIPTION

...

1

 

 

X

...

INetwork

Index

NETWORK

...

1

TRAINING0001

...

 

Command: Delete

Deleting an activity that already exists in the R/3 Project System. The activity gets the system status deletion flag and is not deleted physically. Connected objects such as relationships, activity elements, capacity requirements, purchase requisitions, and material components are also deallocated or selected for deletion.

You cannot create a new activity with the same key.

Changing the description of the activity 0010 in network TRAINING0001.

IMethodProject

OBJECTTYPE

METHOD

OBJECTKEY

REFNUMBER

NetworkActivity

Delete

TRAINING00010010

000001

 

Save

 

 

IActivity

Index

NETWORK

ACTIVITY

DESCRIPTION

...

1

TRAINING0001

0010

 

...

INetwork

Index

NETWORK

...

1

TRAINING0001

...

 

Command: Release (from R/3 release 4.5A)

Releasing a network activity.

Releasing the activity 0010 in network TRAINING0001 .

IMethodProject

OBJECTTYPE

METHOD

OBJECTKEY

REFNUMBER

NetworkActivity

Release

TRAINING00010010

000001

 

Save

 

 

IActivity

Index

NETWORK

ACTIVITY

DESCRIPTION

...

1

TRAINING0001

0010

 

...

INetwork

Index

NETWORK

...

1

TRAINING0001

...

 

Object type: NetworkActivityElement (from R/3 Release 4.6A)

The key of the activity element object comprises of the network number, the activity number, and the activity element number.

Command: Create

Creating a new activity element in a network.

 

Creating a new activity element with the number 0020 for network activity 0010 in network TRAINING0001 .

IMethodProject

OBJECTTYPE

METHOD

OBJECTKEY

REFNUMBER

NetworkActivityElement

Create

TRAINING000100100020

000001

 

Save

   

IActivityElement

Index

NETWORK

ACTIVITY

ELEMENT

...

1

TRAINING0001

0010

0020

...

 

Command: Update

Changing an activity element that already exists in the R/3 Project System.

Use the update structure analogous to the network.

 

Changing an existing activity element with the number 0020 for network activity 0010 in network TRAINING0001 .

IMethodProject

OBJECTTYPE

METHOD

OBJECTKEY

REFNUMBER

NetworkActivityElement

Update

TRAINING000100100020

000001

 

Save

   

IActivityElement

Index

NETWORK

ACTIVITY

ELEMENT

DESCRIPTION

...

1

TRAINING0001

0010

0020

Activity element 20 changed

...

IActivityElementUpdate

Index

NETWORK

ACTIVITY

ELEMENT

DESCRIPTION

...

1

   

0020

X

...

 

Command: Delete

Deleting an activity element that already exists in the R/3 Project System. The activity element gets the system status deletion flag and is not deleted physically. Linked objects such as capacity requirements and purchase requisitions are also de-assigned or flagged for deletion.

You cannot create a new activity element with the same key.

 

Deleting an activity element with the number 0020 for network activity 0010 in network TRAINING0001 .

IMethodProject

OBJECTTYPE

METHOD

OBJECTKEY

REFNUMBER

NetworkActivityElement

Delete

TRAINING000100100020

000001

 

Save

   

IActivityElement

Index

NETWORK

ACTIVITY

ELEMENT

...

1

TRAINING0001

0010

0020

...

 

Object type: ActivityMilestone (from R/3 Release 4.6A)

The key for the object activity milestone is the milestone number.

Command: Create

Creating a new activity milestone in a network. It is not necessary to enter a number for the milestone. When the milestone is created, the system returns the number of the milestone as an information message in the message table.

If however when creating, an external number is entered in the method table, the external number and the new milestone number are returned as an information message in the message table.

 

Creating a new activity milestone for activity 0010 in the network TRAINING0001 .

IMethodProject

OBJECTTYPE

METHOD

OBJECTKEY

REFNUMBER

ActivityMilestone

Create

 

000001

 

Save

   

IActivityMilestone

Index

MILESTONE_NUMBER

NETWORK

ACTIVITY

...

1

 

TRAINING0001

0010

...

 

Command: Update

Changing an activity milestone that already exists in the R/3 Project System. It is always necessary to enter a network, even if you do not change the network itself.

Use the update structure analogous to the network.

 

Changing an existing activity milestone with number 000000002097 in network TRAINING0001 .

IMethodProject

OBJECTTYPE

METHOD

OBJECTKEY

REFNUMBER

ActivityMilestone

Update

000000002097

000001

 

Save

   

IActivityMilestone

Index

MILESTONE_NUMBER

DESCRIPTION

NETWORK

...

1

000000002097

modified milestone description

TRAINING0001

...

IActivityMilestoneUpdate

Index

MILESTONE_NUMBER

DESCRIPTION

NETWORK

...

1

 

X

 

...

 

Command: Delete

Deleting an activity milestone that exists in the R/3 Project System. The activity milestone is deleted physically. It is always necessary to enter a network, even if you do not change the network itself.

 

Deleting the activity milestone with the number 000000002097 in network TRAINING0001 .

IMethodProject

OBJECTTYPE

METHOD

OBJECTKEY

REFNUMBER

ActivityMilestone

Delete

000000002097

000001

 

Save

   

IActivityMilestone

Index

MILESTONE_NUMBER

NETWORK

...

1

000000002097

TRAINING0001

...

 

Object type NetworkRelation

The key of the Relationship object is composed of the type of relationship and the keys of the preceding and succeeding activities. You can change the name of the type of relationship in Customizing (transaction OPS2). In general, the name is language dependent. Use only valid types of relationships that are available in the corresponding language.

To apply a command for the relationship, always include the connected networks in the same call in the table of the INetwork parameter.

Command: Create

Creating a relationship between two activities.

Creating a new relationship between activities 0010 and 0020 in network TRAINING0001 . The relationship is a finish-start relationship (FS).

IMethodProject

OBJECTTYPE

METHOD

OBJECTKEY

REFNUMBER

NetworkRelation

Create

NFTRAINING00010010TRAINING00010020

000001

 

Save

 

 

IRelation

Index

NETWORK_ PREDECESSOR

ACTIVITY_ PREDECESSOR

NETWORK_ SUCCESSOR

ACTIVITY_ SUCCESSOR

RELATION_ TYPE

...

1

TRAINING0001

0010

TRAINING0001

0020

FS

...

 

INetwork

Index

NETWORK

...

1

TRAINING0001

...

 

Command: Update

Changing a relationship that already exists in the R/3 Project System. The type of relationship cannot be changed, because it is part of the relationship key. If you want to change the relationship type, delete the relationship and create a new relationship with a new relationship type.

Use the update structure analogous to the network.

Command: Delete

Deleting a relationship that links two activities. The relationship is deleted physically.

Deleting the relationship between the activities 0010 and 0020 in the network TRAINING0001 .

IMethodProject

OBJECTTYPE

METHOD

OBJECTKEY

REFNUMBER

NetworkRelation

Delete

FSTRAINING00010010TRAINING00010020

000001

 

Save

 

 

 

IRelation

Index

NETWORK_ PREDECESSOR

ACTIVITY_ PREDECESSOR

NETWORK_ SUCCESSOR

ACTIVITY_ SUCCESSOR

RELATION_ TYPE

...

1

TRAINING0001

0010

TRAINING0001

0020

FS

...

 

Network

Index

NETWORK

...

1

TRAINING0001

...

 

Example of Applying Several Commands to Different Objects

Creating two networks with activities and relationships. One of the relationships links the two networks and one of the networks is scheduled.

IMethodProject

OBJECTTYPE

METHOD

OBJECTKEY

REFNUMBER

Network

Create

TRAINING0001

000001

Network

Create

TEST_NETWORK

000002

Network

Schedule

TRAINING0001

000001

NetworkActivity

Create

TRAINING00010010

000001

NetworkActivity

Create

TRAINING00010020

000002

NetworkActivity

Create

TEST_NETWORK1000

000003

NetworkRelation

Create

NFTRAINING00010010TRAINING00010020

000001

NetworkRelation

Create

NFTRAINING00010020 TEST_NETWORK1000

000002

 

Save

 

 

 

INetwork

Index

NETWORK

SHORT_TEXT

FINISH_DATE

PROFILE

...

1

TRAINING0001

Training Network

12/04/1999

EPS40_1

...

2

TEST_NETWORK

Test Network

12/09/1999

EPS40_1

...

IActivity

Index

NETWORK

ACTIVITY

DESCRIPTION

...

1

TRAINING0001

0010

Activity 10

...

2

TRAINING0001

0020

Activity 20

...

3

TEST_NETWORK

1000

Test Activity 1000

...

IRelation

Index

NETWORK_ PREDECESSOR

ACTIVITY_ PREDECESSOR

NETWORK_ SUCCESSOR

ACTIVITY_ SUCCESSOR

RELATION_ TYPE

...

1

TRAINING0001

0010

TRAINING0001

0020

FS

...

2

TRAINING0001

0020

TEST_NETWORK

1000

FS

 

 

 

Testing the Interface and Displaying Diagnosis Information (from R/3 release 4.5A)

For test and diagnosis purposes you can save in a file the data that was transferred using the interface to the R/3 Project System. All entries of the table and structure parameters are saved in this trace file. The caller can use the trace file to test the interface of the Maintain BAPIs.

The trace file is stored locally by the SAPGUI. Creating a trace file consumes a lot of time. Therefore, create a trace file for test purposes only and not during a production run.

The trace file is created if you enter the Method Create and Objectype Trace commands in the IMethodProjec t table. Enter the directory and file name under Object key. Leave Refnumber empty.

Creating the trace file EPS_Test_Trace.txt in the directory C:\TMP\ .

IMethodProject

OBJECTTYPE

METHOD

OBJECTKEY

REFNUMBER

Trace

Create

C:\TMP\EPS_Test_Trace.txt

 

 

 

 

分类:

技术点:

相关文章: