using BAPI_NETWORK_MAINTAIN function module
In PM and PS modules for changing the activities and activity elements there is a bapi called BAPI_NETWORK_MAINTAIN.
send me a solution how to use this bapi to update activities and activity elements with an exapmle.
thanks in advance.
BAPI_NETWORK_MAINTAIN is one of few function modules that has pretty good documentation in SE37.
Fill I_METHOD_PROJECT with the actions you want to do.
Fill I_NETWORK with new network values.
Fill I_NETWORK_UPDATE with 'X' for each field that you have filled in I_NETWORK.
Fill I_ACTIVITY with new activity values.
Fill I_ACTIVITY_UPDATE with 'X' for each field that you have filled in I_ACTIVITY.
I_METHOD_PROJECT (is imethod in example) could look something like this:
imethod-objecttype := 'NetworkActivity'.
imethod-method := 'Update'.
imethod-refnumber := '000001'.
concatenate aufnr '0010' into imethod-objectkey.
append imethod.clear imethod.
imethod-objecttype := 'Network'.
imethod-method := 'Update'.
imethod-refnumber := '000001'.
imethod-objectkey := aufnr.
append imethod.clear imethod.
imethod-objecttype := 'Network'.
imethod-method := 'Schedule'.
imethod-refnumber := '000001'.
imethod-objectkey := aufnr.
append imethod.
clear imethod.
imethod-method := 'SaveAndWait'.
append imethod.
The refnumber is used to select the right record in the other tables.