|
|
|
|
WBSPI
The business object work breakdown structure is a hierarchical
outline of a project defined by a project definition. The work
breakdown structure is the basis for the organization and coordination of a project.
A work breakdown structure consists of different work breakdown
structure elements (WBS elements). The WBS elements describe tasks or
subtasks in the project, to be carried out within a defined time period.
Integration
Costs and revenues are collected to the WBS elements.
|
|
|
|
11-Dec-2005
|
|
|
|
|
Available Methods
- ChangeMultiple : Change WBS Elements by BAPI [ BAPI_BUS2054_CHANGE_MULTI ]
- CreateMultiple : Create WBS Elements by BAPI [ BAPI_BUS2054_CREATE_MULTI ]
- DeleteMultiple : Delete WBS Elements by BAPI [ BAPI_BUS2054_DELETE_MULTI ]
- GetData : Detail Data for WBS Elements [ BAPI_BUS2054_GETDATA ]
- GetGuidFromKey : GetGuidFromKey [ BAPI_BUS2054_GET_GUID_FROM_KEY ]
- Getinfo : Read detailed information about WBS [ BAPI_PROJECT_GETINFO ]
- GetKeyFromGuid : GetKeyFromGuid [ BAPI_BUS2054_GET_KEY_FROM_GUID ]
- GetStatus : Read Status for BUS2054 (WorkBreak [ BAPI_BUS2054_GET_STATUS ]
- Maintain : BAPI: Project maintenance [ BAPI_PROJECT_MAINTAIN ]
- SaveReplica : Replicate work breakdown structure (ALE) [ BAPI_PROJECT_SAVEREPLICA ]
- SetStatus : Set/Revoke Status for BUS2054 (Work Breakdown Structure) [ BAPI_BUS2054_SET_STATUS ]
|
|
|
|
11-Dec-2005
|
|
|
|
|
ChangeMultiple
WBS elements of a project can be changed with BAPI "BAPI_BUS2054_CHANGE_MULTI". Here, parameter I_PROJECT_DEFINITION mustcontain the project definition to which the WBS elements belong. Thenames of the individual WBS elements (WBS_ELEMENT) and the new values
must be entered in table "IT_WBS_ELEMENT_TABLE". The names of theindividual WBS elements (WBS_ELEMENT) must also be entered in table "IT_WBS_ELEMENT_TABLE_UPD", so that they can be assigned. In addition,the fields that are to be changed are flagged here with an 'X'. The other fields remain unchanged.
Before anything is changed, the following is checked: Is another project already being processed in the LUW (Logical Unit of Work)?Can the project be locked?If the checks were not successful, nothing is changed. Otherwise, eachWBS element is changed individually in "IT_WBS_ELEMENT_TABLE", although first the following is checked:
Is the changed data still consistent?Does each individual entry in table "IT_WBS_ELEMENT_TABLE" have acorresponding entry in table "IT_WBS_ELEMENT_TABLE_UPD" (same entry WBS_ELEMENT)?If all checks were successful, the individual WBS element is changed in the document tables.
As soon as a LUW (Logical Unit of Work) is completed with the BAPIBAPI_PS_PRECOMMIT and COMMIT WORK, the WBS element is finally changed. Only one project or WBS element from a project can be processed at a time in one LUW. The return parameter RETURN displays first an error or success message
that shows whether the WBS element could be changed. The first messagevariable contains the object type, the second contains the object ID,and the fourth contains the GUID (if it could be read). All relatedmessages that were generated during processing are listed underneath
the error or success messages. The parameters of the individual messages are filled with the object ID. 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). Further InformationFor more information, refer to the SAP Library under Project System ->Structures -> Project System Interfaces -> PS-EPS Interface to External Project Management Systems.
|
|
|
|
11-Dec-2005
|
|
|
|
|
CreateMultiple
WBS elements can be created for a project with BAPI "BAPI_BUS2054_CREATE_MULTI". To do this, parameter"I_PROJECT_DEFINITION" must contain the project definition for whichthe WBS elements are to be created. The individual WBS elements withall required values must be entered in table "IT_WBS_ELEMENT_TABLE".
The WBS elements are created next to each other, in the same sequenceas in table "IT_WBS_ELEMENT_TABLE". A WBS element under which the new WBS elements are to be created can be specified in parameter"I_WBS_UP". A WBS element that is to be located directly to the left of
the new WBS elements can be specified with parameter "I_WBS_LEFT". If"I_WBS_LEFT" is not specified, the new WBS elements are added on theleft-hand side. If I_WBS_UP is also not specified, the new WBS elements are added on the left and on the first level.
Before anything is created, the following is checked: Is another project already being processed in the LUW (Logical Unit of Work)?Can the project be locked?If one check was not successful, nothing is created. Otherwise, eachWBS element is changed individually in "IT_WBS_ELEMENT_TABLE", although the following is checked first:
Is the data consistent?If all checks were succussful, the individual WBS element is created inthe document tables. Afterwards, the hierarchy is updated, that is thenew elements are added in the appropriate place as described above. Ifan error occurs while this is being carried out, the new elements are
created on the right-hand side, on the first level, and an errormessage is generated in the return table. An error can occur if the WBSelement in I_WBS_UP and I_WBS_LEFT does not exist in the specifiedproject, or I_WBS_UP is not directly above I_WBS_LEFT if both are
specified, or because an inconsistency occurs in the hierarchy for another reason. As soon as a LUW (Logical Unit of Work) is completed with BAPI BAPI_PS_PRECOMMIT and COMMIT WORK, the WBS elements are finallychanged. Only one project or WBS element from a project can be processed at a time in a LUW.
The return parameter RETURN displays first an error or success messagethat shows whether the WBS elements could be created. The first messagevariable contains the object type, the second contains the object ID,and the fourth contains the GUID (if it could be read). All related
messages that were generated during processing are listed underneaththe error or success messages. The parameters of the individual messages are filled with the object ID. 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). Further InformationFor more information, refer to the SAP Library under Project System ->Structures -> Project System Interfaces -> PS-EPS Interface to External Project Management Systems.
|
|
|
|
11-Dec-2005
|
|
|
|
|
DeleteMultiple
WBS elements can be deleted for a project with BAPI "BAPI_BUS2054_DELETE_MULTI". To do this, parameter"I_PROJECT_DEFINITION" must contain the project definition to which theWBS elements to be deleted belong. Table "IT_WBS_ELEMENT_TABLE" must contain the WBS elements that are to be deleted.
Before the WBS elements are deleted, the following is checked: Is another project already being processed in the LUW (Logical Unit of Work)?Can the project be locked?If one check was not successful, nothing is deleted. Otherwise, each
WBS element in "IT_WBS_ELEMENT_TABLE" is deleted in the document table. If other WBS elements belong to a WBS element, these are also deleted.If other objects belong to a WBS element, the WBS element cannot be deleted. Return parameter RETURN displays first an error or success message that
shows whether the WBS element could be deleted. The first messagevariable contains the object type, the second contains the object ID,and the fourth contains the GUID (if it could be generated). All related messages that were generated during processing are listed
underneath the success or error messages. The parameters of the individual messages are filled with the object ID. 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). Further InformationFor more information, refer to the SAP Library under Project System ->Structures -> Project System Interfaces -> PS-EPS Interface to External Project Management Systems.
|
|
|
|
11-Dec-2005
|
|
|
|
|
GetData
You can use the BAPI BAPI_BUS2054_GETDATA to get detailed information about WBS elements. To get all WBS elements in a project, you must transfer the external IDof the project definition in the parameter I_PROJECT_DEFINITION.Alternatively, you can specify the required WBS elements individually
in the table IT_WBS_ELEMENT. If both are filled, only the WBS elementsthat are specified in table IT_WBS_ELEMENT and that also belong to the project are returned. If you want to restrict the output (for example, because you do notknow how big the network is and, for performance reasons, you want to
prevent the system from returning more than 1000 WBS elements), you canuse the parameter I_MAX_ROWS to restrict the maximum number of WBSelements returned. If you do not fill this parameter, all possible WBS elements are returned. If required, you can also specify in which language 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. NotesFields that are directly assigned to the WBS elements are returned in the table ET_WBS_ELEMENT. 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
|
|
|
|
|
GetGuidFromKey
Read the GUID (Global Unique Identifier) using the external object key. ExampleA list of WBS elements for which GUIDs are to be read is transferred tothe multiline parameter IT_EXT_KEY. The BAPI returns these 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, that is, no GUIDs from deleted WBS elements, arereturned. In addition, only GUIDs that have already been saved to the databse are read.
|
|
|
|
11-Dec-2005
|
|
|
|
|
Getinfo
You use this method to read detailed information about projectdefinitions and the WBS elements of certain projects from the system. NotesEnter the project definitions and/or the WBS elements, which you wantdetailed information about, in the parameter PROJECT_DEFINITION or I_WBS_ELEMENT_TABLE respectively.
If you only enter project definitions, the details of all the WBS thatbelong to the project definitions are read including the hierarchy. If you explicitly enter WBS elements, only these are read. Messages are returned in Return parameters. For information about the
return values and their meaning, see the parameter documentation.
|
|
|
|
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. These are returned bythe BAPI with the corresponding GUIDs in the multiline parameter ET_EXT_KEY.
NotesMessages, for example, about non-existent objects, are returned in the multiline parameter ET_RETURN. Only active GUIDs that have already been saved to the database aretaken into account. That is, for example, no GUIDs from deleted WBS elements.
|
|
|
|
11-Dec-2005
|
|
|
|
|
GetStatus
You can use the BAPI BAPI_BUS2054_GET_STATUS to read the active system statuses and user statuses for a list of PSP elements(BAPI_WBS_ELEMENTS). The active system statuses in this case are output with the English-language key. The active user statuses are output with the key of the log-on language
if the translation of the status exists in the status profile in thelog-on language, or if the maintenance language of the status profile corresponds to the log-on language. If the status does not exist in the log-on language in the statusprofile, the key will be output in the maintenance language of the status profile.
NotesThe return parameter RETURN will contain an error message if an error occurred during processing. After the call, the tableBAPI_STATUS_RESULT contains all messages that were created during processing. Further Information
You 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
|
|
|
|
|
Maintain
With the Maintain BAPI of the WorkBreakdownStruct business object youcan edit the objects of a project definition. You can also use all thefunctions of the Maintain BAPI of the Network business object. For more information, see Network.Maintain. With WorkBreakdownStruct.Maintain it is possible to edit the project
definition, its WBS elements and their hierarchical relationships. TheBAPI encapsulates a complete transaction in itself. As a result,several operations on project elements can be processed by only one call. The R/3 Project System determines in which order the operations are to
be executed on the objects. The caller can choose the operations in any order. As a result, processing is very speedy and effective. However, thistransaction concept does not include the use and combination of other SAP BAPIs in the same LUW. Procedure
The WorkBreakdownStruct business object is a facade of the project definition for WBS elements and their hierarchy. To edit a project object, enter a command for an object type. Inaddition, enter the object key and a reference to its attributes.
In the table of the IMethodProject parameter enter the object type, thecommand and the object key. As a reference enter the index of theobject data table of the relevant object type. In the object data tableenter the information about the object. If necessary, use an update structure for 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 Return indicates whether errors occurred duringprocessing. After the call you find the error messages created during processing in the EmessageTable table. Commands of the Object Types
For the description of the object types Network, NetworkActivity,NetworkActivityElement, ActivityMilestone, and NetworkRelation, see Network.Maintain. Object type: Project definitionThe Maintain BAPI must always refer to one project definition.
Therefore, always enter the structure of a project definition in theIProjectDefinition parameter. Use the project definition as a key. Thereference to the data part is always 1. Always enter the project definition in uppercase. Command: Create Enter the project definition and the project
profile. The project profile must exist in the R/3 Project System.
Example - Create a Project Definition in the R/3 Project System IMethodProjectOBJECTTYPE = ProjectDefinition
METHOD = Create OBJECTKEY = PD-TRAINING REFNUMBER = 000001 OBJECTTYPE = METHOD = Save OBJECTKEY =
REFNUMBER = IProjectDefinitionPROJECT_DEFINITION = PD-TRAINING DESCRIPTION = Training project PROJECT_PROFILE = PPRO001
Command: Update Use this command to change a project definition that already exists inthe R/3 Project System. If you enter an update structure you can changeindividual fields without having to specify the other fields.
Example - Changing the description of a project definition (Only the description is changed.) IMethodProjectOBJECTTYPE = ProjectDefinition METHOD = Update OBJECTKEY = PD-TRAINING
REFNUMBER = 000001 OBJECTTYPE = METHOD = Save OBJECTKEY = REFNUMBER = IProjectDefinition
PROJECT_DEFINITION = PD-TRAINING DESCRIPTION = Training project IProjectDefinitionUp PROJECT_DEFINITION = DESCRIPTION = X
Command: Lock (from R/3 Release 4.6A) Use this command to lock a project definition. The "Master data locked" system status is set for the project definition. LS> Example - Locking the project definition PD-TRAINING
IMethodProjectOBJECTTYPE = ProjectDefinition METHOD = Lock OBJECTKEY = PD-TRAINING REFNUMBER = 000001 OBJECTTYPE =
METHOD = Save OBJECTKEY = REFNUMBER = IProjectDefinition PROJECT_DEFINITION = PD-TRAINING Command: Unlock (from R/3 Release 4.6A)
Use this command to unlock the project definition. The "Master data locked" system status is removed from the project definition.
Example - Unlocking the project defintion PD-TRAINING< IMethodProjectOBJECTTYPE = ProjectDefinition
METHOD = Unlock OBJECTKEY = PD-TRAINING REFNUMBER = 000001 OBJECTTYPE = METHOD = Save OBJECTKEY =
REFNUMBER = IProjectDefinitionPROJECT_DEFINITION = PD-TRAINING Command: Release (from R/3 Release 4.5A) Releasing a project. The system status "released" is set for the
project definition and all WBS elements.
Example - Releasing the project definition PD-TRAINING IMethodProjectOBJECTTYPE = ProjectDefinition METHOD = Release
OBJECTKEY = PD-TRAINING REFNUMBER = OBJECTTYPE = METHOD = Save OBJECTKEY = REFNUMBER =
IProjectDefinitionPROJECT_DEFINITION = PD-TRAINING Object type: WBS elementYou can edit all WBS elements of a project definition. The name and key of the WBS element are identical. Enter the WBS element in uppercase.
Command: Create
Example - Creating a WBS element for the project definition. Creating three WBS elements TRAINING, TRAINING.1 and TRAINING.2 forproject definition PD-TRAINING IMethodProjectOBJECTTYPE = WBS-Element
METHOD = Create OBJECTKEY = TRAINING REFNUMBER = 000001 OBJECTTYPE = WBS-Element METHOD = Create
OBJECTKEY = TRAINING.1 REFNUMBER = 000002 OBJECTTYPE = WBS element METHOD = Create OBJECTKEY = TRAINING.2
REFNUMBER = 000003 OBJECTTYPE = METHOD = Save OBJECTKEY = REFNUMBER = IProjectDefinition
PROJECT_DEFINITION = PD-TRAINING IWbsElementTable Index = 1 WBS_ELEMENT = TRAINING PROJECT_DEFINITION = PD-TRAINING
DESCRIPTION = Whole project Index = 2 WBS_ELEMENT = TRAINING.1 PROJECT_DEFINITION = PD-TRAINING DESCRIPTION = Preparation
Index = 3 WBS_ELEMENT = TRAINING.2 PROJECT_DEFINITION = PD-TRAINING DESCRIPTION = Execution Kommando: Update
Use this command to change a WBS element that already exists in the R/3Project System. If you enter an update structure, you can change individual fields without having to specify the other fields.
Example - Changing the description of the WBS element TRAINING.1 for the project definition PD TRAINING
IMethodProjectOBJECTTYPE = WBS element METHOD = Update OBJECTKEY = TRAINING.1 REFNUMBER = 000001 OBJECTTYPE =
METHOD = Save OBJECTKEY = REFNUMBER = IProjectDefinitionPROJECT_DEFINITION = PD-TRAINING IWbsElementTableIndex = 1
WBS_ELEMENT = TRAINING.1 PROJECT_DEFINITION = PD-TRAINING DESCRIPTION = Preparation and documentation IWbsElementTableUpdateIndex = 1
WBS_ELEMENT = PROJECT_DEFINITION = DESCRIPTION = X Command: Delete Use this command to delete a WBS element that already exists in the R/3
Project System. The WBS element receives the Deletion flag system status and is nor deleted physically. You cannot create a new WBSelement with the same key.
Example - Deleting the WBS element TRAINING.2 for the project PD TRAINING
IMethodProjectOBJECTTYPE = WBS element METHOD = Delete OBJECTKEY = TRAINING.2 REFNUMBER = 000001 OBJECTTYPE =
METHOD = Save OBJECTKEY = REFNUMBER = IProjectDefinitionPROJECT_DEFINITION = PD-TRAINING IWbsElementTable
Index = 1 WBS_ELEMENT = TRAINING.2 PROJECT_DEFINITION = PD-TRAINING Command: Lock (from R/3 Release 4.6A)Use this command to lock a WBS element. The "Master data lock" system status is set for the WBS element.
Example - Locking the WBS element TRAINING.1 IMethodProjectOBJECTTYPE = WBS-Element METHOD = Lock OBJECTKEY = TRAINING.1
REFNUMBER = 000001 OBJECTTYPE = METHOD = Save OBJECTKEY = REFNUMBER = IProjectDefinition
PROJECT_DEFINITION = PD-TRAINING IWbsElementTableIndex = 1 WBS_ELEMENT = TRAINING.1 Command: Unlock (from R/3 Release 4.6A) Use this command to unlock a WBS element. The "Master data lock" system status is removed from a WBS element.
Example - Unlocking the WBS element TRAINING.1 IMethodProjectIMethodProjectOBJECTTYPE = WBS-Element METHOD = Unlock OBJECTKEY = TRAINING.1
REFNUMBER = 000001 OBJECTTYPE = METHOD = Save OBJECTKEY = REFNUMBER = IProjectDefinitionPROJECT_DEFINITION = PD-TRAINING
IWbsElementTable Index = 1 WBS_ELEMENT = TRAINING.1 Command: Release (ab R/3 Release 4.5A) Releasing a WBS element. The system status "released" is set for the WBS element and all lower-level WBS elements.
Example - Releasing the WBS element TRAINING.1 IMethodProjectOBJECTTYPE = WBS-Element METHOD = Release OBJECTKEY = TRAINING.1
REFNUMBER = 000001 OBJECTTYPE = METHOD = Save OBJECTKEY = REFNUMBER = IProjectDefinition
PROJECT_DEFINITION = PD-TRAINING IWbsElementTableIndex = 1 WBS_ELEMENT = TRAINING.1 Object type: WBS milestone (from R/3 Release 4.6A)
The key for the object WBS milestone is the milestone number. Command: Create Use this command to create a new WBS milestone for a network. It is notnecessary to enter a number for the milestone. The system gives themilestone a number when it is created. The system returns the milestone in the message table as an information message.
If however, an external number is entered in the method table, both theexternal and the new milestone number are returned in an information amessage in the message table. A WBS element always has to be entered.
Example - Creating a new WBS milestone for a WBS element TRAINING.2
IMethodProjectOBJECTTYPE = WBS milestone METHOD = Create OBJECTKEY = REFNUMBER = 000001 OBJECTTYPE =
METHOD = Save OBJECTKEY = REFNUMBER = IWbsMilestoneTableIndex = 1 MILESTONE_NUMBER =
WBS_ELEMENT = TRAINING.2 Command: Update Use this command to change a WBS element that already exists in the Project System. It is always necessary to enter the projectdefinition, if you do not explicitly change the project definition. Use the update structure as for WBS elements.
Example - Changing an existing WBS milestone with the number 000000002098 assigned to WBS element TRAINING.2. IMethodProjectOBJECTTYPE = WBS milestone METHOD = Update
OBJECTKEY = 000000002098 REFNUMBER = 000001 OBJECTTYPE = METHOD = Save OBJECTKEY = REFNUMBER =
IWbsMilestoneTableIndex = 1 MILESTONE_NUMBER = 000000002098 DESCRIPTION = Milestone description changed WBS_ELEMENT = TRAINING.2
IWbsMilestoneTableUpMILESTONE_NUMBER = DESCRIPTION = X WBS_ELEMENT = Kommando: Delete Use this command to delete a WBS milestone that already exists in the
R/3 Project System. The milestone is deleted physically. It is alwaysnecessary to enter the project definition, if you do not explicitly change the project definition.
Example - Deleting a WBS element with the number 000000002098 assigned to WBS element TRAINING.2.
IMethodProjectOBJECTTYPE = WBS milestone METHOD = Delete OBJECTKEY = 000000002098 REFNUMBER = 000001 OBJECTTYPE =
METHOD = Save OBJECTKEY = REFNUMBER = IWbsMilestoneTableMILESTONE_NUMBER = 000000002098 WBS_ELEMENT = TRAINING.2
Object type: WBS hierarchyThe WBS hierarchy object type defines the hierarchy of the WBSelements. A project definition always has exactly one hierarchy. If theposition of a WBS element changes, the whole hierarchy has to berebuilt. Therefore, the WBS hierarchy object type has only one command:
Create. Every WBS element receives exactly one entry in the table parameter IWbsHierarchieTable with which it defines its position. Command: Create Use this command to create or change a WBS element hierarchy for aproject definition. Enter the WBS hierarchy object type and the Create
command in the table of the IMethodProject parameter. The commandrefers to all entries in the table of the IWbsHierarchieTable parameterthat contains the data for the data for the hierarchy. Each entry inthe IWbsHierarchieTable refers to a WBS element that describes its position relative to the other WBS elements.
Example - Positioning WBS elements TRAINING , TRAINING.1 and TRAINING.2 . (WBS elements TRAINING.1 and TRAINING.2 are subordinate toWBS element TRAINING. WBS element TRAINING1 is positioned on the left of TRAINING.2.) IMethodProject
OBJECTTYPE = WBS-Hierarchy METHOD = Create OBJECTKEY = REFNUMBER = OBJECTTYPE = METHOD = Save
OBJECTKEY = REFNUMBER = I ProjectDefinitionPROJECT_DEFINITION = PD-TRAINING IWbsHierarchieTableWBS_ELEMENT = TRAINING
PROJECT_DEFINITION = PD-TRAINING UP = DOWN = TRAINING.1 LEFT = RIGHT = WBS_ELEMENT = TRAINING.1
PROJECT_DEFINITION = PD-TRAINING UP = TRAINING DOWN = LEFT = RIGHT = TRAINING.2 WBS_ELEMENT = TRAINING.2
PROJECT_DEFINITION = PD-TRAINING UP = TRAINING DOWN = LEFT = TRAINING.1 RIGHT = Notes
Further InformationFor more information, see the R/3 Library under PS Project System -> Structures -> EPS Interface
|
|
|
|
11-Dec-2005
|
|
|
|
|
SaveReplica
NotesThe function module BAPI_PROJECT_SAVEREPLICA is only used internallyas part of the ALE business processes for work breakdown structures, delivered by SAP. If you want to create or change a work breakdown structure, you shouldtherefore use the function module BAPI_PROJECT_MAINTAIN, in which a
complete check of the work breakdown structure is carried out before saving. The method BAPI_PROJECT_SAVEREPLICA replicates a work breakdownstructure (project definition and WBS elements) as part of an ALE business process in an external R/3 system (receiving system).
Furhermore the relevant status of the project definition and the WBS elements is set in the receiving system. The statuses "Availability control active" and "Budget tolerances exceeded" are always set to inactive in the receiving system,irrespective of the status of the work breakdown structure in the master system, because a work breakdown structure can only have a
budget in its master system. Consequently an availability control is not possible in the receiving system. It is checked to see if the organizational units that have been enteredin the work breakdown structure are valid on the current date. Other checks are not carried out in the receiving system. In particular no authorizations checks or status checks are made.
An existing work breakdown structure is only overwritten in thereceiving system, if its master system corresponds to the logical system in the MASTERDATA-LOGSYSTEM field. If the status "Deletion flag, can be archived" is contained in theOBJECTSTATUS import table and has been set to active, the corresponding
work breakdown structure is deleted in the receiving system, together with all its dependent tables. Further InformationFor more information, refer to the documentation for ALE business processes for work breakdown structures.
|
|
|
|
11-Dec-2005
|
|
|
|
|
SetStatus
You can use BAPI_BUS2054_SET_STATUS in a list of WBS elements to revokea system status and a user status respectively, as well as to set a system status and a user status respectively. The following system statuses are supported: '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'MDLK' Master data locked (I0065) set/revoke'DLFL' Deletion flag (I0076) set/revoke
User statuses can be set or revoked in accordance with the statusprofile assigned to the WBS element structure. This must be assigned using the key in the respective log-on language. The sequence should be worked through as follows: - Revoke system status
- Revoke user status
- Set system status
- Set user status
If a system/user status cannot be set/revoked, all the other actions are still performed. The inheritance of statuses does not occur integrated between projectand network. A status change only affects the current project, but not any networks that were potentially assigned to that project.
You can call up the BAPI as often as you like until a Logical Unit ofWork (LUW) is closed with the BAPI BAPI_PS_PRECOMMIT and BAPI COMMIT WORK. Only one project or WBS element from a project can be processed in a LUW. 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). In the RETURN return parameter there is an error message if an erroroccurred during processing. After the call up, the notifications which
were generated during processing are in the table BAPI_STATUS_RESULT. Further InformationFor more information, see the SAP library under Project System ->Structures -> Interfaces to the Project System -> PS-EPS Interface toExternal Project Management Software.
|
|
|
|
11-Dec-2005
|
|
|
|
|