|
|
|
|
NetworkPI
The business object network contains instructions on how to
perform tasks in a specific way, in a specific order, and in a specific period of time.
Structure
A network consists of activities that are linked by relationships.
An activity can be given more detail by using subnetworks or subactivities.
Activities or subactivities describe a task that can be processed internally or externally, or that contains costs only.
Integration A network can structure the process flow of a project, or a task in a project.
Costs are collected to the network header or to an activity.
|
|
|
|
11-Dec-2005
|
|
|
|
|
Available Methods
- ActChangeMultiple : List: Create Network Activities [ BAPI_BUS2002_ACT_CHANGE_MULTI ]
- ActCreateMultiple : List: Create Network Activities [ BAPI_BUS2002_ACT_CREATE_MULTI ]
- ActDeleteMultiple : List: Create Network Activities [ BAPI_BUS2002_ACT_DELETE_MULTI ]
- ActElemChangeMultiple : List: Change Activity Elements [ BAPI_BUS2002_ACTELEM_CHANGE_M ]
- ActElemCreateMultiple : List: Create Activity Elements [ BAPI_BUS2002_ACTELEM_CREATE_M ]
- ActElemDeleteMultiple : List: Delete Activity Elements [ BAPI_BUS2002_ACTELEM_DELETE_M ]
- ActElemGetData : Detail Data for Activity Elements [ BAPI_BUS2002_ACTELEM_GETDATA ]
- ActGetData : Detail Data for Activities [ BAPI_BUS2002_ACT_GETDATA ]
- Change : Change Network Header by BAPI [ BAPI_BUS2002_CHANGE ]
- CreateFromData : Create Network Header by BAPI [ BAPI_BUS2002_CREATE ]
- Delete : Delete Network Header by BAPI [ BAPI_BUS2002_DELETE ]
- ExistenceCheck : Check existence of object [ BAPI_NETWORK_EXISTENCECHECK ]
- GetActGuidFromKey : GetActGuidFromKey [ BAPI_BUS2002_GET_ACTGUID_4_KEY ]
- GetActKeyFromGuid : GetActKeyFromGuid [ BAPI_BUS2002_GET_ACTKEY_4_GUID ]
- GetData : Detail Data for Network Header [ BAPI_BUS2002_GETDATA ]
- Getdetail : Read detailed information for network (including all objects) [ BAPI_NETWORK_GETDETAIL ]
- GetElemGuidFromKey : GetElemGuidFromKey [ BAPI_BUS2002_GET_ELEGUID_4_KEY ]
- GetElemKeyFromGuid : GetElemKeyFromGuid [ BAPI_BUS2002_GET_ELEKEY_4_GUID ]
- GetGuidFromKey : GetGuidFromKey [ BAPI_BUS2002_GET_GUID_FROM_KEY ]
- Getinfo : Read deatiled information about networks (incl. all objects) [ BAPI_NETWORK_GETINFO ]
- GetKeyFromGuid : GetKeyFromGuid [ BAPI_BUS2002_GET_KEY_FROM_GUID ]
- Getlist : Produces a list of networks for the selection criteria [ BAPI_NETWORK_GETLIST ]
- GetStatus : Read Status for BUS2002 (Network) [ BAPI_BUS2002_GET_STATUS ]
- Maintain : Edit networks (incl. all objects) [ BAPI_NETWORK_MAINTAIN ]
- SetStatus : Set/Revoke Status for BUS2002 (Network) [ BAPI_BUS2002_SET_STATUS ]
|
|
|
|
11-Dec-2005
|
|
|
|
|
ActChangeMultiple
Change one or more activities (subobject of the BOR object typeBUS2002001). Activities of one network only can be changed each time this BAPI is called. ExampleParameter I_NUMBER Specify the network for which the activities are to be changed in parameter I_NUMBER.
The network can already exist in the database, or have been created previously in the current processing unit via BAPI"BAPI_BUS2002_CREATE". In the second case, use the temporary networknumber for internal assignment of the network number for parameter I_NUMBER.
Tables IT_ACTIVITY und IT_UPDATE_ACTIVITY Transfer a separate row in the tables IT_ACTIVITY andIT_UPDATE_ACTIVITY for each activity to be changed. The mapping of bothtable entries takes place via the activity number field (ACTIVITY) Fill the table entry in IT_ACTIVITY with the data that is to be changed for the activity.
In the table entry in IT_UPDATE_ACTIVITY flag all fields that are to be upated with the values from IT_ACTIVITY with an "X". All other fields remain unchanged even if values were assigned to themin IT_ACTIVITY. This BAPI works therefore according to the "change by
flagging" principle (refer also to the programming guide in the BAPI transaction).
Entries in table IT_UPDATE_ACTIVITY that do not have a corresopnding record in IT_ACTIVITY are ignored. Entries in table IT_ACTIVITY that do not have a corresponding record in table IT_UPDATE_ACTIVITY generate an error.
If the tables IT_ACTIVITY and/or IT_UPDATE_ACTIVITY contain severalentries with the same key ACTIVITY, system behaviour is undefined because unique mapping is not possible.Field NOT_MRP_APPLICABLE With this field you control the 'Res/PurcRq' field in the network
header , activity, or activity element. Possible values are:'1' or 'X': Never relevant to materials planning '2': Relevant to materials planning after release '3': Relevant to materials planning immediately
For the default value ' ' (SPACE) the following applies: In create mode: The default is specified for the field analogous to thedialog in Customizing or inherited from the higher-level object. In change mode: The value ' ' acts like the value '3' (Relevant to materials planning immediately).
SPACE is a selective value here, since you must set the parameteradditionally in the I_NETWORK_UPD structure. This is not the case in create mode. Anything else you enter generates the error CNIF_PI088.
Fields DESCRIPTION and STD_TEXT_KEY If you enter a description (field DESCRIPTION) and a standard text key(field STD_TEXT_KEY) for the activity simultaneously, the system uses the first line of the standard text key. The standard text key work according to the 'overwrite existing text'
principle. This corresponds to the default answer 'yes' from the dialog.Temporary activity An activity to be changed can already exist in the database or havebeen created previously in the current processing unit via BAPI_BUS2002_ACT_CREATE_MULTI. You can change an activity within a
processing unit several times via BAPI BAPI_BUS2002_ACT_CHANGE_MULTI.Return table ET_RETURN Messages from the application and a success or error message arereturned by the BAPI to the caller in the return table ET_RETURN. InET_RETURN, the messages are collected together in blocks per activity.
Each message block refers therefore to an activity and starts with a summarized success or error message.Notes- Definition "Processing Unit"
In the following, the term "Processing unit" refers to a series of related processing steps.
The first step in a processing unit is initialization, which is done by calling the BAPI BAPI_PS_INITIALIZATION. Afterwards, the individual BAPIs listed below can be used several times, if required. The processing unit ends when the final precommit (call BAPI BAPI_PS_PRECOMMIT) is executed with a subsequent
COMMIT WORK (for example, the statement COMMIT WORK, the BAPI"BAPI_TRANSACTION_COMMIT" or the BapiService.TransactionCommit method). After the final COMMIT WORK, the next initialization opens a new processing unit via the BAPI "BAPI_PS_INITIALIZATION".
In principal, the following applies to each individual processing unit.
- Creation of a Processing Unit
Each processing unit must be initialized by calling the BAPI "BAPI_PS_INITIALIZATION" once. Afterwards, the following individual BAPIs can be used within a
processing unit - they can also be used more than once, taking intoaccount the "One-Project Principle" explained below. This also meansthat an object created in the current processing unit by a CREATE-BAPI can be changed by a CHANGE-BAPI or STATUS-BAPI.
Except for the BAPIs explicitly named below, you can only call up BAPIsthat execute GET methods or READ methods only. In particular, the BAPIs for confirming a network may not be used with the individual BAPIs named below. Business Object ProjectDefinitionPI
BAPI Method BAPI_BUS2001_CREATE ProjectDefinitionPI.CreateSingle BAPI_BUS2001_CHANGE ProjectDefinitionPI.Change BAPI_BUS2001_DELETE ProjectDefinitionPI.Delete BAPI_BUS2001_SET_STATUS ProjectDefinitionPI.SetStatus
BAPI_BUS2001_PARTNER_CREATE_M ProjectDefinitionPI.PartnerCreateMultiple BAPI_BUS2001_PARTNER_CHANGE_M ProjectDefinitionPI.PartnerChangeMultiple BAPI_BUS2001_PARTNER_REMOVE_M ProjectDefinitionPI.PartnerRemoveMultiple Business Object WBSPI
BAPI Method BAPI_BUS2054_CREATE_MULTI WBSPI.CreateMultiple BAPI_BUS2054_CHANGE_MULTI WBSPI.ChangeMultiple BAPI_BUS2054_DELETE_MULTI WBSPI.DeleteMultiple BAPI_BUS2001_SET_STATUS WBSPI.SetStatus
Business Object NetworkPI BAPI Method BAPI_BUS2002_CREATE NetworkPI.CreateFromData BAPI_BUS2002_CHANGE NetworkPI.Change BAPI_BUS2002_DELETE NetworkPI.Delete BAPI_BUS2002_ACT_CREATE_MULTI NetworkPI.ActCreateMultiple
BAPI_BUS2002_ACT_CHANGE_MULTI NetworkPI.ActChangeMultiple BAPI_BUS2002_ACT_DELETE_MULTI NetworkPI.ActDeleteMultiple BAPI_BUS2002_ACTELEM_CREATE_M NetworkPI.ActElemCreateMultiple BAPI_BUS2002_ACTELEM_CHANGE_M NetworkPI.ActElemChangeMultiple
BAPI_BUS2002_ACTELEM_DELETE_M NetworkPI.ActElemDeleteMultiple BAPI_BUS2002_SET_STATUS NetworkPI.SetStatus The processing unit must be finished by calling the BAPIs BAPI_PS_PRECOMMIT and BAPI_TRANSACTION_COMMIT (in that order).
- One-Project Principle
For technical reasons, only the project definition and the WBS elementsof one project can be processed in a processing unit. More than one project is used, for example, if You create or change more than one project
You have changed a project and want to change a network to which WBS elements from a different project are assignedYou want to change various networks to which WBS elements from different projects are assignedYou create or change a WBS assignment in a network so that a WBS element from a second project is used
WBS elements from different projects are already assigned to a network (note: this type of network cannot be processed with the network BAPIs named above).If you define a report for calling BAPIs, this means that: The report may use a maximum of one project per processing unit. The
individual BAPI calls must be distributed between more than one processing unit, which use a maximum of one project per processingunit.
- All-Or-Nothing Principle
If an error occurs in a processing unit in an individual BAPI or in the
BAPI "BAPI_PS_PRECOMMIT" (that is, the return table ET_RETURN containsat least one message of the type "E" (error), "A" (abnormal end) or "X" (exit), posting is not possible. If an error occurs in an individual BAPI and despite this you call theBAPI "BAPI_PS_PRECOMMIT", message CNIF_PI 056 is issued with message type I (information).
If an error occurs in an individual BAPI or in the BAPI "BAPI_PS_PRECOMMIT", but despite this you execute a COMMIT WORK, theprogram that is currently in process is terminated and message CNIF_PI 056 is issued with message type X. This is to ensure data consistency for all objects created, changed, and/or deleted in the processing unit.
Note that the processing unit to which this happens can no longer besuccessfully closed and therefore, no new processing unit can be started. However, you can set the current processing unit back to an initializedstatus by using a rollback work (for example, statement ROLLBACK WORK, the BAPI "BAPI_TRANSACTION_ROLLBACK" or the method
BapiService.TransactionRollback). Technically speaking, this means thatthe previous LUW is terminated and a new LUW is started in the current processing unit. Note that in this case, the current processing unit does not have to be re-initialized. Also note that the rollback also takes place according to the "all-or-nothing" principle, that therefore all
individual BAPIs carried out up to the rollback are discarded. After a rollback, youcan, therefore, no longer refer to an object that was previously created in the current processing unit using a CREATE-BAPI. However, you can close the processing unit again after a rollback,
using a PRECOMMIT and COMMIT WORK, as long as all individual BAPIs, andthe precommit carried out after the rollback, finish without errors. You can carry out several rollbacks in a processing unit (technically: start a new LUW several times).
- Procedure in the Case of Errors
As soon as an error occurs in an individual BAPI or in the BAPI "BAPI_PS_PRECOMMIT", you have the following options: Exit the report or the program that calls the BAPIs, the PRECOMMIT and the COMMIT WORK.
Execute a rollback in the current processing unit.
- Rules for Posting
After you have successfully called the individual BAPIs of a processingunit, you must call the PRECOMMIT "BAPI_PS_PRECOMMIT". If the PRECOMMIT is also successful, the COMMIT WORK must take place directly afterwards.
In particular, note that after the PRECOMMIT, you cannot call other individual BAPIs again in the current processing unit. It is also not permitted to call the PRECOMMIT more than once in a processing unit.
- Recommendation "COMMIT WORK AND WAIT"
If an object created in a processing unit is to be used in a subsequentprocessing unit (for example, as an account assignment object in a G/Laccount posting) it is recommended to call the commit work with the supplement "AND WAIT" or to set the parameters for the BAPI
"BAPI_TRANSACTION_COMMIT" accordingly.
- Field Selection
The field selection is a tool for influencing the user interface (thatis, for the dialog). In the BAPIs, the settings from the field selection (for example, fields that are not ready for input or
required-entry) are not taken into account.
- Using a date in the BAPI interface
You must communicate the date using the internal format YYYYMMDD (year month day) to the BAPI. Ensure that you do not use any special characters.
Since a BAPI must function in a user-specific way, you cannot and maynot convert the date according to the user and according to the date format defined in the user parameters.
- Customer Enhancements of the BAPIs
For the BAPIs used to create and change project definitions, WBSelements, networks, activities, and activity elements, you canautomatically fill the fields of the tables PROJ, PRPS, AUFK, and AFVUthat have been defined for customer enhancements in the standard system.
For this purpose, help structures that contain the respective keyfields, as well as the CI include of the table are supplied. The BAPIscontain the parameter ExtensionIN in which the enhancement fields canbe entered and also provide BAdIs in which the entered values can be checked and, if required, processed further.
CI Include Help Structure Key CI_PROJ BAPI_TE_PROJECT_DEFINITION PROJECT_DEFINITION CI_PRPS BAPI_TE_WBS_ELEMENT WBS_ELEMENT CI_AUFK BAPI_TE_NETWORK
NETWORK CI_AFVU BAPI_TE_NETWORK_ACTIVITY NETWORK ACTIVITY CI_AFVU BAPI_TE_NETWORK_ACT_ELEMENT NETWORK ACTIVITY ELEMENT
Procedure for Filling Standard EnhancementsBefore you call the BAPI for each object that is to be created or changed, for which you want to enter customer-specific table
enhancement fields, add a data record to the container ExtensionIn: STRUCTURE: Name of the corresponding help structureVALUEPART1: Key of the object + start of the data partVALUEPART2-4: If required, the continuation of the data part
VALUPART1 to VALUPART4 are therefore filled consecutively, first withthe keys that identify the table rows and then with the values of thecustomer-specific fields. By structuring the container in this way, itis possible to transfer its content with one MOVE command to the structure of the BAPI table extension.
Note that when objects are changed, all fields of theenhancements are overwritten (as opposed to the standard fields, whereonly those fields for which the respective update indicator is set arechanged). Therefore, even if you only want to change one field, all the fields that you transfer in ExtensionIn must be filled.
Checks and Further ProcessingUsing the methods ...CREATE_EXIT1 or. ...CHANGE_EXIT1 of the BAdIBAPIEXT_BUS2001, BAPIEXT_BUS2002, and BAPIEXT_BUS2054, you can check the entered values (and/or carry out other checks). In the BAdI's second method, you can program that the data transferred
to the BAPI is processed further (if you only want to transfer the fields of the CI includes, no more action is required here).
For more information, refer to the SAP Library under Cross-ApplicationComponents -> Business Framework Architecture -> Enhancements,
Modifications ... -> Customer Enhancement and Modification of BAPIs -> Customer Enhancement of BAPIs (CA-BFA).
|
|
|
|
11-Dec-2005
|
|
|
|
|
ActCreateMultiple
Create one or more activities (subobject of the BOR object typeBUS2002001). Activities of one network only can be changed each time this BAPI is called. ExampleParameter I_NUMBER Specify the network for which the activities are to be created in the parameter I_NUMBER.
The network can already exist in the database or have been createdpreviously in the current processing unit via BAPI BAPI_BUS2002_CREATE.In the second case, use the temporary network number for the internal network number assignment for parameter I_NUMBER.
Tabelle IT_ACTIVITY Transfer the data for each new activity element to be created in a separate row in table IT_ACTIVITY. The activity number in the field ACTIVITY is a required-entry field.Note that this activity number in the network must be unique for all activities and activity elements.
Field CONTROL_KEY Initially the CONTROL_KEY field for the control key is not a required-entry field. If you do not transfer a value in the CONTROL_KEY field, an internallyprocessed activity element is created with the control key from the network profile for the activity type "internal". However, if a
corresponding control key is not defined in the network profile, the CONTROL_KEY becomes a required-entry field.Field NOT_MRP_APPLICABLE With this field you control the 'Res/PurcRq' field in the networkheader , activity, or activity element. Possible values are:
'1' or 'X': Never relevant to materials planning '2': Relevant to materials planning after release '3': Relevant to materials planning immediately
For the default value ' ' (SPACE) the following applies: In create mode: The default is specified for the field analogous to thedialog in Customizing or inherited from the higher-level object. In change mode: The value ' ' acts like the value '3' (Relevant to materials planning immediately).
SPACE is a selective value here, since you must set the parameteradditionally in the I_NETWORK_UPD structure. This is not the case in create mode. Anything else you enter generates the error CNIF_PI088.
Fields DESCRIPTION and STD_TEXT_KEY If you enter a description (field DESCRIPTION) and a standard text key(field STD_TEXT_KEY) for the activity simultaneously, the system uses the first line of the standard text key. The standard text key work according to the 'overwrite existing text'
principle. This corresponds to the default answer 'yes' from the dialog.Return table ET_RETURN Messages from the application and a success or error message arereturned by the BAPI to the caller in the return table ET_RETURN. InET_RETURN, the messages are collected together in blocks per activity.
Each message block refers therefore to an activity and starts with a summarized success or error message.Notes- Definition "Processing Unit"
In the following, the term "Processing unit" refers to a series of related processing steps.
The first step in a processing unit is initialization, which is done by calling the BAPI BAPI_PS_INITIALIZATION. Afterwards, the individual BAPIs listed below can be used several times, if required. The processing unit ends when the final precommit (call BAPI BAPI_PS_PRECOMMIT) is executed with a subsequent
COMMIT WORK (for example, the statement COMMIT WORK, the BAPI"BAPI_TRANSACTION_COMMIT" or the BapiService.TransactionCommit method). After the final COMMIT WORK, the next initialization opens a new processing unit via the BAPI "BAPI_PS_INITIALIZATION".
In principal, the following applies to each individual processing unit.
- Creation of a Processing Unit
Each processing unit must be initialized by calling the BAPI "BAPI_PS_INITIALIZATION" once. Afterwards, the following individual BAPIs can be used within a
processing unit - they can also be used more than once, taking intoaccount the "One-Project Principle" explained below. This also meansthat an object created in the current processing unit by a CREATE-BAPI can be changed by a CHANGE-BAPI or STATUS-BAPI.
Except for the BAPIs explicitly named below, you can only call up BAPIsthat execute GET methods or READ methods only. In particular, the BAPIs for confirming a network may not be used with the individual BAPIs named below. Business Object ProjectDefinitionPI
BAPI Method BAPI_BUS2001_CREATE ProjectDefinitionPI.CreateSingle BAPI_BUS2001_CHANGE ProjectDefinitionPI.Change BAPI_BUS2001_DELETE ProjectDefinitionPI.Delete BAPI_BUS2001_SET_STATUS ProjectDefinitionPI.SetStatus
BAPI_BUS2001_PARTNER_CREATE_M ProjectDefinitionPI.PartnerCreateMultiple BAPI_BUS2001_PARTNER_CHANGE_M ProjectDefinitionPI.PartnerChangeMultiple BAPI_BUS2001_PARTNER_REMOVE_M ProjectDefinitionPI.PartnerRemoveMultiple Business Object WBSPI
BAPI Method BAPI_BUS2054_CREATE_MULTI WBSPI.CreateMultiple BAPI_BUS2054_CHANGE_MULTI WBSPI.ChangeMultiple BAPI_BUS2054_DELETE_MULTI WBSPI.DeleteMultiple BAPI_BUS2001_SET_STATUS WBSPI.SetStatus
Business Object NetworkPI BAPI Method BAPI_BUS2002_CREATE NetworkPI.CreateFromData BAPI_BUS2002_CHANGE NetworkPI.Change BAPI_BUS2002_DELETE NetworkPI.Delete BAPI_BUS2002_ACT_CREATE_MULTI NetworkPI.ActCreateMultiple
BAPI_BUS2002_ACT_CHANGE_MULTI NetworkPI.ActChangeMultiple BAPI_BUS2002_ACT_DELETE_MULTI NetworkPI.ActDeleteMultiple BAPI_BUS2002_ACTELEM_CREATE_M NetworkPI.ActElemCreateMultiple BAPI_BUS2002_ACTELEM_CHANGE_M NetworkPI.ActElemChangeMultiple
BAPI_BUS2002_ACTELEM_DELETE_M NetworkPI.ActElemDeleteMultiple BAPI_BUS2002_SET_STATUS NetworkPI.SetStatus The processing unit must be finished by calling the BAPIs BAPI_PS_PRECOMMIT and BAPI_TRANSACTION_COMMIT (in that order).
- One-Project Principle
For technical reasons, only the project definition and the WBS elementsof one project can be processed in a processing unit. More than one project is used, for example, if You create or change more than one project
You have changed a project and want to change a network to which WBS elements from a different project are assignedYou want to change various networks to which WBS elements from different projects are assignedYou create or change a WBS assignment in a network so that a WBS element from a second project is used
WBS elements from different projects are already assigned to a network (note: this type of network cannot be processed with the network BAPIs named above).If you define a report for calling BAPIs, this means that: The report may use a maximum of one project per processing unit. The
individual BAPI calls must be distributed between more than one processing unit, which use a maximum of one project per processingunit.
- All-Or-Nothing Principle
If an error occurs in a processing unit in an individual BAPI or in the
BAPI "BAPI_PS_PRECOMMIT" (that is, the return table ET_RETURN containsat least one message of the type "E" (error), "A" (abnormal end) or "X" (exit), posting is not possible. If an error occurs in an individual BAPI and despite this you call theBAPI "BAPI_PS_PRECOMMIT", message CNIF_PI 056 is issued with message type I (information).
If an error occurs in an individual BAPI or in the BAPI "BAPI_PS_PRECOMMIT", but despite this you execute a COMMIT WORK, theprogram that is currently in process is terminated and message CNIF_PI 056 is issued with message type X. This is to ensure data consistency for all objects created, changed, and/or deleted in the processing unit.
Note that the processing unit to which this happens can no longer besuccessfully closed and therefore, no new processing unit can be started. However, you can set the current processing unit back to an initializedstatus by using a rollback work (for example, statement ROLLBACK WORK, the BAPI "BAPI_TRANSACTION_ROLLBACK" or the method
BapiService.TransactionRollback). Technically speaking, this means thatthe previous LUW is terminated and a new LUW is started in the current processing unit. Note that in this case, the current processing unit does not have to be re-initialized. Also note that the rollback also takes place according to the "all-or-nothing" principle, that therefore all
individual BAPIs carried out up to the rollback are discarded. After a rollback, youcan, therefore, no longer refer to an object that was previously created in the current processing unit using a CREATE-BAPI. However, you can close the processing unit again after a rollback,
using a PRECOMMIT and COMMIT WORK, as long as all individual BAPIs, andthe precommit carried out after the rollback, finish without errors. You can carry out several rollbacks in a processing unit (technically: start a new LUW several times).
- Procedure in the Case of Errors
As soon as an error occurs in an individual BAPI or in the BAPI "BAPI_PS_PRECOMMIT", you have the following options: Exit the report or the program that calls the BAPIs, the PRECOMMIT and the COMMIT WORK.
Execute a rollback in the current processing unit.
- Rules for Posting
After you have successfully called the individual BAPIs of a processingunit, you must call the PRECOMMIT "BAPI_PS_PRECOMMIT". If the PRECOMMIT is also successful, the COMMIT WORK must take place directly afterwards.
In particular, note that after the PRECOMMIT, you cannot call other individual BAPIs again in the current processing unit. It is also not permitted to call the PRECOMMIT more than once in a processing unit.
- Recommendation "COMMIT WORK AND WAIT"
If an object created in a processing unit is to be used in a subsequentprocessing unit (for example, as an account assignment object in a G/Laccount posting) it is recommended to call the commit work with the supplement "AND WAIT" or to set the parameters for the BAPI
"BAPI_TRANSACTION_COMMIT" accordingly.
- Field Selection
The field selection is a tool for influencing the user interface (thatis, for the dialog). In the BAPIs, the settings from the field selection (for example, fields that are not ready for input or
required-entry) are not taken into account.
- Using a date in the BAPI interface
You must communicate the date using the internal format YYYYMMDD (year month day) to the BAPI. Ensure that you do not use any special characters.
Since a BAPI must function in a user-specific way, you cannot and maynot convert the date according to the user and according to the date format defined in the user parameters.
- Customer Enhancements of the BAPIs
For the BAPIs used to create and change project definitions, WBSelements, networks, activities, and activity elements, you canautomatically fill the fields of the tables PROJ, PRPS, AUFK, and AFVUthat have been defined for customer enhancements in the standard system.
For this purpose, help structures that contain the respective keyfields, as well as the CI include of the table are supplied. The BAPIscontain the parameter ExtensionIN in which the enhancement fields canbe entered and also provide BAdIs in which the entered values can be checked and, if required, processed further.
CI Include Help Structure Key CI_PROJ BAPI_TE_PROJECT_DEFINITION PROJECT_DEFINITION CI_PRPS BAPI_TE_WBS_ELEMENT WBS_ELEMENT CI_AUFK BAPI_TE_NETWORK
NETWORK CI_AFVU BAPI_TE_NETWORK_ACTIVITY NETWORK ACTIVITY CI_AFVU BAPI_TE_NETWORK_ACT_ELEMENT NETWORK ACTIVITY ELEMENT
Procedure for Filling Standard EnhancementsBefore you call the BAPI for each object that is to be created or changed, for which you want to enter customer-specific table
enhancement fields, add a data record to the container ExtensionIn: STRUCTURE: Name of the corresponding help structureVALUEPART1: Key of the object + start of the data partVALUEPART2-4: If required, the continuation of the data part
VALUPART1 to VALUPART4 are therefore filled consecutively, first withthe keys that identify the table rows and then with the values of thecustomer-specific fields. By structuring the container in this way, itis possible to transfer its content with one MOVE command to the structure of the BAPI table extension.
Note that when objects are changed, all fields of theenhancements are overwritten (as opposed to the standard fields, whereonly those fields for which the respective update indicator is set arechanged). Therefore, even if you only want to change one field, all the fields that you transfer in ExtensionIn must be filled.
Checks and Further ProcessingUsing the methods ...CREATE_EXIT1 or. ...CHANGE_EXIT1 of the BAdIBAPIEXT_BUS2001, BAPIEXT_BUS2002, and BAPIEXT_BUS2054, you can check the entered values (and/or carry out other checks). In the BAdI's second method, you can program that the data transferred
to the BAPI is processed further (if you only want to transfer the fields of the CI includes, no more action is required here).
For more information, refer to the SAP Library under Cross-ApplicationComponents -> Business Framework Architecture -> Enhancements,
Modifications ... -> Customer Enhancement and Modification of BAPIs -> Customer Enhancement of BAPIs (CA-BFA).
|
|
|
|
11-Dec-2005
|
|
|
|
|
ActDeleteMultiple
Delete network activities (subobject of BOR object BUS2002). ExampleThe network to which the activities to be deleted belong is specifiedby the parameter number. The multiline parameter IT_DELETE_ACTIVITY contains a list of activities to be deleted.
Messages from the application and a success or failure message, asappropriate, are returned to the caller by the BAPI in the multiline parameter RETURN. You can process only one network each time you call up this BAPI. Before the network activities can be deleted, various checks are carried out, for example:
Have the activities already been confirmed or partially confirmed?Deletion authorizationAre there already actual postings?Are there already purchase orders?Check for dependent objects: activity elements, subnetworks, relationships, material components, milestones, production
resources/tools, PS texts, and document assignments.If all checks are successful, the activities and all dependent objects are deleted. Notes- Definition "Processing Unit"
In the following, the term "Processing unit" refers to a series of related processing steps.
The first step in a processing unit is initialization, which is done by calling the BAPI BAPI_PS_INITIALIZATION. Afterwards, the individual BAPIs listed below can be used several times, if required. The processing unit ends when the final precommit (call BAPI BAPI_PS_PRECOMMIT) is executed with a subsequent
COMMIT WORK (for example, the statement COMMIT WORK, the BAPI"BAPI_TRANSACTION_COMMIT" or the BapiService.TransactionCommit method). After the final COMMIT WORK, the next initialization opens a new processing unit via the BAPI "BAPI_PS_INITIALIZATION".
In principal, the following applies to each individual processing unit.
- Creation of a Processing Unit
Each processing unit must be initialized by calling the BAPI "BAPI_PS_INITIALIZATION" once. Afterwards, the following individual BAPIs can be used within a
processing unit - they can also be used more than once, taking intoaccount the "One-Project Principle" explained below. This also meansthat an object created in the current processing unit by a CREATE-BAPI can be changed by a CHANGE-BAPI or STATUS-BAPI.
Except for the BAPIs explicitly named below, you can only call up BAPIsthat execute GET methods or READ methods only. In particular, the BAPIs for confirming a network may not be used with the individual BAPIs named below. Business Object ProjectDefinitionPI
BAPI Method BAPI_BUS2001_CREATE ProjectDefinitionPI.CreateSingle BAPI_BUS2001_CHANGE ProjectDefinitionPI.Change BAPI_BUS2001_DELETE ProjectDefinitionPI.Delete BAPI_BUS2001_SET_STATUS ProjectDefinitionPI.SetStatus
BAPI_BUS2001_PARTNER_CREATE_M ProjectDefinitionPI.PartnerCreateMultiple BAPI_BUS2001_PARTNER_CHANGE_M ProjectDefinitionPI.PartnerChangeMultiple BAPI_BUS2001_PARTNER_REMOVE_M ProjectDefinitionPI.PartnerRemoveMultiple Business Object WBSPI
BAPI Method BAPI_BUS2054_CREATE_MULTI WBSPI.CreateMultiple BAPI_BUS2054_CHANGE_MULTI WBSPI.ChangeMultiple BAPI_BUS2054_DELETE_MULTI WBSPI.DeleteMultiple BAPI_BUS2001_SET_STATUS WBSPI.SetStatus
Business Object NetworkPI BAPI Method BAPI_BUS2002_CREATE NetworkPI.CreateFromData BAPI_BUS2002_CHANGE NetworkPI.Change BAPI_BUS2002_DELETE NetworkPI.Delete BAPI_BUS2002_ACT_CREATE_MULTI NetworkPI.ActCreateMultiple
BAPI_BUS2002_ACT_CHANGE_MULTI NetworkPI.ActChangeMultiple BAPI_BUS2002_ACT_DELETE_MULTI NetworkPI.ActDeleteMultiple BAPI_BUS2002_ACTELEM_CREATE_M NetworkPI.ActElemCreateMultiple BAPI_BUS2002_ACTELEM_CHANGE_M NetworkPI.ActElemChangeMultiple
BAPI_BUS2002_ACTELEM_DELETE_M NetworkPI.ActElemDeleteMultiple BAPI_BUS2002_SET_STATUS NetworkPI.SetStatus The processing unit must be finished by calling the BAPIs BAPI_PS_PRECOMMIT and BAPI_TRANSACTION_COMMIT (in that order).
- One-Project Principle
For technical reasons, only the project definition and the WBS elementsof one project can be processed in a processing unit. More than one project is used, for example, if You create or change more than one project
You have changed a project and want to change a network to which WBS elements from a different project are assignedYou want to change various networks to which WBS elements from different projects are assignedYou create or change a WBS assignment in a network so that a WBS element from a second project is used
WBS elements from different projects are already assigned to a network (note: this type of network cannot be processed with the network BAPIs named above).If you define a report for calling BAPIs, this means that: The report may use a maximum of one project per processing unit. The
individual BAPI calls must be distributed between more than one processing unit, which use a maximum of one project per processingunit.
- All-Or-Nothing Principle
If an error occurs in a processing unit in an individual BAPI or in the
BAPI "BAPI_PS_PRECOMMIT" (that is, the return table ET_RETURN containsat least one message of the type "E" (error), "A" (abnormal end) or "X" (exit), posting is not possible. If an error occurs in an individual BAPI and despite this you call theBAPI "BAPI_PS_PRECOMMIT", message CNIF_PI 056 is issued with message type I (information).
If an error occurs in an individual BAPI or in the BAPI "BAPI_PS_PRECOMMIT", but despite this you execute a COMMIT WORK, theprogram that is currently in process is terminated and message CNIF_PI 056 is issued with message type X. This is to ensure data consistency for all objects created, changed, and/or deleted in the processing unit.
Note that the processing unit to which this happens can no longer besuccessfully closed and therefore, no new processing unit can be started. However, you can set the current processing unit back to an initializedstatus by using a rollback work (for example, statement ROLLBACK WORK, the BAPI "BAPI_TRANSACTION_ROLLBACK" or the method
BapiService.TransactionRollback). Technically speaking, this means thatthe previous LUW is terminated and a new LUW is started in the current processing unit. Note that in this case, the current processing unit does not have to be re-initialized. Also note that the rollback also takes place according to the "all-or-nothing" principle, that therefore all
individual BAPIs carried out up to the rollback are discarded. After a rollback, youcan, therefore, no longer refer to an object that was previously created in the current processing unit using a CREATE-BAPI. However, you can close the processing unit again after a rollback,
using a PRECOMMIT and COMMIT WORK, as long as all individual BAPIs, andthe precommit carried out after the rollback, finish without errors. You can carry out several rollbacks in a processing unit (technically: start a new LUW several times).
- Procedure in the Case of Errors
As soon as an error occurs in an individual BAPI or in the BAPI "BAPI_PS_PRECOMMIT", you have the following options: Exit the report or the program that calls the BAPIs, the PRECOMMIT and the COMMIT WORK.
Execute a rollback in the current processing unit.
- Rules for Posting
After you have successfully called the individual BAPIs of a processingunit, you must call the PRECOMMIT "BAPI_PS_PRECOMMIT". If the PRECOMMIT is also successful, the COMMIT WORK must take place directly afterwards.
In particular, note that after the PRECOMMIT, you cannot call other individual BAPIs again in the current processing unit. It is also not permitted to call the PRECOMMIT more than once in a processing unit.
- Recommendation "COMMIT WORK AND WAIT"
If an object created in a processing unit is to be used in a subsequentprocessing unit (for example, as an account assignment object in a G/Laccount posting) it is recommended to call the commit work with the supplement "AND WAIT" or to set the parameters for the BAPI
"BAPI_TRANSACTION_COMMIT" accordingly.
- Field Selection
The field selection is a tool for influencing the user interface (thatis, for the dialog). In the BAPIs, the settings from the field selection (for example, fields that are not ready for input or
required-entry) are not taken into account.
- Using a date in the BAPI interface
You must communicate the date using the internal format YYYYMMDD (year month day) to the BAPI. Ensure that you do not use any special characters.
Since a BAPI must function in a user-specific way, you cannot and maynot convert the date according to the user and according to the date format defined in the user parameters.
- Customer Enhancements of the BAPIs
For the BAPIs used to create and change project definitions, WBSelements, networks, activities, and activity elements, you canautomatically fill the fields of the tables PROJ, PRPS, AUFK, and AFVUthat have been defined for customer enhancements in the standard system.
For this purpose, help structures that contain the respective keyfields, as well as the CI include of the table are supplied. The BAPIscontain the parameter ExtensionIN in which the enhancement fields canbe entered and also provide BAdIs in which the entered values can be checked and, if required, processed further.
CI Include Help Structure Key CI_PROJ BAPI_TE_PROJECT_DEFINITION PROJECT_DEFINITION CI_PRPS BAPI_TE_WBS_ELEMENT WBS_ELEMENT CI_AUFK BAPI_TE_NETWORK
NETWORK CI_AFVU BAPI_TE_NETWORK_ACTIVITY NETWORK ACTIVITY CI_AFVU BAPI_TE_NETWORK_ACT_ELEMENT NETWORK ACTIVITY ELEMENT
Procedure for Filling Standard EnhancementsBefore you call the BAPI for each object that is to be created or changed, for which you want to enter customer-specific table
enhancement fields, add a data record to the container ExtensionIn: STRUCTURE: Name of the corresponding help structureVALUEPART1: Key of the object + start of the data partVALUEPART2-4: If required, the continuation of the data part
VALUPART1 to VALUPART4 are therefore filled consecutively, first withthe keys that identify the table rows and then with the values of thecustomer-specific fields. By structuring the container in this way, itis possible to transfer its content with one MOVE command to the structure of the BAPI table extension.
Note that when objects are changed, all fields of theenhancements are overwritten (as opposed to the standard fields, whereonly those fields for which the respective update indicator is set arechanged). Therefore, even if you only want to change one field, all the fields that you transfer in ExtensionIn must be filled.
Checks and Further ProcessingUsing the methods ...CREATE_EXIT1 or. ...CHANGE_EXIT1 of the BAdIBAPIEXT_BUS2001, BAPIEXT_BUS2002, and BAPIEXT_BUS2054, you can check the entered values (and/or carry out other checks). In the BAdI's second method, you can program that the data transferred
to the BAPI is processed further (if you only want to transfer the fields of the CI includes, no more action is required here).
For more information, refer to the SAP Library under Cross-ApplicationComponents -> Business Framework Architecture -> Enhancements,
Modifications ... -> Customer Enhancement and Modification of BAPIs -> Customer Enhancement of BAPIs (CA-BFA).
|
|
|
|
11-Dec-2005
|
|
|
|
|
ActElemChangeMultiple
Change one or more activity elements (subobject of the BOR object typeBUS2002001). Each time this BAPI is called, only the activity elements for one network can be changed. ExampleParameter I_NUMBER Specify the network for which the activity elements are to be changed in parameter I_NUMBER.
The network can already exist in the database or have been created previously in the current processing unit via BAPIBAPI_BUS2002_CREATE. In the second case, use the temporary networknumber for internal assignment of the network number for parameter I_NUMBER.
Tables IT_ACT_ELEMENT and IT_UPDATE_ACT_ELEMENT Transfer a row for each activity element to be changed in the tablesIT_ACT_ELEMENT and IT_UPDATE_ACT_ELEMENT. The mapping of both tableentries takes place via the activity element number field (ELEMENT).
Fill the table entry in IT_ACT_ELEMENT with the data of the activity element that is to be changed. In the table entry in IT_UPDATE_ACT_ELEMENT, flag all fields that are to be updated with the values from IT_ACT_ELEMENT with an "X". All other fields remain unchanged, even if new values have been
assigned to them in IT_ACT_ELEMENT. This BAPI therefore works accordingto the "change by flagging" principle (refer also to the programming guide in transaction BAPI).
Entries in table IT_UPDATE_ACT_ELEMENT that do not have a corresponding record in table IT_ACT_ELEMENT are ignored.
Entries in table IT_ACT_ELEMENT that do not have a corresponding record in table IT_UPDATE_ACT_ELEMENT generate an error.
If the tables IT_ACT_ELEMENT and/or IT_UPDATE_ACT_ELEMENT each containseveral entries with the same key ELEMENT, system behaviour is undefined because unique mapping is not possible.
Temporary activity element An activity element to be changed can already exist in the database orhave been created previously in the current processing unit via BAPIBAPI_BUS2002_ACTELEM_CREATE_M. You can change an activity element several times within a processing unit via BAPI
BAPI_BUS2002_ACTELEM_CHANGE_M.Field NOT_MRP_APPLICABLE With this field you control the 'Res/PurcRq' field in the networkheader , activity, or activity element. Possible values are:'1' or 'X': Never relevant to materials planning
'2': Relevant to materials planning after release '3': Relevant to materials planning immediately For the default value ' ' (SPACE) the following applies:
In create mode: The default is specified for the field analogous to thedialog in Customizing or inherited from the higher-level object. In change mode: The value ' ' acts like the value '3' (Relevant to materials planning immediately).
SPACE is a selective value here, since you must set the parameteradditionally in the I_NETWORK_UPD structure. This is not the case in create mode. Anything else you enter generates the error CNIF_PI088.
Messages from the application and a success or error message arereturned to the caller by the BAPI in the return table ET_RETURN. InET_RETURN, the messages are grouped together in blocks per activityelement. Each message block refers therefore to an activity element and starts with a summarized success or error message.
Notes- Definition "Processing Unit"
In the following, the term "Processing unit" refers to a series of related processing steps. The first step in a processing unit is initialization, which is done by calling the BAPI BAPI_PS_INITIALIZATION.
Afterwards, the individual BAPIs listed below can be used several times, if required. The processing unit ends when the final precommit (call BAPI BAPI_PS_PRECOMMIT) is executed with a subsequentCOMMIT WORK (for example, the statement COMMIT WORK, the BAPI
"BAPI_TRANSACTION_COMMIT" or the BapiService.TransactionCommit method). After the final COMMIT WORK, the next initialization opens a new processing unit via the BAPI "BAPI_PS_INITIALIZATION". In principal, the following applies to each individual processing unit.
- Creation of a Processing Unit
Each processing unit must be initialized by calling the BAPI "BAPI_PS_INITIALIZATION" once. Afterwards, the following individual BAPIs can be used within aprocessing unit - they can also be used more than once, taking into
account the "One-Project Principle" explained below. This also meansthat an object created in the current processing unit by a CREATE-BAPI can be changed by a CHANGE-BAPI or STATUS-BAPI. Except for the BAPIs explicitly named below, you can only call up BAPIs
that execute GET methods or READ methods only. In particular, the BAPIs for confirming a network may not be used with the individual BAPIs named below. Business Object ProjectDefinitionPI BAPI Method
BAPI_BUS2001_CREATE ProjectDefinitionPI.CreateSingle BAPI_BUS2001_CHANGE ProjectDefinitionPI.Change BAPI_BUS2001_DELETE ProjectDefinitionPI.Delete BAPI_BUS2001_SET_STATUS ProjectDefinitionPI.SetStatus BAPI_BUS2001_PARTNER_CREATE_M ProjectDefinitionPI.PartnerCreateMultiple
BAPI_BUS2001_PARTNER_CHANGE_M ProjectDefinitionPI.PartnerChangeMultiple BAPI_BUS2001_PARTNER_REMOVE_M ProjectDefinitionPI.PartnerRemoveMultiple Business Object WBSPI BAPI Method
BAPI_BUS2054_CREATE_MULTI WBSPI.CreateMultiple BAPI_BUS2054_CHANGE_MULTI WBSPI.ChangeMultiple BAPI_BUS2054_DELETE_MULTI WBSPI.DeleteMultiple BAPI_BUS2001_SET_STATUS WBSPI.SetStatus Business Object NetworkPI
BAPI Method BAPI_BUS2002_CREATE NetworkPI.CreateFromData BAPI_BUS2002_CHANGE NetworkPI.Change BAPI_BUS2002_DELETE NetworkPI.Delete BAPI_BUS2002_ACT_CREATE_MULTI NetworkPI.ActCreateMultiple
BAPI_BUS2002_ACT_CHANGE_MULTI NetworkPI.ActChangeMultiple BAPI_BUS2002_ACT_DELETE_MULTI NetworkPI.ActDeleteMultiple BAPI_BUS2002_ACTELEM_CREATE_M NetworkPI.ActElemCreateMultiple BAPI_BUS2002_ACTELEM_CHANGE_M NetworkPI.ActElemChangeMultiple
BAPI_BUS2002_ACTELEM_DELETE_M NetworkPI.ActElemDeleteMultiple BAPI_BUS2002_SET_STATUS NetworkPI.SetStatus The processing unit must be finished by calling the BAPIs BAPI_PS_PRECOMMIT and BAPI_TRANSACTION_COMMIT (in that order).
- One-Project Principle
For technical reasons, only the project definition and the WBS elementsof one project can be processed in a processing unit. More than one project is used, for example, if You create or change more than one project
You have changed a project and want to change a network to which WBS elements from a different project are assignedYou want to change various networks to which WBS elements from different projects are assignedYou create or change a WBS assignment in a network so that a WBS element from a second project is used
WBS elements from different projects are already assigned to a network (note: this type of network cannot be processed with the network BAPIs named above).If you define a report for calling BAPIs, this means that: The report may use a maximum of one project per processing unit. The
individual BAPI calls must be distributed between more than one processing unit, which use a maximum of one project per processingunit.
- All-Or-Nothing Principle
If an error occurs in a processing unit in an individual BAPI or in the
BAPI "BAPI_PS_PRECOMMIT" (that is, the return table ET_RETURN containsat least one message of the type "E" (error), "A" (abnormal end) or "X" (exit), posting is not possible. If an error occurs in an individual BAPI and despite this you call theBAPI "BAPI_PS_PRECOMMIT", message CNIF_PI 056 is issued with message type I (information).
If an error occurs in an individual BAPI or in the BAPI "BAPI_PS_PRECOMMIT", but despite this you execute a COMMIT WORK, theprogram that is currently in process is terminated and message CNIF_PI 056 is issued with message type X. This is to ensure data consistency for all objects created, changed, and/or deleted in the processing unit.
Note that the processing unit to which this happens can no longer besuccessfully closed and therefore, no new processing unit can be started. However, you can set the current processing unit back to an initializedstatus by using a rollback work (for example, statement ROLLBACK WORK, the BAPI "BAPI_TRANSACTION_ROLLBACK" or the method
BapiService.TransactionRollback). Technically speaking, this means thatthe previous LUW is terminated and a new LUW is started in the current processing unit. Note that in this case, the current processing unit does not have to be re-initialized. Also note that the rollback also takes place according to the "all-or-nothing" principle, that therefore all
individual BAPIs carried out up to the rollback are discarded. After a rollback, youcan, therefore, no longer refer to an object that was previously created in the current processing unit using a CREATE-BAPI. However, you can close the processing unit again after a rollback,
using a PRECOMMIT and COMMIT WORK, as long as all individual BAPIs, andthe precommit carried out after the rollback, finish without errors. You can carry out several rollbacks in a processing unit (technically: start a new LUW several times).
- Procedure in the Case of Errors
As soon as an error occurs in an individual BAPI or in the BAPI "BAPI_PS_PRECOMMIT", you have the following options: Exit the report or the program that calls the BAPIs, the PRECOMMIT and the COMMIT WORK.
Execute a rollback in the current processing unit.
- Rules for Posting
After you have successfully called the individual BAPIs of a processingunit, you must call the PRECOMMIT "BAPI_PS_PRECOMMIT". If the PRECOMMIT is also successful, the COMMIT WORK must take place directly afterwards.
In particular, note that after the PRECOMMIT, you cannot call other individual BAPIs again in the current processing unit. It is also not permitted to call the PRECOMMIT more than once in a processing unit.
- Recommendation "COMMIT WORK AND WAIT"
If an object created in a processing unit is to be used in a subsequentprocessing unit (for example, as an account assignment object in a G/Laccount posting) it is recommended to call the commit work with the supplement "AND WAIT" or to set the parameters for the BAPI
"BAPI_TRANSACTION_COMMIT" accordingly.
- Field Selection
The field selection is a tool for influencing the user interface (thatis, for the dialog). In the BAPIs, the settings from the field selection (for example, fields that are not ready for input or
required-entry) are not taken into account.
- Using a date in the BAPI interface
You must communicate the date using the internal format YYYYMMDD (year month day) to the BAPI. Ensure that you do not use any special characters.
Since a BAPI must function in a user-specific way, you cannot and maynot convert the date according to the user and according to the date format defined in the user parameters.
- Customer Enhancements of the BAPIs
For the BAPIs used to create and change project definitions, WBSelements, networks, activities, and activity elements, you canautomatically fill the fields of the tables PROJ, PRPS, AUFK, and AFVUthat have been defined for customer enhancements in the standard system.
For this purpose, help structures that contain the respective keyfields, as well as the CI include of the table are supplied. The BAPIscontain the parameter ExtensionIN in which the enhancement fields canbe entered and also provide BAdIs in which the entered values can be checked and, if required, processed further.
CI Include Help Structure Key CI_PROJ BAPI_TE_PROJECT_DEFINITION PROJECT_DEFINITION CI_PRPS BAPI_TE_WBS_ELEMENT WBS_ELEMENT CI_AUFK BAPI_TE_NETWORK
NETWORK CI_AFVU BAPI_TE_NETWORK_ACTIVITY NETWORK ACTIVITY CI_AFVU BAPI_TE_NETWORK_ACT_ELEMENT NETWORK ACTIVITY ELEMENT
Procedure for Filling Standard EnhancementsBefore you call the BAPI for each object that is to be created or changed, for which you want to enter customer-specific table
enhancement fields, add a data record to the container ExtensionIn: STRUCTURE: Name of the corresponding help structureVALUEPART1: Key of the object + start of the data partVALUEPART2-4: If required, the continuation of the data part
VALUPART1 to VALUPART4 are therefore filled consecutively, first withthe keys that identify the table rows and then with the values of thecustomer-specific fields. By structuring the container in this way, itis possible to transfer its content with one MOVE command to the structure of the BAPI table extension.
Note that when objects are changed, all fields of theenhancements are overwritten (as opposed to the standard fields, whereonly those fields for which the respective update indicator is set arechanged). Therefore, even if you only want to change one field, all the fields that you transfer in ExtensionIn must be filled.
Checks and Further ProcessingUsing the methods ...CREATE_EXIT1 or. ...CHANGE_EXIT1 of the BAdIBAPIEXT_BUS2001, BAPIEXT_BUS2002, and BAPIEXT_BUS2054, you can check the entered values (and/or carry out other checks). In the BAdI's second method, you can program that the data transferred
to the BAPI is processed further (if you only want to transfer the fields of the CI includes, no more action is required here).
For more information, refer to the SAP Library under Cross-ApplicationComponents -> Business Framework Architecture -> Enhancements,
Modifications ... -> Customer Enhancement and Modification of BAPIs -> Customer Enhancement of BAPIs (CA-BFA).
|
|
|
|
11-Dec-2005
|
|
|
|
|
ActElemCreateMultiple
Create one or more activity elements (subobject of the BOR object typeBUS2002001). Each time this BAPI is called, only activity elements for one network can be created. ExampleParameter I_NUMBER Specify the network for which the activity elements are to be created in parameter I_NUMBER.
The network can already exist in the database, or have been createdpreviously in the current processing unit via BAPI BAPI_BUS2002_CREATE.In the second case, use the temporary network number for internal assignment of the network number for parameter I_NUMBER.
Table IT_ACT_ELEMENT Transfer the data for each new activity element to be created in a separate row in table IT_ACT_ELEMENT. The activity number in field ACTIVITY to which the new activity elementis to be assigned, as well as the activity element number in field ELEMENT are required-entry fields. Note that the activity in the
network must already exist and that the new activity element numbermust be unique for all activities and activity elements of the network. An activity element can be assigned to an activity that was created inthe current processing unit via BAPI BAPI_BUS2002_ACT_CREATE_MULTI.
Parameter CONTROL_KEY Initially the CONTROL_KEY field for the control key is not a required-entry field. If you do not transfer a value in the CONTROL_KEY field, an internallyprocessed activity element is created with the control key from the network profile for the activity type "internal". However, if a
corresponding control key is not defined in the network profile, the CONTROL_KEY becomes a required-entry field.Field NOT_MRP_APPLICABLE With this field you control the 'Res/PurcRq' field in the networkheader , activity, or activity element. Possible values are:
'1' or 'X': Never relevant to materials planning '2': Relevant to materials planning after release '3': Relevant to materials planning immediately
For the default value ' ' (SPACE) the following applies: In create mode: The default is specified for the field analogous to thedialog in Customizing or inherited from the higher-level object. In change mode: The value ' ' acts like the value '3' (Relevant to materials planning immediately).
SPACE is a selective value here, since you must set the parameteradditionally in the I_NETWORK_UPD structure. This is not the case in create mode. Anything else you enter generates the error CNIF_PI088.
Messages from the application and a success or error message arereturned by the BAPI to the caller in the return table ET_RETURN. InET_RETURN, the messages are collected together in blocks per activityelement. Each message block refers therefore to an activity element and starts with a summarized success or error message.
Notes- Definition "Processing Unit"
In the following, the term "Processing unit" refers to a series of related processing steps. The first step in a processing unit is initialization, which is done by calling the BAPI BAPI_PS_INITIALIZATION.
Afterwards, the individual BAPIs listed below can be used several times, if required. The processing unit ends when the final precommit (call BAPI BAPI_PS_PRECOMMIT) is executed with a subsequentCOMMIT WORK (for example, the statement COMMIT WORK, the BAPI
"BAPI_TRANSACTION_COMMIT" or the BapiService.TransactionCommit method). After the final COMMIT WORK, the next initialization opens a new processing unit via the BAPI "BAPI_PS_INITIALIZATION". In principal, the following applies to each individual processing unit.
- Creation of a Processing Unit
Each processing unit must be initialized by calling the BAPI "BAPI_PS_INITIALIZATION" once. Afterwards, the following individual BAPIs can be used within aprocessing unit - they can also be used more than once, taking into
account the "One-Project Principle" explained below. This also meansthat an object created in the current processing unit by a CREATE-BAPI can be changed by a CHANGE-BAPI or STATUS-BAPI. Except for the BAPIs explicitly named below, you can only call up BAPIs
that execute GET methods or READ methods only. In particular, the BAPIs for confirming a network may not be used with the individual BAPIs named below. Business Object ProjectDefinitionPI BAPI Method
BAPI_BUS2001_CREATE ProjectDefinitionPI.CreateSingle BAPI_BUS2001_CHANGE ProjectDefinitionPI.Change BAPI_BUS2001_DELETE ProjectDefinitionPI.Delete BAPI_BUS2001_SET_STATUS ProjectDefinitionPI.SetStatus BAPI_BUS2001_PARTNER_CREATE_M ProjectDefinitionPI.PartnerCreateMultiple
BAPI_BUS2001_PARTNER_CHANGE_M ProjectDefinitionPI.PartnerChangeMultiple BAPI_BUS2001_PARTNER_REMOVE_M ProjectDefinitionPI.PartnerRemoveMultiple Business Object WBSPI BAPI Method
BAPI_BUS2054_CREATE_MULTI WBSPI.CreateMultiple BAPI_BUS2054_CHANGE_MULTI WBSPI.ChangeMultiple BAPI_BUS2054_DELETE_MULTI WBSPI.DeleteMultiple BAPI_BUS2001_SET_STATUS WBSPI.SetStatus Business Object NetworkPI
BAPI Method BAPI_BUS2002_CREATE NetworkPI.CreateFromData BAPI_BUS2002_CHANGE NetworkPI.Change BAPI_BUS2002_DELETE NetworkPI.Delete BAPI_BUS2002_ACT_CREATE_MULTI NetworkPI.ActCreateMultiple
BAPI_BUS2002_ACT_CHANGE_MULTI NetworkPI.ActChangeMultiple BAPI_BUS2002_ACT_DELETE_MULTI NetworkPI.ActDeleteMultiple BAPI_BUS2002_ACTELEM_CREATE_M NetworkPI.ActElemCreateMultiple BAPI_BUS2002_ACTELEM_CHANGE_M NetworkPI.ActElemChangeMultiple
BAPI_BUS2002_ACTELEM_DELETE_M NetworkPI.ActElemDeleteMultiple BAPI_BUS2002_SET_STATUS NetworkPI.SetStatus The processing unit must be finished by calling the BAPIs BAPI_PS_PRECOMMIT and BAPI_TRANSACTION_COMMIT (in that order).
- One-Project Principle
For technical reasons, only the project definition and the WBS elementsof one project can be processed in a processing unit. More than one project is used, for example, if You create or change more than one project
You have changed a project and want to change a network to which WBS elements from a different project are assignedYou want to change various networks to which WBS elements from different projects are assignedYou create or change a WBS assignment in a network so that a WBS element from a second project is used
WBS elements from different projects are already assigned to a network (note: this type of network cannot be processed with the network BAPIs named above).If you define a report for calling BAPIs, this means that: The report may use a maximum of one project per processing unit. The
individual BAPI calls must be distributed between more than one processing unit, which use a maximum of one project per processingunit.
- All-Or-Nothing Principle
If an error occurs in a processing unit in an individual BAPI or in the
BAPI "BAPI_PS_PRECOMMIT" (that is, the return table ET_RETURN containsat least one message of the type "E" (error), "A" (abnormal end) or "X" (exit), posting is not possible. If an error occurs in an individual BAPI and despite this you call theBAPI "BAPI_PS_PRECOMMIT", message CNIF_PI 056 is issued with message type I (information).
If an error occurs in an individual BAPI or in the BAPI "BAPI_PS_PRECOMMIT", but despite this you execute a COMMIT WORK, theprogram that is currently in process is terminated and message CNIF_PI 056 is issued with message type X. This is to ensure data consistency for all objects created, changed, and/or deleted in the processing unit.
Note that the processing unit to which this happens can no longer besuccessfully closed and therefore, no new processing unit can be started. However, you can set the current processing unit back to an initializedstatus by using a rollback work (for example, statement ROLLBACK WORK, the BAPI "BAPI_TRANSACTION_ROLLBACK" or the method
BapiService.TransactionRollback). Technically speaking, this means thatthe previous LUW is terminated and a new LUW is started in the current processing unit. Note that in this case, the current processing unit does not have to be re-initialized. Also note that the rollback also takes place according to the "all-or-nothing" principle, that therefore all
individual BAPIs carried out up to the rollback are discarded. After a rollback, youcan, therefore, no longer refer to an object that was previously created in the current processing unit using a CREATE-BAPI. However, you can close the processing unit again after a rollback,
using a PRECOMMIT and COMMIT WORK, as long as all individual BAPIs, andthe precommit carried out after the rollback, finish without errors. You can carry out several rollbacks in a processing unit (technically: start a new LUW several times).
- Procedure in the Case of Errors
As soon as an error occurs in an individual BAPI or in the BAPI "BAPI_PS_PRECOMMIT", you have the following options: Exit the report or the program that calls the BAPIs, the PRECOMMIT and the COMMIT WORK.
Execute a rollback in the current processing unit.
- Rules for Posting
After you have successfully called the individual BAPIs of a processingunit, you must call the PRECOMMIT "BAPI_PS_PRECOMMIT". If the PRECOMMIT is also successful, the COMMIT WORK must take place directly afterwards.
In particular, note that after the PRECOMMIT, you cannot call other individual BAPIs again in the current processing unit. It is also not permitted to call the PRECOMMIT more than once in a processing unit.
- Recommendation "COMMIT WORK AND WAIT"
If an object created in a processing unit is to be used in a subsequentprocessing unit (for example, as an account assignment object in a G/Laccount posting) it is recommended to call the commit work with the supplement "AND WAIT" or to set the parameters for the BAPI
"BAPI_TRANSACTION_COMMIT" accordingly.
- Field Selection
The field selection is a tool for influencing the user interface (thatis, for the dialog). In the BAPIs, the settings from the field selection (for example, fields that are not ready for input or
required-entry) are not taken into account.
- Using a date in the BAPI interface
You must communicate the date using the internal format YYYYMMDD (year month day) to the BAPI. Ensure that you do not use any special characters.
Since a BAPI must function in a user-specific way, you cannot and maynot convert the date according to the user and according to the date format defined in the user parameters.
- Customer Enhancements of the BAPIs
For the BAPIs used to create and change project definitions, WBSelements, networks, activities, and activity elements, you canautomatically fill the fields of the tables PROJ, PRPS, AUFK, and AFVUthat have been defined for customer enhancements in the standard system.
For this purpose, help structures that contain the respective keyfields, as well as the CI include of the table are supplied. The BAPIscontain the parameter ExtensionIN in which the enhancement fields canbe entered and also provide BAdIs in which the entered values can be checked and, if required, processed further.
CI Include Help Structure Key CI_PROJ BAPI_TE_PROJECT_DEFINITION PROJECT_DEFINITION CI_PRPS BAPI_TE_WBS_ELEMENT WBS_ELEMENT CI_AUFK BAPI_TE_NETWORK
NETWORK CI_AFVU BAPI_TE_NETWORK_ACTIVITY NETWORK ACTIVITY CI_AFVU BAPI_TE_NETWORK_ACT_ELEMENT NETWORK ACTIVITY ELEMENT
Procedure for Filling Standard EnhancementsBefore you call the BAPI for each object that is to be created or changed, for which you want to enter customer-specific table
enhancement fields, add a data record to the container ExtensionIn: STRUCTURE: Name of the corresponding help structureVALUEPART1: Key of the object + start of the data partVALUEPART2-4: If required, the continuation of the data part
VALUPART1 to VALUPART4 are therefore filled consecutively, first withthe keys that identify the table rows and then with the values of thecustomer-specific fields. By structuring the container in this way, itis possible to transfer its content with one MOVE command to the structure of the BAPI table extension.
Note that when objects are changed, all fields of theenhancements are overwritten (as opposed to the standard fields, whereonly those fields for which the respective update indicator is set arechanged). Therefore, even if you only want to change one field, all the fields that you transfer in ExtensionIn must be filled.
Checks and Further ProcessingUsing the methods ...CREATE_EXIT1 or. ...CHANGE_EXIT1 of the BAdIBAPIEXT_BUS2001, BAPIEXT_BUS2002, and BAPIEXT_BUS2054, you can check the entered values (and/or carry out other checks). In the BAdI's second method, you can program that the data transferred
to the BAPI is processed further (if you only want to transfer the fields of the CI includes, no more action is required here).
For more information, refer to the SAP Library under Cross-ApplicationComponents -> Business Framework Architecture -> Enhancements,
Modifications ... -> Customer Enhancement and Modification of BAPIs -> Customer Enhancement of BAPIs (CA-BFA).
|
|
|
|
11-Dec-2005
|
|
|
|
|
ActElemDeleteMultiple
Delete activity elements (subobject of BOR object BUS2002). ExampleThe network to which the activity elements to be deleted belong is specified by the parameter number. The multiline parameterIT_DELETE_ACT_ELEMENT contains the list of activity elements to be deleted.
Messages from the application and a success or failure message, asappropriate, are returned to the caller by the BAPI in the parameter RETURN. You can process only one network each time you call up this BAPI. Before the activity elements are deleted, various checks are carried out, for example:
Have the activity elements already been confirmed or partially confirmed?Deletion authorizationDo purchase orders already exist?If all checks are successful, the activity elements are deleted. Notes- Definition "Processing Unit"
In the following, the term "Processing unit" refers to a series of related processing steps. The first step in a processing unit is initialization, which is done by calling the BAPI BAPI_PS_INITIALIZATION. Afterwards, the individual BAPIs listed below can be used several times, if required.
The processing unit ends when the final precommit (call BAPI BAPI_PS_PRECOMMIT) is executed with a subsequentCOMMIT WORK (for example, the statement COMMIT WORK, the BAPI"BAPI_TRANSACTION_COMMIT" or the BapiService.TransactionCommit method).
After the final COMMIT WORK, the next initialization opens a new processing unit via the BAPI "BAPI_PS_INITIALIZATION". In principal, the following applies to each individual processing unit.
- Creation of a Processing Unit
Each processing unit must be initialized by calling the BAPI "BAPI_PS_INITIALIZATION" once. Afterwards, the following individual BAPIs can be used within aprocessing unit - they can also be used more than once, taking intoaccount the "One-Project Principle" explained below. This also means
that an object created in the current processing unit by a CREATE-BAPI can be changed by a CHANGE-BAPI or STATUS-BAPI. Except for the BAPIs explicitly named below, you can only call up BAPIsthat execute GET methods or READ methods only. In particular, the BAPIs for confirming a network may not
be used with the individual BAPIs named below. Business Object ProjectDefinitionPI BAPI Method BAPI_BUS2001_CREATE ProjectDefinitionPI.CreateSingle BAPI_BUS2001_CHANGE ProjectDefinitionPI.Change
BAPI_BUS2001_DELETE ProjectDefinitionPI.Delete BAPI_BUS2001_SET_STATUS ProjectDefinitionPI.SetStatus BAPI_BUS2001_PARTNER_CREATE_M ProjectDefinitionPI.PartnerCreateMultiple BAPI_BUS2001_PARTNER_CHANGE_M ProjectDefinitionPI.PartnerChangeMultiple
BAPI_BUS2001_PARTNER_REMOVE_M ProjectDefinitionPI.PartnerRemoveMultiple Business Object WBSPI BAPI Method BAPI_BUS2054_CREATE_MULTI WBSPI.CreateMultiple BAPI_BUS2054_CHANGE_MULTI WBSPI.ChangeMultiple
BAPI_BUS2054_DELETE_MULTI WBSPI.DeleteMultiple BAPI_BUS2001_SET_STATUS WBSPI.SetStatus Business Object NetworkPI BAPI Method BAPI_BUS2002_CREATE NetworkPI.CreateFromData
BAPI_BUS2002_CHANGE NetworkPI.Change BAPI_BUS2002_DELETE NetworkPI.Delete BAPI_BUS2002_ACT_CREATE_MULTI NetworkPI.ActCreateMultiple BAPI_BUS2002_ACT_CHANGE_MULTI NetworkPI.ActChangeMultiple BAPI_BUS2002_ACT_DELETE_MULTI NetworkPI.ActDeleteMultiple
BAPI_BUS2002_ACTELEM_CREATE_M NetworkPI.ActElemCreateMultiple BAPI_BUS2002_ACTELEM_CHANGE_M NetworkPI.ActElemChangeMultiple BAPI_BUS2002_ACTELEM_DELETE_M NetworkPI.ActElemDeleteMultiple BAPI_BUS2002_SET_STATUS NetworkPI.SetStatus
The processing unit must be finished by calling the BAPIs BAPI_PS_PRECOMMIT and BAPI_TRANSACTION_COMMIT (in that order).
- One-Project Principle
For technical reasons, only the project definition and the WBS elements
of one project can be processed in a processing unit. More than one project is used, for example, if You create or change more than one projectYou have changed a project and want to change a network to which WBS elements from a different project are assigned
You want to change various networks to which WBS elements from different projects are assignedYou create or change a WBS assignment in a network so that a WBS element from a second project is usedWBS elements from different projects are already assigned to a network (note: this type of network cannot
be processed with the network BAPIs named above).If you define a report for calling BAPIs, this means that: The report may use a maximum of one project per processing unit. Theindividual BAPI calls must be distributed between more than one processing unit, which use a maximum of one project per processing
unit.
- All-Or-Nothing Principle
If an error occurs in a processing unit in an individual BAPI or in theBAPI "BAPI_PS_PRECOMMIT" (that is, the return table ET_RETURN containsat least one message of the type "E" (error), "A" (abnormal end) or "X" (exit), posting is not possible.
If an error occurs in an individual BAPI and despite this you call theBAPI "BAPI_PS_PRECOMMIT", message CNIF_PI 056 is issued with message type I (information). If an error occurs in an individual BAPI or in the BAPI "BAPI_PS_PRECOMMIT", but despite this you execute a COMMIT WORK, the
program that is currently in process is terminated and message CNIF_PI 056 is issued with message type X. This is to ensure data consistency for all objects created, changed, and/or deleted in the processing unit. Note that the processing unit to which this happens can no longer be
successfully closed and therefore, no new processing unit can be started. However, you can set the current processing unit back to an initializedstatus by using a rollback work (for example, statement ROLLBACK WORK, the BAPI "BAPI_TRANSACTION_ROLLBACK" or the method
BapiService.TransactionRollback). Technically speaking, this means thatthe previous LUW is terminated and a new LUW is started in the current processing unit. Note that in this case, the current processing unit does not have to be re-initialized. Also note that the rollback also takes place according to the "all-or-nothing" principle, that therefore all
individual BAPIs carried out up to the rollback are discarded. After a rollback, youcan, therefore, no longer refer to an object that was previously created in the current processing unit using a CREATE-BAPI. However, you can close the processing unit again after a rollback,
using a PRECOMMIT and COMMIT WORK, as long as all individual BAPIs, andthe precommit carried out after the rollback, finish without errors. You can carry out several rollbacks in a processing unit (technically: start a new LUW several times).
- Procedure in the Case of Errors
As soon as an error occurs in an individual BAPI or in the BAPI "BAPI_PS_PRECOMMIT", you have the following options: Exit the report or the program that calls the BAPIs, the PRECOMMIT and the COMMIT WORK.
Execute a rollback in the current processing unit.
- Rules for Posting
After you have successfully called the individual BAPIs of a processingunit, you must call the PRECOMMIT "BAPI_PS_PRECOMMIT". If the PRECOMMIT is also successful, the COMMIT WORK must take place directly afterwards.
In particular, note that after the PRECOMMIT, you cannot call other individual BAPIs again in the current processing unit. It is also not permitted to call the PRECOMMIT more than once in a processing unit.
- Recommendation "COMMIT WORK AND WAIT"
If an object created in a processing unit is to be used in a subsequentprocessing unit (for example, as an account assignment object in a G/Laccount posting) it is recommended to call the commit work with the supplement "AND WAIT" or to set the parameters for the BAPI
"BAPI_TRANSACTION_COMMIT" accordingly.
- Field Selection
The field selection is a tool for influencing the user interface (thatis, for the dialog). In the BAPIs, the settings from the field selection (for example, fields that are not ready for input or
required-entry) are not taken into account.
- Using a date in the BAPI interface
You must communicate the date using the internal format YYYYMMDD (year month day) to the BAPI. Ensure that you do not use any special characters.
Since a BAPI must function in a user-specific way, you cannot and maynot convert the date according to the user and according to the date format defined in the user parameters.
- Customer Enhancements of the BAPIs
For the BAPIs used to create and change project definitions, WBSelements, networks, activities, and activity elements, you canautomatically fill the fields of the tables PROJ, PRPS, AUFK, and AFVUthat have been defined for customer enhancements in the standard system.
For this purpose, help structures that contain the respective keyfields, as well as the CI include of the table are supplied. The BAPIscontain the parameter ExtensionIN in which the enhancement fields canbe entered and also provide BAdIs in which the entered values can be checked and, if required, processed further.
CI Include Help Structure Key CI_PROJ BAPI_TE_PROJECT_DEFINITION PROJECT_DEFINITION CI_PRPS BAPI_TE_WBS_ELEMENT WBS_ELEMENT CI_AUFK BAPI_TE_NETWORK
NETWORK CI_AFVU BAPI_TE_NETWORK_ACTIVITY NETWORK ACTIVITY CI_AFVU BAPI_TE_NETWORK_ACT_ELEMENT NETWORK ACTIVITY ELEMENT
Procedure for Filling Standard EnhancementsBefore you call the BAPI for each object that is to be created or changed, for which you want to enter customer-specific table
enhancement fields, add a data record to the container ExtensionIn: STRUCTURE: Name of the corresponding help structureVALUEPART1: Key of the object + start of the data partVALUEPART2-4: If required, the continuation of the data part
VALUPART1 to VALUPART4 are therefore filled consecutively, first withthe keys that identify the table rows and then with the values of thecustomer-specific fields. By structuring the container in this way, itis possible to transfer its content with one MOVE command to the structure of the BAPI table extension.
Note that when objects are changed, all fields of theenhancements are overwritten (as opposed to the standard fields, whereonly those fields for which the respective update indicator is set arechanged). Therefore, even if you only want to change one field, all the fields that you transfer in ExtensionIn must be filled.
Checks and Further ProcessingUsing the methods ...CREATE_EXIT1 or. ...CHANGE_EXIT1 of the BAdIBAPIEXT_BUS2001, BAPIEXT_BUS2002, and BAPIEXT_BUS2054, you can check the entered values (and/or carry out other checks). In the BAdI's second method, you can program that the data transferred
to the BAPI is processed further (if you only want to transfer the fields of the CI includes, no more action is required here).
For more information, refer to the SAP Library under Cross-ApplicationComponents -> Business Framework Architecture -> Enhancements,
Modifications ... -> Customer Enhancement and Modification of BAPIs -> Customer Enhancement of BAPIs (CA-BFA).
|
|
|
|
11-Dec-2005
|
|
|
|
|
ActElemGetData
You can use the BAPI BAPI_BUS2002_ACTELEM_GETDATA to get detailed information about activity elements. To get all activities in a network, you must transfer the networknumber in the parameter I_NETWORK_NUMBER. If you just want to getparticular activity elements, you can specify the required activity
elements in the table IT_ACTELEMENT_LIST. Alternatively, you can alsodetermine the activities for which all activity elements are to be returned in the table IT_ACTIVITY_LIST. Note that the tablesIT_ACTELEMENT_LIST and IT_ACTIVITY_LIST cannot be filled at the same time.
If you want to restrict the output (for example, because you do notknow how big the network is and, for performance reasons, you want toprevent the system from returning more than 1000 activity elements),you can use the parameter I_MAX_ROWS to restrict the maximum number of
activity elements returned. If you do not fill this parameter, all activity elements are returned. If required, you can also specify in which language the language-dependent fields, such as time units, system status, and soon, are to be returned. If you do not specify a language, the system language is used.
NotesFields that are directly assigned to the activity elements are returned in the table ET_ACTIVITY_ELEMENTS. The field LANGU specifies which language the long text is in, if one exists. The field SYSTEM_STATUS specifies one of the following statuses:
created, released, technically completed, closed. If the deletion flagor indicator is set, however, this information is returned instead of the status. Further InformationFor more information, see the SAP Library under Project System ->
Structures -> Interfaces to the Project System -> PS-EPS Interface to External Project Software.
|
|
|
|
11-Dec-2005
|
|
|
|
|
ActGetData
You can use the BAPI BAPI_BUS2002_ACT_GETDATA to get detailed information about network activities. To get all activities in a network, you must transfer the networknumber in the parameter I_NETWORK_NUMBER. If you just want to get particular activities, you can specify the required activities
individually in the table IT_ACTIVITY_LIST. If you want to restrict the output (for example, because you do notknow how big the network is and, for performance reasons, you want toprevent the system from returning more than 1000 activities), you canuse the parameter I_MAX_ROWS to restrict the maximum number of activities returned. If you do not fill this parameter, all possible
activities are returned. If required, you can also specify in which language the language-dependent fields, such as time units, system status, and soon, are to be returned. If you do not specify a language, the system language is used. Notes
Fields that are directly assigned to the activities are returned in the table ET_ACTIVITIES. The field LANGU specifies which language the long text is in, if one exists. The field SYSTEM_STATUS specifies one of the following statuses:created, released, technically completed, closed. If the deletion flag
or indicator is set, however, this information is returned instead of the status. Further InformationFor more information, see the SAP Library under Project System ->Structures -> Interfaces to the Project System -> PS-EPS Interface to External Project Software.
|
|
|
|
11-Dec-2005
|
|
|
|
|
Change
Change network header (BOR object type BUS2002001). Only one network header can be changed each time this BAPI is called. ExampleParameter I_NUMBER, I_NETWORK und I_NETWORK_UPD Transfer the network number of the network to be changed via parameter
I_NUMBER. Enter the data of the network that is to be changed in parameter I_NETWORK. In parameter I_NETWORK_UPD, flag all fields that are to be updated by the values from I_NETWORK with an "X". All other fields remain unchanged, even if they have been assigned new
values in paramter I_NETWORK. Therefore, this BAPI works according tothe "change by flagging" principle (also refer to the progamming guide in the BAPI transaction). Temporary network numberThe network to be changed can already exist in the database or can have
been created previously in the current processing unit via BAPI BAPI_BUS2002_CREATE. In the second case, use the temporary networknumber for parameter I_NUMBER for internal assignment of the network number. You can change a network within a processing unit several times using BAPI BAPI_BUS2002_CHANGE.
Field NOT_MRP_APPLICABLE With this field you control the 'Res/PurcRq' field in the networkheader , activity, or activity element. Possible values are:'1' or 'X': Never relevant to materials planning
'2': Relevant to materials planning after release '3': Relevant to materials planning immediately For the default value ' ' (SPACE) the following applies:
In create mode: The default is specified for the field analogous to thedialog in Customizing or inherited from the higher-level object. In change mode: The value ' ' acts like the value '3' (Relevant to materials planning immediately).
SPACE is a selective value here, since you must set the parameteradditionally in the I_NETWORK_UPD structure. This is not the case in create mode. Anything else you enter generates the error CNIF_PI088.
Field NOT_AUTO_COSTING With this field you control the multiple-value 'Planned Cost Calculation' field in the network header. Possible values are:'0' or 'X': Do not calculate planned costs '1': Calculate planned costs after release
'2': Calculate planned costs '3': Update planned costs after release '4': Update planned costs For the default value ' ' (SPACE) the following applies:
In create mode: The default is specified for the field analogous to the dialog in Customizing. In change mode: The value ' ' acts like the value '2' (calculate planned costs). SPACE is a selective value here, since you must set the parameter
additionally in the I_NETWORK_UPD structure. This is not the case in create mode. Anything else you enter generates the error CNIF_PI057. Return table ET_RETURN The BAPI in the return table ET_RETURN returns messages from the
application and a success message or error message to the caller. Thesuccess messages and error messages are grouped together in the first row in the table ET_RETURN.Notes- Definition "Processing Unit"
In the following, the term "Processing unit" refers to a series of related processing steps. The first step in a processing unit is initialization, which is done by calling the BAPI BAPI_PS_INITIALIZATION. Afterwards, the individual BAPIs listed below can be used several times, if required.
The processing unit ends when the final precommit (call BAPI BAPI_PS_PRECOMMIT) is executed with a subsequentCOMMIT WORK (for example, the statement COMMIT WORK, the BAPI"BAPI_TRANSACTION_COMMIT" or the BapiService.TransactionCommit method).
After the final COMMIT WORK, the next initialization opens a new processing unit via the BAPI "BAPI_PS_INITIALIZATION". In principal, the following applies to each individual processing unit.
- Creation of a Processing Unit
Each processing unit must be initialized by calling the BAPI "BAPI_PS_INITIALIZATION" once. Afterwards, the following individual BAPIs can be used within aprocessing unit - they can also be used more than once, taking intoaccount the "One-Project Principle" explained below. This also means
that an object created in the current processing unit by a CREATE-BAPI can be changed by a CHANGE-BAPI or STATUS-BAPI. Except for the BAPIs explicitly named below, you can only call up BAPIsthat execute GET methods or READ methods only. In particular, the BAPIs for confirming a network may not
be used with the individual BAPIs named below. Business Object ProjectDefinitionPI BAPI Method BAPI_BUS2001_CREATE ProjectDefinitionPI.CreateSingle BAPI_BUS2001_CHANGE ProjectDefinitionPI.Change
BAPI_BUS2001_DELETE ProjectDefinitionPI.Delete BAPI_BUS2001_SET_STATUS ProjectDefinitionPI.SetStatus BAPI_BUS2001_PARTNER_CREATE_M ProjectDefinitionPI.PartnerCreateMultiple BAPI_BUS2001_PARTNER_CHANGE_M ProjectDefinitionPI.PartnerChangeMultiple
BAPI_BUS2001_PARTNER_REMOVE_M ProjectDefinitionPI.PartnerRemoveMultiple Business Object WBSPI BAPI Method BAPI_BUS2054_CREATE_MULTI WBSPI.CreateMultiple BAPI_BUS2054_CHANGE_MULTI WBSPI.ChangeMultiple
BAPI_BUS2054_DELETE_MULTI WBSPI.DeleteMultiple BAPI_BUS2001_SET_STATUS WBSPI.SetStatus Business Object NetworkPI BAPI Method BAPI_BUS2002_CREATE NetworkPI.CreateFromData
BAPI_BUS2002_CHANGE NetworkPI.Change BAPI_BUS2002_DELETE NetworkPI.Delete BAPI_BUS2002_ACT_CREATE_MULTI NetworkPI.ActCreateMultiple BAPI_BUS2002_ACT_CHANGE_MULTI NetworkPI.ActChangeMultiple BAPI_BUS2002_ACT_DELETE_MULTI NetworkPI.ActDeleteMultiple
BAPI_BUS2002_ACTELEM_CREATE_M NetworkPI.ActElemCreateMultiple BAPI_BUS2002_ACTELEM_CHANGE_M NetworkPI.ActElemChangeMultiple BAPI_BUS2002_ACTELEM_DELETE_M NetworkPI.ActElemDeleteMultiple BAPI_BUS2002_SET_STATUS NetworkPI.SetStatus
The processing unit must be finished by calling the BAPIs BAPI_PS_PRECOMMIT and BAPI_TRANSACTION_COMMIT (in that order).
- One-Project Principle
For technical reasons, only the project definition and the WBS elements
of one project can be processed in a processing unit. More than one project is used, for example, if You create or change more than one projectYou have changed a project and want to change a network to which WBS elements from a different project are assigned
You want to change various networks to which WBS elements from different projects are assignedYou create or change a WBS assignment in a network so that a WBS element from a second project is usedWBS elements from different projects are already assigned to a network (note: this type of network cannot
be processed with the network BAPIs named above).If you define a report for calling BAPIs, this means that: The report may use a maximum of one project per processing unit. Theindividual BAPI calls must be distributed between more than one processing unit, which use a maximum of one project per processing
unit.
- All-Or-Nothing Principle
If an error occurs in a processing unit in an individual BAPI or in theBAPI "BAPI_PS_PRECOMMIT" (that is, the return table ET_RETURN containsat least one message of the type "E" (error), "A" (abnormal end) or "X" (exit), posting is not possible.
If an error occurs in an individual BAPI and despite this you call theBAPI "BAPI_PS_PRECOMMIT", message CNIF_PI 056 is issued with message type I (information). If an error occurs in an individual BAPI or in the BAPI "BAPI_PS_PRECOMMIT", but despite this you execute a COMMIT WORK, the
program that is currently in process is terminated and message CNIF_PI 056 is issued with message type X. This is to ensure data consistency for all objects created, changed, and/or deleted in the processing unit. Note that the processing unit to which this happens can no longer be
successfully closed and therefore, no new processing unit can be started. However, you can set the current processing unit back to an initializedstatus by using a rollback work (for example, statement ROLLBACK WORK, the BAPI "BAPI_TRANSACTION_ROLLBACK" or the method
BapiService.TransactionRollback). Technically speaking, this means thatthe previous LUW is terminated and a new LUW is started in the current processing unit. Note that in this case, the current processing unit does not have to be re-initialized. Also note that the rollback also takes place according to the "all-or-nothing" principle, that therefore all
individual BAPIs carried out up to the rollback are discarded. After a rollback, youcan, therefore, no longer refer to an object that was previously created in the current processing unit using a CREATE-BAPI. However, you can close the processing unit again after a rollback,
using a PRECOMMIT and COMMIT WORK, as long as all individual BAPIs, andthe precommit carried out after the rollback, finish without errors. You can carry out several rollbacks in a processing unit (technically: start a new LUW several times).
- Procedure in the Case of Errors
As soon as an error occurs in an individual BAPI or in the BAPI "BAPI_PS_PRECOMMIT", you have the following options: Exit the report or the program that calls the BAPIs, the PRECOMMIT and the COMMIT WORK.
Execute a rollback in the current processing unit.
- Rules for Posting
After you have successfully called the individual BAPIs of a processingunit, you must call the PRECOMMIT "BAPI_PS_PRECOMMIT". If the PRECOMMIT is also successful, the COMMIT WORK must take place directly afterwards.
In particular, note that after the PRECOMMIT, you cannot call other individual BAPIs again in the current processing unit. It is also not permitted to call the PRECOMMIT more than once in a processing unit.
- Recommendation "COMMIT WORK AND WAIT"
If an object created in a processing unit is to be used in a subsequentprocessing unit (for example, as an account assignment object in a G/Laccount posting) it is recommended to call the commit work with the supplement "AND WAIT" or to set the parameters for the BAPI
"BAPI_TRANSACTION_COMMIT" accordingly.
- Field Selection
The field selection is a tool for influencing the user interface (thatis, for the dialog). In the BAPIs, the settings from the field selection (for example, fields that are not ready for input or
required-entry) are not taken into account.
- Using a date in the BAPI interface
You must communicate the date using the internal format YYYYMMDD (year month day) to the BAPI. Ensure that you do not use any special characters.
Since a BAPI must function in a user-specific way, you cannot and maynot convert the date according to the user and according to the date format defined in the user parameters.
- Customer Enhancements of the BAPIs
For the BAPIs used to create and change project definitions, WBSelements, networks, activities, and activity elements, you canautomatically fill the fields of the tables PROJ, PRPS, AUFK, and AFVUthat have been defined for customer enhancements in the standard system.
For this purpose, help structures that contain the respective keyfields, as well as the CI include of the table are supplied. The BAPIscontain the parameter ExtensionIN in which the enhancement fields canbe entered and also provide BAdIs in which the entered values can be checked and, if required, processed further.
CI Include Help Structure Key CI_PROJ BAPI_TE_PROJECT_DEFINITION PROJECT_DEFINITION CI_PRPS BAPI_TE_WBS_ELEMENT WBS_ELEMENT CI_AUFK BAPI_TE_NETWORK
NETWORK CI_AFVU BAPI_TE_NETWORK_ACTIVITY NETWORK ACTIVITY CI_AFVU BAPI_TE_NETWORK_ACT_ELEMENT NETWORK ACTIVITY ELEMENT
Procedure for Filling Standard EnhancementsBefore you call the BAPI for each object that is to be created or changed, for which you want to enter customer-specific table
enhancement fields, add a data record to the container ExtensionIn: STRUCTURE: Name of the corresponding help structureVALUEPART1: Key of the object + start of the data partVALUEPART2-4: If required, the continuation of the data part
VALUPART1 to VALUPART4 are therefore filled consecutively, first withthe keys that identify the table rows and then with the values of thecustomer-specific fields. By structuring the container in this way, itis possible to transfer its content with one MOVE command to the structure of the BAPI table extension.
Note that when objects are changed, all fields of theenhancements are overwritten (as opposed to the standard fields, whereonly those fields for which the respective update indicator is set arechanged). Therefore, even if you only want to change one field, all the fields that you transfer in ExtensionIn must be filled.
Checks and Further ProcessingUsing the methods ...CREATE_EXIT1 or. ...CHANGE_EXIT1 of the BAdIBAPIEXT_BUS2001, BAPIEXT_BUS2002, and BAPIEXT_BUS2054, you can check the entered values (and/or carry out other checks). In the BAdI's second method, you can program that the data transferred
to the BAPI is processed further (if you only want to transfer the fields of the CI includes, no more action is required here).
For more information, refer to the SAP Library under Cross-ApplicationComponents -> Business Framework Architecture -> Enhancements,
Modifications ... -> Customer Enhancement and Modification of BAPIs -> Customer Enhancement of BAPIs (CA-BFA).
|
|
|
|
11-Dec-2005
|
|
|
|
|
CreateFromData
Create a network header (BOR object type BUS2002001). Only one network can be created each time this BAPI is called. ExampleTransfer the data of the new network in parameter I_NETWORK. Internal number assignment of the network number The network profile is the only required-entry field. The BAPI fails if
an external network number is entered in the interface. When the BAPI finishes successfully, the final network number has notbeen determined yet. Instead, the log of the return table ET_RETURN contains a temporary network number. Use this temporary network number, if you do any of the following before carrying out the posting:
Change this network header (BAPI_BUS2002_CHANGE) Create activities for this network (BAPI_BUS2002_ACT_CREATE_MULTI) Change activities created for this network (BAPI_BUS2002_ACT_CHANGE_MULTI)
Create activity elements for this network (BAPI_BUS2002_ACTELEM_CREATE_M) Change activity elements that were created for this network (BAPI_BUS2002_ACTELEM_CHANGE) Carry out status changes for this network (BAPI_BUS2002_SET_STATUS)
After the precommit is carried out successfully, the final networknumber along with the current temporary number are displayed in the logof the precommit. All dependent messages for this network header in thelog of the precommit (change header, create/change network activities,
create/change activity elements) contain the final number only. External number assignment of the network number In addition to the network profile, the network number is also arequired-entry field. Exception: the external network number is
determined via user exit CNEX0012 "Derive External Network Number from WBS Number". The BAPI fails if no external network number, or one that is already being used, is interfaced or determined in the user exit. If the BAPI finishes successfully, the log of the ET_RETURN return
table already contains this external network number. If the BAPI fails,the lock of the external network number is immediately lifted.Field NOT_MRP_APPLICABLE With this field you control the 'Res/PurcRq' field in the networkheader , activity, or activity element. Possible values are:
'1' or 'X': Never relevant to materials planning '2': Relevant to materials planning after release '3': Relevant to materials planning immediately
For the default value ' ' (SPACE) the following applies: In create mode: The default is specified for the field analogous to thedialog in Customizing or inherited from the higher-level object. In change mode: The value ' ' acts like the value '3' (Relevant to materials planning immediately).
SPACE is a selective value here, since you must set the parameteradditionally in the I_NETWORK_UPD structure. This is not the case in create mode. Anything else you enter generates the error CNIF_PI088.
Field NOT_AUTO_COSTING With this field you control the multiple-value 'Planned Cost Calculation' field in the network header. Possible values are:'0' or 'X': Do not calculate planned costs '1': Calculate planned costs after release
'2': Calculate planned costs '3': Update planned costs after release '4': Update planned costs For the default value ' ' (SPACE) the following applies:
In create mode: The default is specified for the field analogous to the dialog in Customizing. In change mode: The value ' ' acts like the value '2' (calculate planned costs). SPACE is a selective value here, since you must set the parameter
additionally in the I_NETWORK_UPD structure. This is not the case in create mode. Anything else you enter generates the error CNIF_PI057. Return table ET_RETURN The BAPI in the return table ET_RETURN returns messages from the
application and a success message or error message to the caller. Thesuccess messages and error messages are grouped together in the first row in the table ET_RETURN.Notes- Definition "Processing Unit"
In the following, the term "Processing unit" refers to a series of related processing steps. The first step in a processing unit is initialization, which is done by calling the BAPI BAPI_PS_INITIALIZATION. Afterwards, the individual BAPIs listed below can be used several times, if required.
The processing unit ends when the final precommit (call BAPI BAPI_PS_PRECOMMIT) is executed with a subsequentCOMMIT WORK (for example, the statement COMMIT WORK, the BAPI"BAPI_TRANSACTION_COMMIT" or the BapiService.TransactionCommit method).
After the final COMMIT WORK, the next initialization opens a new processing unit via the BAPI "BAPI_PS_INITIALIZATION". In principal, the following applies to each individual processing unit.
- Creation of a Processing Unit
Each processing unit must be initialized by calling the BAPI "BAPI_PS_INITIALIZATION" once. Afterwards, the following individual BAPIs can be used within aprocessing unit - they can also be used more than once, taking intoaccount the "One-Project Principle" explained below. This also means
that an object created in the current processing unit by a CREATE-BAPI can be changed by a CHANGE-BAPI or STATUS-BAPI. Except for the BAPIs explicitly named below, you can only call up BAPIsthat execute GET methods or READ methods only. In particular, the BAPIs for confirming a network may not
be used with the individual BAPIs named below. Business Object ProjectDefinitionPI BAPI Method BAPI_BUS2001_CREATE ProjectDefinitionPI.CreateSingle BAPI_BUS2001_CHANGE ProjectDefinitionPI.Change
BAPI_BUS2001_DELETE ProjectDefinitionPI.Delete BAPI_BUS2001_SET_STATUS ProjectDefinitionPI.SetStatus BAPI_BUS2001_PARTNER_CREATE_M ProjectDefinitionPI.PartnerCreateMultiple BAPI_BUS2001_PARTNER_CHANGE_M ProjectDefinitionPI.PartnerChangeMultiple
BAPI_BUS2001_PARTNER_REMOVE_M ProjectDefinitionPI.PartnerRemoveMultiple Business Object WBSPI BAPI Method BAPI_BUS2054_CREATE_MULTI WBSPI.CreateMultiple BAPI_BUS2054_CHANGE_MULTI WBSPI.ChangeMultiple
BAPI_BUS2054_DELETE_MULTI WBSPI.DeleteMultiple BAPI_BUS2001_SET_STATUS WBSPI.SetStatus Business Object NetworkPI BAPI Method BAPI_BUS2002_CREATE NetworkPI.CreateFromData
BAPI_BUS2002_CHANGE NetworkPI.Change BAPI_BUS2002_DELETE NetworkPI.Delete BAPI_BUS2002_ACT_CREATE_MULTI NetworkPI.ActCreateMultiple BAPI_BUS2002_ACT_CHANGE_MULTI NetworkPI.ActChangeMultiple BAPI_BUS2002_ACT_DELETE_MULTI NetworkPI.ActDeleteMultiple
BAPI_BUS2002_ACTELEM_CREATE_M NetworkPI.ActElemCreateMultiple BAPI_BUS2002_ACTELEM_CHANGE_M NetworkPI.ActElemChangeMultiple BAPI_BUS2002_ACTELEM_DELETE_M NetworkPI.ActElemDeleteMultiple BAPI_BUS2002_SET_STATUS NetworkPI.SetStatus
The processing unit must be finished by calling the BAPIs BAPI_PS_PRECOMMIT and BAPI_TRANSACTION_COMMIT (in that order).
- One-Project Principle
For technical reasons, only the project definition and the WBS elements
of one project can be processed in a processing unit. More than one project is used, for example, if You create or change more than one projectYou have changed a project and want to change a network to which WBS elements from a different project are assigned
You want to change various networks to which WBS elements from different projects are assignedYou create or change a WBS assignment in a network so that a WBS element from a second project is usedWBS elements from different projects are already assigned to a network (note: this type of network cannot
be processed with the network BAPIs named above).If you define a report for calling BAPIs, this means that: The report may use a maximum of one project per processing unit. Theindividual BAPI calls must be distributed between more than one processing unit, which use a maximum of one project per processing
unit.
- All-Or-Nothing Principle
If an error occurs in a processing unit in an individual BAPI or in theBAPI "BAPI_PS_PRECOMMIT" (that is, the return table ET_RETURN containsat least one message of the type "E" (error), "A" (abnormal end) or "X" (exit), posting is not possible.
If an error occurs in an individual BAPI and despite this you call theBAPI "BAPI_PS_PRECOMMIT", message CNIF_PI 056 is issued with message type I (information). If an error occurs in an individual BAPI or in the BAPI "BAPI_PS_PRECOMMIT", but despite this you execute a COMMIT WORK, the
program that is currently in process is terminated and message CNIF_PI 056 is issued with message type X. This is to ensure data consistency for all objects created, changed, and/or deleted in the processing unit. Note that the processing unit to which this happens can no longer be
successfully closed and therefore, no new processing unit can be started. However, you can set the current processing unit back to an initializedstatus by using a rollback work (for example, statement ROLLBACK WORK, the BAPI "BAPI_TRANSACTION_ROLLBACK" or the method
BapiService.TransactionRollback). Technically speaking, this means thatthe previous LUW is terminated and a new LUW is started in the current processing unit. Note that in this case, the current processing unit does not have to be re-initialized. Also note that the rollback also takes place according to the "all-or-nothing" principle, that therefore all
individual BAPIs carried out up to the rollback are discarded. After a rollback, youcan, therefore, no longer refer to an object that was previously created in the current processing unit using a CREATE-BAPI. However, you can close the processing unit again after a rollback,
using a PRECOMMIT and COMMIT WORK, as long as all individual BAPIs, andthe precommit carried out after the rollback, finish without errors. You can carry out several rollbacks in a processing unit (technically: start a new LUW several times).
- Procedure in the Case of Errors
As soon as an error occurs in an individual BAPI or in the BAPI "BAPI_PS_PRECOMMIT", you have the following options: Exit the report or the program that calls the BAPIs, the PRECOMMIT and the COMMIT WORK.
Execute a rollback in the current processing unit.
- Rules for Posting
After you have successfully called the individual BAPIs of a processingunit, you must call the PRECOMMIT "BAPI_PS_PRECOMMIT". If the PRECOMMIT is also successful, the COMMIT WORK must take place directly afterwards.
In particular, note that after the PRECOMMIT, you cannot call other individual BAPIs again in the current processing unit. It is also not permitted to call the PRECOMMIT more than once in a processing unit.
- Recommendation "COMMIT WORK AND WAIT"
If an object created in a processing unit is to be used in a subsequentprocessing unit (for example, as an account assignment object in a G/Laccount posting) it is recommended to call the commit work with the supplement "AND WAIT" or to set the parameters for the BAPI
"BAPI_TRANSACTION_COMMIT" accordingly.
- Field Selection
The field selection is a tool for influencing the user interface (thatis, for the dialog). In the BAPIs, the settings from the field selection (for example, fields that are not ready for input or
required-entry) are not taken into account.
- Using a date in the BAPI interface
You must communicate the date using the internal format YYYYMMDD (year month day) to the BAPI. Ensure that you do not use any special characters.
Since a BAPI must function in a user-specific way, you cannot and maynot convert the date according to the user and according to the date format defined in the user parameters.
- Customer Enhancements of the BAPIs
For the BAPIs used to create and change project definitions, WBSelements, networks, activities, and activity elements, you canautomatically fill the fields of the tables PROJ, PRPS, AUFK, and AFVUthat have been defined for customer enhancements in the standard system.
For this purpose, help structures that contain the respective keyfields, as well as the CI include of the table are supplied. The BAPIscontain the parameter ExtensionIN in which the enhancement fields canbe entered and also provide BAdIs in which the entered values can be checked and, if required, processed further.
CI Include Help Structure Key CI_PROJ BAPI_TE_PROJECT_DEFINITION PROJECT_DEFINITION CI_PRPS BAPI_TE_WBS_ELEMENT WBS_ELEMENT CI_AUFK BAPI_TE_NETWORK
NETWORK CI_AFVU BAPI_TE_NETWORK_ACTIVITY NETWORK ACTIVITY CI_AFVU BAPI_TE_NETWORK_ACT_ELEMENT NETWORK ACTIVITY ELEMENT
Procedure for Filling Standard EnhancementsBefore you call the BAPI for each object that is to be created or changed, for which you want to enter customer-specific table
enhancement fields, add a data record to the container ExtensionIn: STRUCTURE: Name of the corresponding help structureVALUEPART1: Key of the object + start of the data partVALUEPART2-4: If required, the continuation of the data part
VALUPART1 to VALUPART4 are therefore filled consecutively, first withthe keys that identify the table rows and then with the values of thecustomer-specific fields. By structuring the container in this way, itis possible to transfer its content with one MOVE command to the structure of the BAPI table extension.
Note that when objects are changed, all fields of theenhancements are overwritten (as opposed to the standard fields, whereonly those fields for which the respective update indicator is set arechanged). Therefore, even if you only want to change one field, all the fields that you transfer in ExtensionIn must be filled.
Checks and Further ProcessingUsing the methods ...CREATE_EXIT1 or. ...CHANGE_EXIT1 of the BAdIBAPIEXT_BUS2001, BAPIEXT_BUS2002, and BAPIEXT_BUS2054, you can check the entered values (and/or carry out other checks). In the BAdI's second method, you can program that the data transferred
to the BAPI is processed further (if you only want to transfer the fields of the CI includes, no more action is required here).
For more information, refer to the SAP Library under Cross-ApplicationComponents -> Business Framework Architecture -> Enhancements,
Modifications ... -> Customer Enhancement and Modification of BAPIs -> Customer Enhancement of BAPIs (CA-BFA).
|
|
|
|
11-Dec-2005
|
|
|
|
|
Delete
Delete a network (BOR object BUS2002). ExampleThe network to be deleted is transferred to parameter I_NETWORK. Messages from the application and a success or failure message, asappropriate, are returned to the caller by the BAPI in the multiline parameter RETURN.
Only one network can be processed each time the BAPI is called. Before the network is deleted, various checks are carried out, for example: - Has the network already been released or partially released?
- Deletion authorization
- Are there already actual postings for assignment objects?
If all checks are successful, the network and all its subobjects suchas network activities, activity elements, material components, milestones, and so on, are deleted. Notes
- Definition "Processing Unit"
In the following, the term "Processing unit" refers to a series of related processing steps. The first step in a processing unit is initialization, which is done by calling the BAPI BAPI_PS_INITIALIZATION.
Afterwards, the individual BAPIs listed below can be used several times, if required. The processing unit ends when the final precommit (call BAPI BAPI_PS_PRECOMMIT) is executed with a subsequentCOMMIT WORK (for example, the statement COMMIT WORK, the BAPI
"BAPI_TRANSACTION_COMMIT" or the BapiService.TransactionCommit method). After the final COMMIT WORK, the next initialization opens a new processing unit via the BAPI "BAPI_PS_INITIALIZATION". In principal, the following applies to each individual processing unit.
- Creation of a Processing Unit
Each processing unit must be initialized by calling the BAPI "BAPI_PS_INITIALIZATION" once. Afterwards, the following individual BAPIs can be used within aprocessing unit - they can also be used more than once, taking into
account the "One-Project Principle" explained below. This also meansthat an object created in the current processing unit by a CREATE-BAPI can be changed by a CHANGE-BAPI or STATUS-BAPI. Except for the BAPIs explicitly named below, you can only call up BAPIs
that execute GET methods or READ methods only. In particular, the BAPIs for confirming a network may not be used with the individual BAPIs named below. Business Object ProjectDefinitionPI BAPI Method
BAPI_BUS2001_CREATE ProjectDefinitionPI.CreateSingle BAPI_BUS2001_CHANGE ProjectDefinitionPI.Change BAPI_BUS2001_DELETE ProjectDefinitionPI.Delete BAPI_BUS2001_SET_STATUS ProjectDefinitionPI.SetStatus BAPI_BUS2001_PARTNER_CREATE_M ProjectDefinitionPI.PartnerCreateMultiple
BAPI_BUS2001_PARTNER_CHANGE_M ProjectDefinitionPI.PartnerChangeMultiple BAPI_BUS2001_PARTNER_REMOVE_M ProjectDefinitionPI.PartnerRemoveMultiple Business Object WBSPI BAPI Method
BAPI_BUS2054_CREATE_MULTI WBSPI.CreateMultiple BAPI_BUS2054_CHANGE_MULTI WBSPI.ChangeMultiple BAPI_BUS2054_DELETE_MULTI WBSPI.DeleteMultiple BAPI_BUS2001_SET_STATUS WBSPI.SetStatus Business Object NetworkPI
BAPI Method BAPI_BUS2002_CREATE NetworkPI.CreateFromData BAPI_BUS2002_CHANGE NetworkPI.Change BAPI_BUS2002_DELETE NetworkPI.Delete BAPI_BUS2002_ACT_CREATE_MULTI NetworkPI.ActCreateMultiple
BAPI_BUS2002_ACT_CHANGE_MULTI NetworkPI.ActChangeMultiple BAPI_BUS2002_ACT_DELETE_MULTI NetworkPI.ActDeleteMultiple BAPI_BUS2002_ACTELEM_CREATE_M NetworkPI.ActElemCreateMultiple BAPI_BUS2002_ACTELEM_CHANGE_M NetworkPI.ActElemChangeMultiple
BAPI_BUS2002_ACTELEM_DELETE_M NetworkPI.ActElemDeleteMultiple BAPI_BUS2002_SET_STATUS NetworkPI.SetStatus The processing unit must be finished by calling the BAPIs BAPI_PS_PRECOMMIT and BAPI_TRANSACTION_COMMIT (in that order).
- One-Project Principle
For technical reasons, only the project definition and the WBS elementsof one project can be processed in a processing unit. More than one project is used, for example, if You create or change more than one project
You have changed a project and want to change a network to which WBS elements from a different project are assignedYou want to change various networks to which WBS elements from different projects are assignedYou create or change a WBS assignment in a network so that a WBS element from a second project is used
WBS elements from different projects are already assigned to a network (note: this type of network cannot be processed with the network BAPIs named above).If you define a report for calling BAPIs, this means that: The report may use a maximum of one project per processing unit. The
individual BAPI calls must be distributed between more than one processing unit, which use a maximum of one project per processingunit.
- All-Or-Nothing Principle
If an error occurs in a processing unit in an individual BAPI or in the
BAPI "BAPI_PS_PRECOMMIT" (that is, the return table ET_RETURN containsat least one message of the type "E" (error), "A" (abnormal end) or "X" (exit), posting is not possible. If an error occurs in an individual BAPI and despite this you call theBAPI "BAPI_PS_PRECOMMIT", message CNIF_PI 056 is issued with message type I (information).
If an error occurs in an individual BAPI or in the BAPI "BAPI_PS_PRECOMMIT", but despite this you execute a COMMIT WORK, theprogram that is currently in process is terminated and message CNIF_PI 056 is issued with message type X. This is to ensure data consistency for all objects created, changed, and/or deleted in the processing unit.
Note that the processing unit to which this happens can no longer besuccessfully closed and therefore, no new processing unit can be started. However, you can set the current processing unit back to an initializedstatus by using a rollback work (for example, statement ROLLBACK WORK, the BAPI "BAPI_TRANSACTION_ROLLBACK" or the method
BapiService.TransactionRollback). Technically speaking, this means thatthe previous LUW is terminated and a new LUW is started in the current processing unit. Note that in this case, the current processing unit does not have to be re-initialized. Also note that the rollback also takes place according to the "all-or-nothing" principle, that therefore all
individual BAPIs carried out up to the rollback are discarded. After a rollback, youcan, therefore, no longer refer to an object that was previously created in the current processing unit using a CREATE-BAPI. However, you can close the processing unit again after a rollback,
using a PRECOMMIT and COMMIT WORK, as long as all individual BAPIs, andthe precommit carried out after the rollback, finish without errors. You can carry out several rollbacks in a processing unit (technically: start a new LUW several times).
- Procedure in the Case of Errors
As soon as an error occurs in an individual BAPI or in the BAPI "BAPI_PS_PRECOMMIT", you have the following options: Exit the report or the program that calls the BAPIs, the PRECOMMIT and the COMMIT WORK.
Execute a rollback in the current processing unit.
- Rules for Posting
After you have successfully called the individual BAPIs of a processingunit, you must call the PRECOMMIT "BAPI_PS_PRECOMMIT". If the PRECOMMIT is also successful, the COMMIT WORK must take place directly afterwards.
In particular, note that after the PRECOMMIT, you cannot call other individual BAPIs again in the current processing unit. It is also not permitted to call the PRECOMMIT more than once in a processing unit.
- Recommendation "COMMIT WORK AND WAIT"
If an object created in a processing unit is to be used in a subsequentprocessing unit (for example, as an account assignment object in a G/Laccount posting) it is recommended to call the commit work with the supplement "AND WAIT" or to set the parameters for the BAPI
"BAPI_TRANSACTION_COMMIT" accordingly.
- Field Selection
The field selection is a tool for influencing the user interface (thatis, for the dialog). In the BAPIs, the settings from the field selection (for example, fields that are not ready for input or
required-entry) are not taken into account.
- Using a date in the BAPI interface
You must communicate the date using the internal format YYYYMMDD (year month day) to the BAPI. Ensure that you do not use any special characters.
Since a BAPI must function in a user-specific way, you cannot and maynot convert the date according to the user and according to the date format defined in the user parameters.
- Customer Enhancements of the BAPIs
For the BAPIs used to create and change project definitions, WBSelements, networks, activities, and activity elements, you canautomatically fill the fields of the tables PROJ, PRPS, AUFK, and AFVUthat have been defined for customer enhancements in the standard system.
For this purpose, help structures that contain the respective keyfields, as well as the CI include of the table are supplied. The BAPIscontain the parameter ExtensionIN in which the enhancement fields canbe entered and also provide BAdIs in which the entered values can be checked and, if required, processed further.
CI Include Help Structure Key CI_PROJ BAPI_TE_PROJECT_DEFINITION PROJECT_DEFINITION CI_PRPS BAPI_TE_WBS_ELEMENT WBS_ELEMENT CI_AUFK BAPI_TE_NETWORK
NETWORK CI_AFVU BAPI_TE_NETWORK_ACTIVITY NETWORK ACTIVITY CI_AFVU BAPI_TE_NETWORK_ACT_ELEMENT NETWORK ACTIVITY ELEMENT
Procedure for Filling Standard EnhancementsBefore you call the BAPI for each object that is to be created or changed, for which you want to enter customer-specific table
enhancement fields, add a data record to the container ExtensionIn: STRUCTURE: Name of the corresponding help structureVALUEPART1: Key of the object + start of the data partVALUEPART2-4: If required, the continuation of the data part
VALUPART1 to VALUPART4 are therefore filled consecutively, first withthe keys that identify the table rows and then with the values of thecustomer-specific fields. By structuring the container in this way, itis possible to transfer its content with one MOVE command to the structure of the BAPI table extension.
Note that when objects are changed, all fields of theenhancements are overwritten (as opposed to the standard fields, whereonly those fields for which the respective update indicator is set arechanged). Therefore, even if you only want to change one field, all the fields that you transfer in ExtensionIn must be filled.
Checks and Further ProcessingUsing the methods ...CREATE_EXIT1 or. ...CHANGE_EXIT1 of the BAdIBAPIEXT_BUS2001, BAPIEXT_BUS2002, and BAPIEXT_BUS2054, you can check the entered values (and/or carry out other checks). In the BAdI's second method, you can program that the data transferred
to the BAPI is processed further (if you only want to transfer the fields of the CI includes, no more action is required here).
For more information, refer to the SAP Library under Cross-ApplicationComponents -> Business Framework Architecture -> Enhancements,
Modifications ... -> Customer Enhancement and Modification of BAPIs -> Customer Enhancement of BAPIs (CA-BFA).
|
|
|
|
11-Dec-2005
|
|
|
|
|
ExistenceCheck
You use this method to check whether a network exists. NotesNUMBER is an obligatory import requirement; you use it to enter the number of the relevant network. Messsages are returned in the Return parameter. For information aboutreturn values and their meaning, see the documentation for the Return parameter.
|
|
|
|
11-Dec-2005
|
|
|
|
|
GetActGuidFromKey
Read the GUID (Global Unique Identifier) using the external object key. ExampleA list of network activities for which the GUIDs are to be read istransferred to the multiline parameter IT_EXT_KEY. This refers to thenetwork from the import parameter NUMBER and is returned by the BAPI with the external keys in the multiline parameter ET_GUID.
NotesMessages, for example, about non-existent GUIDs are returned in the multiline parameter RETURN. Only active GUIDs are returned, that is, no GUIDs from deleted networkactivites. In addition, only GUIDs that have already been saved to the database are read.
|
|
|
|
11-Dec-2005
|
|
|
|
|
GetActKeyFromGuid
Read the external object key using the GUID (Global Unique Identifier). ExampleA list of GUIDs whose external keys are to be read is transferred tothe multiline parameter IT_GUID and returned by the BAPI via the multiline parameter ET_EXT_KEY.
NotesMessages, for example, about non-existent objects, are returned in the multiline parameter RETURN. Only active GUIDs that have already been saved to the database aretaken into account, that is, no GUIDs from deleted network activities, for example.
|
|
|
|
11-Dec-2005
|
|
|
|
|
GetData
You can use the BAPI BAPI_BUS2002_GETDATA to get detailed information about a network. To do this, you must transfer the network number in the parameter I_NUMBER. If required, you can specify the language in which the language-dependent fields such as time units, system status, and so on,
are to be returned. If you do not specify a language, the system language is used. NotesThe fields that are directly assigned to the network header are returned in the structure E_NETWORK. The field LANGU specifies which language the long text is in, if one exists.
The field SYSTEM_STATUS specifies one of the following statuses:created, released, technically completed, closed. If the deletion flagor indicator is set, however, this information is returned instead of the status. Further InformationFor more information, see the SAP Library under Project System ->
Structures -> Interfaces to the Project System -> PS-EPS Interface to External Project Software.
|
|
|
|
11-Dec-2005
|
|
|
|
|
Getdetail
With this method you can read detailed information about a network including all objects from the system. NotesNUMBER is an obligatory import parameter; enter the number of the network whose data you want to receive. Messages are returned in the Return parameter For information about the
return values and their meaning, see the documemtation about the return parameter. Further InformationFor more information see the R/3 Library for PS-Project system - Network.
|
|
|
|
11-Dec-2005
|
|
|
|
|
GetElemGuidFromKey
Read the GUID (Global Unique Identifier) using the external object key. ExampleA list of activity elements for which the GUIDs are to be read istransferred by parameter IT_EXT_KEY. This refers to the network of theimport parameter NUMBER and is returned by the BAPI via the external key of the multiline parameter ET_GUID.
NotesMessages, for example, about non-existent GUIDs, are returned in the parameter RETURN. Only active GUIDs are returned, that is, no GUIDs from deleted activityelements. In addition, only GUIDs that have already been saved to the database are read.
|
|
|
|
11-Dec-2005
|
|
|
|
|
GetElemKeyFromGuid
Read the external object key using the GUID (Global Unique Identifier). ExampleA list of GUIDs for which the external keys are to be read istransferred to parameter IT_GUID. These refer to the network of importparameter NUMBER and are returned by the BAPI with the corresponding GUIDs in the multiline parameter ET_EXT_KEY.
NotesMessages, for example, about non-existent objects, are returned in parameter RETURN. Only active GUIDs that have already been saved to the database aretaken into account, that is, no GUIDs from deleted activity elements for example.
|
|
|
|
11-Dec-2005
|
|
|
|
|
GetGuidFromKey
Read the GUID (Global Unique Identifier) using the external object key. ExampleA list of networks for which the GUIDs are to be read is transferred tothe multiline parameter IT_EXT_KEY. These are returned by the BAPI with the external keys in the multiline parameter ET_GUID.
NotesMessages, for example, about non-existent GUIDs are returned in the multiline parameter ET_RETURN. Only active GUIDs are returned, that is, no GUIDs from deletednetworks. In addition, only GUIDs that have already been saved to the database are taken into account.
|
|
|
|
11-Dec-2005
|
|
|
|
|
Getinfo
You can use this method to read detailed information abot networks, including all objects, from the system. NotesI_NETWORK_LIST is an obligatory import parameter; here you enter from which networks you want to receive information. Messages are returned in the Return parameter. For information about
the return values and their meaning, see the documemtation about the return parameter. Further InformationFor more information, see the R/3 Library for PS-Project system - Networks.
|
|
|
|
11-Dec-2005
|
|
|
|
|
GetKeyFromGuid
Read the external object key using the GUID (Global Unique Identifier). ExampleA list of GUIDs for which the external keys are to be read istransferred to the multiline parameter IT_GUID. They are returned bythe BAPI with the corresponding GUIDs in the multiline parameter ET_EXT_KEY.
NotesMessages, for exmaple, about non-existent objects, are returned in the multiline parameter ET_RETURN. Only active GUIDs that have already been saved to the database are taken into account, that is, no GUIDs from deleted networks.
|
|
|
|
11-Dec-2005
|
|
|
|
|
Getlist
Produces a list of networks with descriptions according to the following selection criteria: Number of networks found Network number Network description Plant of the network
|
|
|
|
11-Dec-2005
|
|
|
|
|
GetStatus
Using the BAPI BAPI_BUS2002_GET_STATUS, both the active system statusesand user statuses for a network header (NUMBER) as well as its activities can be read. Active system statuses are output using the English-language key. Active user statuses are output in the current logon language using the
key, in case a translation of the status in the source status profileexists in the logon language, or the maintenance language of the status profile is the same as the logon language. If the status in the status profile does not exist in the logonlanguage, the key is output in the maintenance language of the status profile.
The import parameter (WITHOUT_ACTIVITIES) determines whether the statusis read only for the network header or also for the network activities as well. NotesAn error message appears in the RETURN return parameter if an error occurred during processing.
Further InformationFor more information see the SAP Library under Project System ->Structures -> Project System Interfaces -> PS-EPS Interface for External Project Management Systems.
|
|
|
|
11-Dec-2005
|
|
|
|
|
Maintain
Network.MaintainIt is possible to edit network headers, activities and relationshipsusing the Maintain BAPI of the network business object. The BAPIcontains a complete transaction. It is possible to carry out severaloperations on the network objects with one call. The R/3 Project System
determines the order in which the objects are processed. The caller canchoose the operations in any order. As a result the processing is veryspeedy and effective. However, this transaction concept does not include the use and combination of other SAP BAPIs in the same LUW.
ProcedureThe Network business object is a facade pattern for networks, their activities, and relationships. If you want to edit a network object, enter a command for an objecttype. In addition, enter the object key and a reference to its attributes. In the table parameter IMethodProject, enter the object
type, the command and the object key. As a reference enter the index ofthe object data table of the relevant object type. In the object data table enter the information on the object. When entering the object type 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, enterthe 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 parameter informs you 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 for the individual object typesObject type: Network
The network number is the key that identifies each network object type. Command: CreateUse this command to create a network using the specified networknumber. The network number is determined by the external system. Forthe 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. ExampleCreating a network with the network number TRAINING0001 . Enter the keyof 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 = Network METHOD = Create OBJECTKEY = TRAINING0001 REFNUMBER = 000001
OBJECTTYPE = METHOD = Save OBJECTKEY = REFNUMBER =
INetwork Index = 1 NETWORK = TRAINING0001 SHORT_TEXT = New network FINISH_DATE = 12/04/1999 Profile = EPS40_1 ...
Command: UpdateUse this command to change 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 keepthe other values. Using the update structure you specify exactly theattributes 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 thefact that the table of the update structure must also be filled for theother commands of the network. The reference number of the commandtable has to match the same index of the network table and the table containing the update structures.
ExampleChanging the description of the existing network TRAINING0001. IMethodProject OBJECTTYPE = Network METHOD = Update OBJECTKEY = TRAINING0001 REFNUMBER = 000001
OBJECTTYPE = METHOD = Save OBJECTKEY = REFNUMBER =
INetwork
Index = 1 NETWORK = TRAINING0001 SHORT_TEXT = Description changed
INetworkUpdate Index = 1 NETWORK = SHORT_TEXT = X
Command: Delete (from R/3 Release 4.5A)Use this command to Delete a network that already exists in the R/3 Project System. The network has the Deletion flag
system status which can be revoked in the R/3 Project System. Therefore, the network remains in the database physically. ExampleDeleting the network TRAINING0001 IMethodProject OBJECTTYPE = Network METHOD = Delete OBJECTKEY = TRAINING0001 REFNUMBER = 000001
OBJECTTYPE = METHOD = Save OBJECTKEY = REFNUMBER =
INetwork Index = 1 NETWORK = TRAINING0001
Command: ScheduleUse this command to schedule a network. ExampleThe network TRAINING0001 is rescheduled.
IMethodProject OBJECTTYPE = Network METHOD = Schedule OBJECTKEY = TRAINING0001 REFNUMBER = 000001
OBJECTTYPE = METHOD = Save OBJECTKEY = REFNUMBER =
INetwork Index = 1 NETWORK = TRAINING0001
Command: Calculate
Use this command to calculate costs for a network. ExampleCalculating costs for the TRAINING0001 network. IMethodProject OBJECTTYPE = Network METHOD = Calculate OBJECTKEY = TRAINING0001 REFNUMBER = 000001
OBJECTTYPE = METHOD = Save OBJECTKEY = REFNUMBER =
INetwork Index = 1 NETWORK = TRAINING0001
Command: Release (from R/3 release 4.5A)Use this command to release a network with all its activities. ExamplesReleasing the TRAINING0001 network. IMethodProject OBJECTTYPE = Network METHOD = Release OBJECTKEY = TRAINING0001 REFNUMBER = 000001
OBJECTTYPE = METHOD = Save OBJECTKEY = REFNUMBER =
INetwork Index = 1 NETWORK = TRAINING0001
Command: Lock (from R/3 release 4.6A)Use this command to lock a network. The Locked system status is set for a network.
ExampleLocking the network TRAINING0001 . IMethodProject OBJECTTYPE = Network METHOD = Lock OBJECTKEY = TRAINING0001 REFNUMBER = 000001
OBJECTTYPE = METHOD = Save OBJECTKEY = REFNUMBER =
INetwork Index = 1 NETWORK = TRAINING0001
Command: Unlock (from R/3 release 4.6A)Use this command to unlock a network The Locked system status is removed from a network ExampleUnlocking the network TRAINING0001 . IMethodProject OBJECTTYPE = Network METHOD = Unlock OBJECTKEY = TRAINING0001 REFNUMBER = 000001
OBJECTTYPE = METHOD = Save OBJECTKEY = REFNUMBER =
INetwork Index = 1 NETWORK = TRAINING0001
Object Type: NetworkActivityThe key of the Network activity object consists of the network number and the activity number.
If you want to apply a command to the network activity, you must alwaysinclude the superior network in the same call in the table of the INetwork parameter. Command: CreateUse this command to create a new activity in a network. Example
Creating a new network activity with the number 0010 in the TRAINING0001 network. IMethodProject OBJECTTYPE = NetworkActivity METHOD = Create OBJECTKEY = TRAINING00010010 REFNUMBER = 000001
OBJECTTYPE = METHOD = Save OBJECTKEY = REFNUMBER =
IActivity Index = 1 NETWORK = TRAINING0001 ACTIVITY = 0010 DESCRIPTION = Activity 10
INetwork Index = 1 NETWORK = TRAINING0001
Command: UpdateUse this command to change an activity that already exists in the R/3 Project System.
Use the update structure as in networks. Example Changing the description of the activity 0010 in network TRAINING0001. IMethodProject OBJECTTYPE = NetworkActivity METHOD = Update OBJECTKEY = TRAINING00010010 REFNUMBER = 000001
OBJECTTYPE = METHOD = Save OBJECTKEY = REFNUMBER =
IActivity Index = 1 NETWORK = TRAINING0001 ACTIVITY = 0010 DESCRIPTION = Activity 10 changed
IActivityUpdate Index = 1 NETWORK = ACTIVITY = DESCRIPTION = X
INetwork Index = 1 NETWORK = TRAINING0001
Command: DeleteUse this command to delete an activity that already exists in the R/3 Project System. The activity receives the deletion flag system status and is not deleted physically. Connected objects as
relationships, activity elements, capacity requirements, purchaserequisitions, and material components are also deallocated and selected for deletion. You cannot create an activity with the same key. ExampleChanging the description of the activity 0010 in network TRAINING0001.
IMethodProject OBJECTTYPE = NetworkActivity METHOD = Delete OBJECTKEY = TRAINING00010010 REFNUMBER = 000001
OBJECTTYPE = METHOD = Save OBJECTKEY = REFNUMBER =
IActivity Index = 1 NETWORK = TRAINING0001 ACTIVITY = 0010
INetwork Index = 1 NETWORK = TRAINING0001
Command: Release (from R/3 release 4.5A)Use this command to release a network activity. ExampleReleasing the activity 0010 in network TRAINING0001 . IMethodProject OBJECTTYPE = NetworkActivity METHOD = Release OBJECTKEY = TRAINING00010010 REFNUMBER = 000001
OBJECTTYPE = METHOD = Save OBJECTKEY = REFNUMBER =
IActivity Index = 1 NETWORK = TRAINING0001 ACTIVITY = 0010
INetwork Index = 1 NETWORK = TRAINING0001
Objecttype: NetworkActivityElement (from R/3 Release 4.6A)
The key for the activity element object comprises of the network number, the activity number, and the activity element number. Command: CreateUse this command to create a new activity element in a network. Example
Creating a new activity element with the number 0020 in activity 0010 of the TRAINING0001 network . IMethodProject OBJECTTYPE = NetworkActivityElement METHOD = Create OBJECTKEY = TRAINING000100100020 REFNUMBER = 000001
OBJECTTYPE = METHOD = Save OBJECTKEY = REFNUMBER =
IActivityElement Index = 1 NETWORK = TRAINING0001
ACTIVITY = 0010 ELEMENT = 0020
Command: UpdateUse this command to change an activity element that already exists in the R/3 Project System. Use the update structure as for networks. ExampleChanging an existing activity element with the number 0020 in activity 0010 of the TRAINING0001 network. IMethodProject
OBJECTTYPE = NetworkActivityElement METHOD = Update OBJECTKEY = TRAINING000100100020 REFNUMBER = 000001 OBJECTTYPE = METHOD = Save OBJECTKEY = REFNUMBER =
IActivityElement Index = 1 NETWORK = TRAINING0001 ACTIVITY = 0010 ELEMENT = 0020
DESCRIPTION = Activity element 0020 changed
IActivityElementUpdate Index = 1 NETWORK = ACTIVITY = ELEMENT = DESCRIPTION = X
Command: DeleteUse this command to delete an activity element that already exists in the R/3 Project System. The activity element receives the
Deletion flag status and is not deleted physically. Connected objects such ascapacity requirements and purchase requisitions are also deallocated or marked for deletion. You cannot create a new activity element with the same key. Example
Deleting an activity element with the number 0020 in activity 0010 in the TRAINING0001 network. IMethodProject OBJECTTYPE = NetworkActivityElement METHOD = Delete OBJECTKEY = TRAINING000100100020 REFNUMBER = 000001 OBJECTTYPE = METHOD = Save OBJECTKEY = REFNUMBER =
IActivityElement Index = 1 NETWORK = TRAINING0001
ACTIVITY = 0010 ELEMENT = 0020
Object type: ActivityMilestone (from R/3 Release 4.6A)The key of the activity milestone object is the milestone number. Command: CreateUse this command to create a new activity milestone for a network. It
is not necessary to enter a number for the milestone. When the milestone is created, the system gives it a number and returns thisnumber in the message table as an information message. However, if an external number is entered in the method table during
creation, the external number and the new milestone number are returned in an information message. ExampleCreating a new activity milestone for activity 0010 in the TRAINING0001 network . IMethodProject OBJECTTYPE = ActivityMilestone METHOD = Create OBJECTKEY = REFNUMBER = 000001
OBJECTTYPE = METHOD = Save OBJECTKEY = REFNUMBER =
IActivityMilestone Index = 1 MILESTONE_NUMBER = NETWORK = TRAINING0001 ACTIVITY = 0010
Command: UpdateUse this command to change an activity milestone that already exists in
the R/3 Project System. It is always necessary to enter the network, if you do not make any explicit changes to the network. Use the update structure as for networks. Example Changing an existing activity milestone with the number 000000002097 for the TRAINING0001 network.
IMethodProject OBJECTTYPE = ActivityMilestone METHOD = Update OBJECTKEY = REFNUMBER = 000001
OBJECTTYPE = METHOD = Save OBJECTKEY = REFNUMBER =
IActivityMilestone Index = 1 MILESTONE_NUMBER = 000000002097 DESCRIPTION = Milestone description changed
NETWORK = TRAINING0001 IActivityMilestoneUp Index = 1 MILESTONE_NUMBER = DESCRIPTION = X
Command: DeleteUse this command to delete an activity milestone that already exists inthe R/3 Project System. The milestone is deleted physically. It is
necessary to enter the network, if you do not make any explicit changes to the network. ExampleDeleting an activity milestone with the number 000000002097 in the TRAINING0001 network. IMethodProject OBJECTTYPE = ActivityMilestone METHOD = Delete OBJECTKEY = 000000002097 REFNUMBER = 000001
OBJECTTYPE = METHOD = Save OBJECTKEY = REFNUMBER =
IActivityMilestone Index = 1 MILESTONE_NUMBER = 000000002097
Object Type: NetworkRelationThe 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 theImplementation Guide (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 connectednetworks in the same call in the table of the INetwork parameter. Command: CreateUse this command to create a relationship between two activities.
ExampleCreating a relationship between the activities 0010 and 0020 of theTRAINING0001 network . The two activities are linked through an FS relationship. IMethodProject OBJECTTYPE = NetworkRelation METHOD = Create OBJECTKEY = NFTRAINING00010010TRAINING00010020
REFNUMBER = 000001 OBJECTTYPE = METHOD = Save OBJECTKEY = REFNUMBER =
IRelation Index = 1 NETWORK_ PREDECESSOR = TRAINING0001 ACTIVITY_ PREDECESSOR = 0010 NETWORK_ SUCCESSOR = TRAINING0001 ACTIVITY_ SUCCESSOR =0020 RELATION_ TYPE = NF
INetwork Index = 1
NETWORK = TRAINING0001
Command: UpdateUse this command to change a relationship that already exists in theR/3 Project System. The type of relationship cannot be changed, becauseit is part of the relationship key. If you want to change the relationship type, delete the relationship create a new relationship
with a new relationship type Use the update structure as for networks. Command: DeleteUse this command to delete a relationship that links two activities. The relationship is deleted physically. ExampleDeleting the relationship between the activities 0010 and 0020 in the TRAINING0001 network. IMethodProject
OBJECTTYPE = NetworkRelation METHOD = Delete OBJECTKEY = NFTRAINING00010010TRAINING00010020 REFNUMBER = 000001 OBJECTTYPE = METHOD = Save OBJECTKEY = REFNUMBER = IRelation Index = 1 NETWORK_ PREDECESSOR = TRAINING0001 ACTIVITY_ PREDECESSOR = 0010
NETWORK_ SUCCESSOR = TRAINING0001 ACTIVITY_ SUCCESSOR =0020 RELATION_ TYPE = NF
INetwork Index = 1 NETWORK = TRAINING0001
Testing the Interface and Displaying the Diagnosis Information(from R/3 Release 4.5)
You can save the data that is transferred to the R/3 Project System inafile for test and diagnosis purposes. All the table parameter andstructure parameter entries are saved in this trace file. The caller of the Maintain BAPI can check the interface.
The trace file is saved locally by the SAPGUI. Creating the fileconsumes runtime, and should therefore only be used for testing and not in an operative system. The trace file is created, if object type Trace and method Create areentered in the IMethodProject table. The system requests as the object
key the directory and the file name. Do not enter a reference number. ExampleCreating the trace file EPS_Test_Trace.txt in the directory C:\TMP\ . IMethodProject OBJECTTYPE = Trace METHOD = Create OBJECTKEY = C:\TMP\EPS_Test_Trace.txt REFNUMBER =
Further InformationFor more information, see the R/3 Library under Project System -> Structures -> EPS -> Interfaces to the ProjectSystem.
|
|
|
|
11-Dec-2005
|
|
|
|
|
SetStatus
You can use the BAPI BAPI_BUS2002_SET_STATUS to revoke one systemstatus (UNDO_SYSTEM_STATUS) and one user status (UNDO_USER_STATUS)respectively, or to set one system status (SET_SYSTEM_STATUS) and oneuser status (SET_USER_STATUS) respectively, in the network header (NUMBER).
At the same time, you can revoke one system status and one user status,or set one system status and one user status in a list of activities for the network. The following system statuses are supported for the network header: 'REL' Released (I0002) set
'LKD' Locked (I0043) set/revoke'TECO' Technically completed (I0045) set/revoke'CLSD' Closed (I0046) set/revoke'AALK' Account Assignment locked (I0064) set/revoke'DLFL' Deletion flag (I0076) set/revokeThe following system statuses are supported for the network operations:
'REL' Released (I0002) set'TECO' Technically completed (I0045) set/revoke'CLSD' Closed (I0046) set/revoke'AALK' Account Assignment locked (I0064) set/revoke'DLFL' Deletion flag (I0076) set/revoke'DSEX' Dates set by external system (I0029) set/revoke
User statuses can be set or revoked in accordance with the statusprofile assigned to the network header or network activities. They must be transferred via the key in the relevant log-on language. The processing sequence is as follows: - Network header:
- Revoke system status
- Revoke user status
- Set system status
- Set user status
- Network operations:
- Revoke system status
- Revoke user status
- Set system status
- Set user status
If you cannot set/revoke a system/user status, all of the other activities will still be executed. The inheritance of statuses is not integrated between the project andthe network. A status change only affects the current network and not any other assigned projects/WBS elements.
Milestone functions are not supported. The call of the BAPI can be repeated until a LUW (Logical Unit of Work)is completed with the BAPIs BAPI_PS_PRECOMMIT and BAPI COMMIT WORK. Notes- Definition "Processing Unit"
In the following, the term "Processing unit" refers to a series of related processing steps. The first step in a processing unit is initialization, which is done by calling the BAPI BAPI_PS_INITIALIZATION. Afterwards, the individual BAPIs listed below can be used several times, if required.
The processing unit ends when the final precommit (call BAPI BAPI_PS_PRECOMMIT) is executed with a subsequentCOMMIT WORK (for example, the statement COMMIT WORK, the BAPI"BAPI_TRANSACTION_COMMIT" or the BapiService.TransactionCommit method).
After the final COMMIT WORK, the next initialization opens a new processing unit via the BAPI "BAPI_PS_INITIALIZATION". In principal, the following applies to each individual processing unit.
- Creation of a Processing Unit
Each processing unit must be initialized by calling the BAPI "BAPI_PS_INITIALIZATION" once. Afterwards, the following individual BAPIs can be used within aprocessing unit - they can also be used more than once, taking intoaccount the "One-Project Principle" explained below. This also means
that an object created in the current processing unit by a CREATE-BAPI can be changed by a CHANGE-BAPI or STATUS-BAPI. Except for the BAPIs explicitly named below, you can only call up BAPIsthat execute GET methods or READ methods only. In particular, the BAPIs for confirming a network may not
be used with the individual BAPIs named below. Business Object ProjectDefinitionPI BAPI Method BAPI_BUS2001_CREATE ProjectDefinitionPI.CreateSingle BAPI_BUS2001_CHANGE ProjectDefinitionPI.Change
BAPI_BUS2001_DELETE ProjectDefinitionPI.Delete BAPI_BUS2001_SET_STATUS ProjectDefinitionPI.SetStatus BAPI_BUS2001_PARTNER_CREATE_M ProjectDefinitionPI.PartnerCreateMultiple BAPI_BUS2001_PARTNER_CHANGE_M ProjectDefinitionPI.PartnerChangeMultiple
BAPI_BUS2001_PARTNER_REMOVE_M ProjectDefinitionPI.PartnerRemoveMultiple Business Object WBSPI BAPI Method BAPI_BUS2054_CREATE_MULTI WBSPI.CreateMultiple BAPI_BUS2054_CHANGE_MULTI WBSPI.ChangeMultiple
BAPI_BUS2054_DELETE_MULTI WBSPI.DeleteMultiple BAPI_BUS2001_SET_STATUS WBSPI.SetStatus Business Object NetworkPI BAPI Method BAPI_BUS2002_CREATE NetworkPI.CreateFromData
BAPI_BUS2002_CHANGE NetworkPI.Change BAPI_BUS2002_DELETE NetworkPI.Delete BAPI_BUS2002_ACT_CREATE_MULTI NetworkPI.ActCreateMultiple BAPI_BUS2002_ACT_CHANGE_MULTI NetworkPI.ActChangeMultiple BAPI_BUS2002_ACT_DELETE_MULTI NetworkPI.ActDeleteMultiple
BAPI_BUS2002_ACTELEM_CREATE_M NetworkPI.ActElemCreateMultiple BAPI_BUS2002_ACTELEM_CHANGE_M NetworkPI.ActElemChangeMultiple BAPI_BUS2002_ACTELEM_DELETE_M NetworkPI.ActElemDeleteMultiple BAPI_BUS2002_SET_STATUS NetworkPI.SetStatus
The processing unit must be finished by calling the BAPIs BAPI_PS_PRECOMMIT and BAPI_TRANSACTION_COMMIT (in that order).
- One-Project Principle
For technical reasons, only the project definition and the WBS elements
of one project can be processed in a processing unit. More than one project is used, for example, if You create or change more than one projectYou have changed a project and want to change a network to which WBS elements from a different project are assigned
You want to change various networks to which WBS elements from different projects are assignedYou create or change a WBS assignment in a network so that a WBS element from a second project is usedWBS elements from different projects are already assigned to a network (note: this type of network cannot
be processed with the network BAPIs named above).If you define a report for calling BAPIs, this means that: The report may use a maximum of one project per processing unit. Theindividual BAPI calls must be distributed between more than one processing unit, which use a maximum of one project per processing
unit.
- All-Or-Nothing Principle
If an error occurs in a processing unit in an individual BAPI or in theBAPI "BAPI_PS_PRECOMMIT" (that is, the return table ET_RETURN containsat least one message of the type "E" (error), "A" (abnormal end) or "X" (exit), posting is not possible.
If an error occurs in an individual BAPI and despite this you call theBAPI "BAPI_PS_PRECOMMIT", message CNIF_PI 056 is issued with message type I (information). If an error occurs in an individual BAPI or in the BAPI "BAPI_PS_PRECOMMIT", but despite this you execute a COMMIT WORK, the
program that is currently in process is terminated and message CNIF_PI 056 is issued with message type X. This is to ensure data consistency for all objects created, changed, and/or deleted in the processing unit. Note that the processing unit to which this happens can no longer be
successfully closed and therefore, no new processing unit can be started. However, you can set the current processing unit back to an initializedstatus by using a rollback work (for example, statement ROLLBACK WORK, the BAPI "BAPI_TRANSACTION_ROLLBACK" or the method
BapiService.TransactionRollback). Technically speaking, this means thatthe previous LUW is terminated and a new LUW is started in the current processing unit. Note that in this case, the current processing unit does not have to be re-initialized. Also note that the rollback also takes place according to the "all-or-nothing" principle, that therefore all
individual BAPIs carried out up to the rollback are discarded. After a rollback, youcan, therefore, no longer refer to an object that was previously created in the current processing unit using a CREATE-BAPI. However, you can close the processing unit again after a rollback,
using a PRECOMMIT and COMMIT WORK, as long as all individual BAPIs, andthe precommit carried out after the rollback, finish without errors. You can carry out several rollbacks in a processing unit (technically: start a new LUW several times).
- Procedure in the Case of Errors
As soon as an error occurs in an individual BAPI or in the BAPI "BAPI_PS_PRECOMMIT", you have the following options: Exit the report or the program that calls the BAPIs, the PRECOMMIT and the COMMIT WORK.
Execute a rollback in the current processing unit.
- Rules for Posting
After you have successfully called the individual BAPIs of a processingunit, you must call the PRECOMMIT "BAPI_PS_PRECOMMIT". If the PRECOMMIT is also successful, the COMMIT WORK must take place directly afterwards.
In particular, note that after the PRECOMMIT, you cannot call other individual BAPIs again in the current processing unit. It is also not permitted to call the PRECOMMIT more than once in a processing unit.
- Recommendation "COMMIT WORK AND WAIT"
If an object created in a processing unit is to be used in a subsequentprocessing unit (for example, as an account assignment object in a G/Laccount posting) it is recommended to call the commit work with the supplement "AND WAIT" or to set the parameters for the BAPI
"BAPI_TRANSACTION_COMMIT" accordingly.
- Field Selection
The field selection is a tool for influencing the user interface (thatis, for the dialog). In the BAPIs, the settings from the field selection (for example, fields that are not ready for input or
required-entry) are not taken into account.
- Using a date in the BAPI interface
You must communicate the date using the internal format YYYYMMDD (year month day) to the BAPI. Ensure that you do not use any special characters.
Since a BAPI must function in a user-specific way, you cannot and maynot convert the date according to the user and according to the date format defined in the user parameters.
- Customer Enhancements of the BAPIs
For the BAPIs used to create and change project definitions, WBSelements, networks, activities, and activity elements, you canautomatically fill the fields of the tables PROJ, PRPS, AUFK, and AFVUthat have been defined for customer enhancements in the standard system.
For this purpose, help structures that contain the respective keyfields, as well as the CI include of the table are supplied. The BAPIscontain the parameter ExtensionIN in which the enhancement fields canbe entered and also provide BAdIs in which the entered values can be checked and, if required, processed further.
CI Include Help Structure Key CI_PROJ BAPI_TE_PROJECT_DEFINITION PROJECT_DEFINITION CI_PRPS BAPI_TE_WBS_ELEMENT WBS_ELEMENT CI_AUFK BAPI_TE_NETWORK
NETWORK CI_AFVU BAPI_TE_NETWORK_ACTIVITY NETWORK ACTIVITY CI_AFVU BAPI_TE_NETWORK_ACT_ELEMENT NETWORK ACTIVITY ELEMENT
Procedure for Filling Standard EnhancementsBefore you call the BAPI for each object that is to be created or changed, for which you want to enter customer-specific table
enhancement fields, add a data record to the container ExtensionIn: STRUCTURE: Name of the corresponding help structureVALUEPART1: Key of the object + start of the data partVALUEPART2-4: If required, the continuation of the data part
VALUPART1 to VALUPART4 are therefore filled consecutively, first withthe keys that identify the table rows and then with the values of thecustomer-specific fields. By structuring the container in this way, itis possible to transfer its content with one MOVE command to the structure of the BAPI table extension.
Note that when objects are changed, all fields of theenhancements are overwritten (as opposed to the standard fields, whereonly those fields for which the respective update indicator is set arechanged). Therefore, even if you only want to change one field, all the fields that you transfer in ExtensionIn must be filled.
Checks and Further ProcessingUsing the methods ...CREATE_EXIT1 or. ...CHANGE_EXIT1 of the BAdIBAPIEXT_BUS2001, BAPIEXT_BUS2002, and BAPIEXT_BUS2054, you can check the entered values (and/or carry out other checks). In the BAdI's second method, you can program that the data transferred
to the BAPI is processed further (if you only want to transfer the fields of the CI includes, no more action is required here).
For more information, refer to the SAP Library under Cross-ApplicationComponents -> Business Framework Architecture -> Enhancements,
Modifications ... -> Customer Enhancement and Modification of BAPIs -> Customer Enhancement of BAPIs (CA-BFA). The return parameter RETURN will contain an error message if an erroroccurred during processing. After the call, the table E_MESSAGE_TABLE contains all messages that were created during processing.
Further InformationYou can find additional information in the SAP Library under ProjectSystem -> Structures -> Project System Interfaces -> PS-EPS Interface to External Project Management Systems.
|
|
|
|
11-Dec-2005
|
|
|
|
|