Sapass

 Simplify SAP R/3 development with Excel VBA/VB RFC  
Home> Bapi>ProjectDefinitionPI



Index

ProjectDefinitionPI

ProjectDefinitionPI


The business object project definition provides the framework
for a business plan with a defined aim, which is to be achieved using
specified resources. The project definition contains dates and the binding organizational data for the project.


Integration

The business plan is structured in the work breakdown structure
according to its structure, and in the network according to its process flow.


11-Dec-2005


Methods

Available Methods


  • Change : Change Project Definition by BAPI [ BAPI_BUS2001_CHANGE ]
  • CreateFromData : BAPI: Create project definition [ BAPI_PROJECTDEF_CREATE ]
  • CreateSingle : Create Project Definition by BAPI [ BAPI_BUS2001_CREATE ]
  • Delete : Delete Project Definition by BAPI [ BAPI_BUS2001_DELETE ]
  • ExistenceCheck : Check existence of object [ BAPI_PROJECTDEF_EXISTENCECHECK ]
  • GetData : Detail Data for Project Definition [ BAPI_BUS2001_GETDATA ]
  • Getdetail : Read details about project definition [ BAPI_PROJECTDEF_GETDETAIL ]
  • GetGuidFromKey : GetGuidFromKey [ BAPI_BUS2001_GET_GUID_FROM_KEY ]
  • GetKeyFromGuid : GetKeyFromGuid [ BAPI_BUS2001_GET_KEY_FROM_GUID ]
  • Getlist : Produces a list of project definitions for the selection criteria [ BAPI_PROJECTDEF_GETLIST ]
  • GetStatus : Read Status for BUS2001 (Project Definition) [ BAPI_BUS2001_GET_STATUS ]
  • PartnerChangeMultiple : Change Partner Data for Project Definition by BAPI [ BAPI_BUS2001_PARTNER_CHANGE_M ]
  • PartnerCreateMultiple : Create Partner Data for Project Definition by BAPI [ BAPI_BUS2001_PARTNER_CREATE_M ]
  • PartnerGetdetail : Get Detail Data for Partner Data [ BAPI_BUS2001_PARTNER_GETDETAIL ]
  • PartnerGetlist : Get Overview List for Partner Data [ BAPI_BUS2001_PARTNER_GETLIST ]
  • PartnerRemoveMultiple : Delete Partner Data for Project Definition by BAPI [ BAPI_BUS2001_PARTNER_REMOVE_M ]
  • SetStatus : Set/Revoke Status for BUS2001 (Project Definition) [ BAPI_BUS2001_SET_STATUS ]
  • Update : Change Project Definition [ BAPI_PROJECTDEF_UPDATE ]

11-Dec-2005


Change

Change


A project definition can be changed using the BAPI "BAPI_BUS2001_CHANGE". To do this, the project definition(PROJECT_DEFINITION) and the new values must be entered in the structure "I_PROJECT_DEFINITION". In the structure"I_PROJECT_DEFINITION_UPD", the fields that are to be changed must be marked with 'x'. The other fields remain unchanged.


Before the project definition is changed, the following is checked:

  • Is another project already being processed in the LUW (Logical Unit of Work)?
  • Can the project be locked?
  • Is the changed data still consistent (do the company code and controlling area match?)

  • If all checks are successful, the project definition is changed in the document tables.

    Project stock

    The fields PROJECT_STOCK and VALUATION_SPEC_STOCK together define the project stock:

    Characteristic value PROJECT_STOCK VALUATION_SPEC_STOCK
    ----------------------------------------------------------------

    No project stock SPACE SPACE
    Project stock not evaluated 'X' SPACE
    Project stock evaluated 'X' 'M'

    Note:

  • PROJECT_STOCK can have the values SPACE and 'X' only. Other values cause an error to occur.

  • VALUATION_SPEC_STOCK can have the values SPACE and 'M' only. Other values cause an error to occur.
  • Value combinations other than those listed above cause an error to occur.
  • In create mode you can set any of the characteristic values listed above.

  • In change mode you can switch only between the 'no project stock' and'project stock not evaluated' characteristic values. It is not possibleto set or reset the characteristic value 'project stock evaluated' afterwards.

  • The project definition is changed as soon as a LUW (Logical Unit of
    Work) is completed with the BAPI "BAPI_PS_PRECOMMIT" and "COMMIT WORK".

    Only one project or one WBS element from a project can be processed at a time in one LUW.

    The return parameter "RETURN", displays first an error or successmessage that states whether the project definition could be changed.
    The first message variable is the object category, the second is theobject ID and the GUID (if it was possible to read it) is in the fourthmessage variable. All messages that were generated during theprocessing are listed underneath, and the parameters of the individual messages are filled with the object ID.


    Notes

    1. 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.


    1. 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).


    1. 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 assigned
  • You want to change various networks to which WBS elements from different projects are assigned
  • You 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.

    1. 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).


    1. 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.
    1. 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.

    1. 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.

    1. 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.

    1. 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.

    1. 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 Enhancements

    Before 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 structure
  • VALUEPART1: Key of the object + start of the data part
  • VALUEPART2-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 Processing

    Using 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 Information

    For 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


    CreateFromData

    CreateFromData


    You can use this method to create a project definition that contains data binding for the whole project.

    In the process, all the consistency checks are made that are made if you create a project definition using the R/3 transaction.

    Notes


    You need the relevant authority to create a project definition.

    When you create a project definition, you must use a project profile that has been previously created in Customizing.

    PROJECT_DEFINITION_STRU is an obligatory import parameter.


    Messsages are returned in the Return parameter. For information aboutreturn values and their meaning, see the documentation for the Return parameter.

    Further Information

    For more information,see the R/3 Library under PS Project System -> Work breakdown structure


    11-Dec-2005


    CreateSingle

    CreateSingle


    You can create a project definition using the BAPI "BAPI_BUS2001_CREATE". The fields for the project definition must beentered in the structure "I_PROJECT_DEFINITION". You must specify atleast the project definition (PROJECT_DEFINITION) and the project profile (PROJECT_PROFILE).


    Before the project definition is created, the following is checked:

  • Is another project already being processed in the LUW (Logical Unit of Work)?
  • Does another project with the same project definition already exist?
  • Is the transferred data consistent (do the company code and the controlling area match)?

  • If all checks are successful, then the project definition is created in the document tables.

    Project stock

    The fields PROJECT_STOCK and VALUATION_SPEC_STOCK together define the project stock:

    Characteristic value PROJECT_STOCK VALUATION_SPEC_STOCK
    ----------------------------------------------------------------

    No project stock SPACE SPACE
    Project stock not evaluated 'X' SPACE
    Project stock evaluated 'X' 'M'

    Note:

  • PROJECT_STOCK can have the values SPACE and 'X' only. Other values cause an error to occur.

  • VALUATION_SPEC_STOCK can have the values SPACE and 'M' only. Other values cause an error to occur.
  • Value combinations other than those listed above cause an error to occur.
  • In create mode you can set any of the characteristic values listed above.

  • In change mode you can switch only between the 'no project stock' and'project stock not evaluated' characteristic values. It is not possibleto set or reset the characteristic value 'project stock evaluated' afterwards.

  • The project definition is created as soon as a LUW (Logical Unit of
    Work) is completed with the BAPI "BAPI_PS_PRECOMMIT" and "COMMIT WORK".

    Only one project or one WBS element from a project can be processed at a time in one LUW.

    The return parameter "RETURN", displays first an error or successmessage that states whether the project definition could be created.
    The first message variable is the object category, the second is theobject ID and the GUID (if it was created) is in the fourth messagevariable. All messages that were generated during the processing arelisted underneath, and the parameters of the individual messages are filled with the object ID.


    Notes

    1. 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.


    1. 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).


    1. 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 assigned
  • You want to change various networks to which WBS elements from different projects are assigned
  • You 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.

    1. 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).


    1. 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.
    1. 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.

    1. 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.

    1. 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.

    1. 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.

    1. 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 Enhancements

    Before 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 structure
  • VALUEPART1: Key of the object + start of the data part
  • VALUEPART2-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 Processing

    Using 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 Information

    For 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


    Delete

    Delete


    You can delete a project definition using the BAPI "BAPI_BUS2001_DELETE". You must enter the name of the projectdefinition that is to be deleted in "I_PROJECT_DEFINITION".

    Before the project definition is deleted, the following is checked:

  • Is another project being processed in the LUW (Logical Unit of Work)?

  • Can the project be locked?
  • Are there any other objects apart from WBS elements belonging to the project?
  • If all checks are successful, the project definition is deleted in the document tables.

    If the project has WBS elements, these are also deleted. If the project
    has other objects such as networks, activities and so on, the BAPIterminates and an error message is displayed. These must be deleted beforehand. The BAPI does not delete these automatically.

    The project definition is deleted as soon as a LUW (Logical Unit of
    Work) has been completed with the BAPI BAPI_PS_PRECOMMIT and COMMIT WORK.

    Only one project or one WBS element from a project can be processed at a time in one LUW.

    You cannot delete temporary objects. This means that if you create aproject in an LUW, you cannot delete it immediately after creating it.
    You can delete it using this BAPI only after you physically create theproject using the BAPIs "BAPI_PS_PRECOMMIT" and "COMMIT WORK".

    The return parameter "RETURN" displays first an error or successmessage for all objects (project definition and if relevant, associated
    WBS elements) that states whether the project definition or theindividual WBS elements could be deleted. The first message variable isthe object category, the second is the object ID and the GUID (if itwas possible to read it) is in the fourth message variable. All messages that were generated during the processing are listed
    underneath, and the parameters of the individual messages are filled with the object ID.

    Notes

    1. 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.

    1. 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).


    1. 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 assigned
  • You want to change various networks to which WBS elements from different projects are assigned
  • You 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.

    1. 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).


    1. 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.
    1. 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.

    1. 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.

    1. 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.

    1. 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.

    1. 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 Enhancements

    Before 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 structure
  • VALUEPART1: Key of the object + start of the data part
  • VALUEPART2-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 Processing

    Using 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 Information

    For 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


    ExistenceCheck

    ExistenceCheck


    You can use this method to check whether a project definition exists.

    Notes

    The internal and external keys for the project definition CURRENTEXTERNALPROJE and CURRENTINTERNALPROJE are obligatory importparameters; one of the two keys can remain initial.


    11-Dec-2005


    GetData

    GetData


    You can use the BAPI BAPI_BUS2001_GETDATA to get detailed information about a project definition.

    To do this, you must transfer the external ID of the project definition in the parameter I_PROJECT_DEFINITION.

    If required, you can also specify in which language the language-dependent fields are to be returned, such as time units,
    system status, and so on. If you do not specify a language, the system language is used.

    Notes

    Fields that are directly assigned to the project definition are returned with the structure E_PROJECT_DEFINITION.

    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 Information

    For 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

    Getdetail


    No document is available


    11-Dec-2005


    GetGuidFromKey

    GetGuidFromKey


    Read the GUID (Global Unique Identifier) using the external object key.

    Example

    A list of project definitions for which the GUIDs are to be read istransferred to the multiline parameter IT_EXT_KEY. These are returnedwith the external keys in the mulitline BAPI parameter ET_GUID.


    Notes

    Messages, for example, about non-existent GUIDs, are returned in parameter ET_RETURN.

    Active GUIDs only are read, that is, no GUIDs are returned from deletedproject definitions. In addition, the system only reads those GUIDs that have already been saved to the database.



    11-Dec-2005


    GetKeyFromGuid

    GetKeyFromGuid


    Read the external object key using the GUID (Global Unique Identifier).

    Example

    A list of GUIDs for which external keys are to be read is transferredto the mulitline parameter IT_GUID. These are returned with the relevant GUIDs in the multiline parameter ET_EXT_KEY of the BAPI.

    Notes

    Messages, for example, about non-existent objects, are reported in the multiline parameter ET_RETURN.

    Only active GUIDs that have already been saved to the database, that isno GUIDs from deleted project definitions, for example, are taken into account.



    11-Dec-2005


    Getlist

    Getlist


    Provides a list of project definitions for the following selection caharactersitics

  • Project definition
  • Description of the project definition
  • Maximum number of project definitions found

  • 11-Dec-2005


    GetStatus

    GetStatus


    .

    With the BAPI BAPI_BUS2001_GET_STATUS both the active system statusesand the user statuses for a project definition (PROJECT_DEFINITION) can be read.

    Active system statuses are also displayed using the English-language key.

    If a translation of the status into the logon language exists in the
    source status profile, or the maintenance language of the statusprofile is the same as the logon language, then active user statusesare displayed in the current logon language by means of the key.

    If the status in the status profile does not exist in the logon
    language, the key is displayed in the maintenance language of the status profile.

    Notes

    An error message appears in the RETURN return parameter if an error occurred during processing.

    Further Information

    For more information see the SAP Library under Project System ->
    Structures -> Project System Interfaces -> PS-EPS Interface for External Project Management Systems.


    11-Dec-2005


    PartnerChangeMultiple

    PartnerChangeMultiple


    The BAPI "BAPI_BUS2001_PARTNER_CHANGE_M" changes the partners for theproject definiton (I_PROJECT_DEFINITON) from the partners in the parameter IT_PARTNER_OLD into the partners in the parameterIT_PARTNER_NEW.

    Messages, for example, about non-existant partners, are returned in
    parameter ET_RETURN. The first entry of the ET_RETURN table is asuccess or error message about whether the project definition could be changed.

    If the entries in IT_PARTNER_NEW and IT_PARTNER_OLD match, you receivea success message. If no other changes were made to the project
    definition, however, the BAPI "BAPI_PRECOMMIT" issues an error message that no data was changed and therefore it is not saved.

    Notes

    1. 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.

    1. 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).


    1. 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 assigned
  • You want to change various networks to which WBS elements from different projects are assigned
  • You 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.

    1. 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).


    1. 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.
    1. 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.

    1. 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.

    1. 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.

    1. 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.

    1. 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 Enhancements

    Before 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 structure
  • VALUEPART1: Key of the object + start of the data part
  • VALUEPART2-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 Processing

    Using 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 Information

    For more information, refer to the SAP Library under Project System -> Structures -> EPS Interface.


    11-Dec-2005


    PartnerCreateMultiple

    PartnerCreateMultiple


    The BAPI "BAPI_BUS2001_PARTNER_CREATE" adds a list of partners (I_PARTNER_TABLE) to a project definition (I_PROJECT_DEFINITON).

    Messages, for example, about incorrect transfer values (for example,the personnel number transferred does not exist) are returned in parameter ET_RETURN. The first entry in the ET_RETURN table is a
    success or error message about whether the project definition could be changed.

    Notes

    1. 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.

    1. 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).


    1. 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 assigned
  • You want to change various networks to which WBS elements from different projects are assigned
  • You 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.

    1. 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).


    1. 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.
    1. 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.

    1. 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.

    1. 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.

    1. 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.

    1. 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 Enhancements

    Before 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 structure
  • VALUEPART1: Key of the object + start of the data part
  • VALUEPART2-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 Processing

    Using 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 Information

    For more information refer to the SAP Library under Project System ->Structures -> Project System Interface -> PS-EPS Interface to External Project Management Systems.


    11-Dec-2005


    PartnerGetdetail

    PartnerGetdetail


    The BAPI "BAPI_BUS2001_PARTNER_GETDETAIL" selects all partners for theproject definition (I_PROJECT_DEFINITION), including the address dataof the partners (name, location, telephone number, fax number, and the short description for search helps).


    Notes

    Only partners who have not been deleted and have already been saved to the database are selected.

    Further Information

    For more information, refer to the SAP Library under Project System -> Structures -> EPS Interface.


    11-Dec-2005


    PartnerGetlist

    PartnerGetlist


    The BAPI "BAPI_BUS2001_PARTNER_GETDETAIL" selects all partners for the project definition (I_PROJECT_DEFINITION).

    Notes

    Only partners that have not been deleted and have already been saved in the database are selected.

    Further Information


    For more information, refer to the SAP Library under Project System -> Structures -> EPS Interfaces.


    11-Dec-2005


    PartnerRemoveMultiple

    PartnerRemoveMultiple


    The BAPI "BAPI_BUS2001_PARTNER_REMOVE_M" deletes the partners from theI_PARTNER_TABLE table of the project definition (I_PROJECT_DEFINITON).

    Messages, about non-existent partners for example, are returned in theET_RETURN parameter. The first entry in the ET_RETURN table is a
    success or error message about whether the project definition could be changed.

    Notes

    1. 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.

    1. 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).


    1. 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 assigned
  • You want to change various networks to which WBS elements from different projects are assigned
  • You 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.

    1. 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).


    1. 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.
    1. 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.

    1. 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.

    1. 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.

    1. 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.

    1. 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 Enhancements

    Before 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 structure
  • VALUEPART1: Key of the object + start of the data part
  • VALUEPART2-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 Processing

    Using 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 Information

    For more information, refer to the SAP Library under Project System -> Structures -> Structures -> EPS Interface.


    11-Dec-2005


    SetStatus

    SetStatus


    With the BAPI BAPI_BUS2001_SET_STATUS, one system status (UNDO_SYSTEM_STATUS) and one user status (UNDO_USER_STATUS) can berevoked each time, and one system status (SET_SYSTEM_STATUS) and oneuser status (UNDO_USER_STATUS) can be set each time for a project definition (PROJECT_DEFINITION).


    The following system statuses are supported:

  • 'REL' Released (I0002) set
  • 'TECO' Technically completed (I0045) set/revoke
  • 'CLSD' Closed (I0046) set/revoke

  • 'MDLK' Master data locked (I0065) set/revoke
  • 'DLFL' Deletion flag (I0076) set/revoke
  • User statuses can be set or revoked corresponding to the status profileassigned to the project. These must be transferred into the current logon language via the key.


    The processing sequence is as follows:

    1. Revoke system status
    2. Revoke user status
    3. Set system status
    4. Set user status

    Even if the system/user status cannot be set/revoked, all other actions are carried out.


    The inheritance of the status does not take place integrated betweenproject and network. A change in status only has an effect on the WBS elements and not on a network that may be assigned.

    The BAPI can be called repeatedly until an LUW (Logical Unit of Work) is closed with BAPI_PS_PRECOMMIT and BAPI COMMIT WORK.


    Only one project or WBS element can be processed from a project.

    Notes

    1. 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.

    1. 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).


    1. 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 assigned
  • You want to change various networks to which WBS elements from different projects are assigned
  • You 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.

    1. 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).


    1. 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.
    1. 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.

    1. 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.

    1. 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.

    1. 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.

    1. 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 Enhancements

    Before 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 structure
  • VALUEPART1: Key of the object + start of the data part
  • VALUEPART2-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 Processing

    Using 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).

    An error message appears in the RETURN return parameter if an erroroccurs during processing. The messages that were generated during the
    process appear in the E_MESSAGE_TABLE table after being called.

    Further Information

    For more information, see the SAP Library under Project System ->Structures -> Project System Interfaces -> PS-EPS Interface for External Project Management Systems.


    11-Dec-2005


    Update

    Update


    You use this method to change a project definition and all the data that is binding for the whole project.

    The same consistency checks take place, that would do so if the changes were being made in the R/3 transaction.

    Notes

    To change a project you require the necessary authorization.


    The internal and external keys for the project definition CURRENTEXTERNALPROJE and CURRENTINTERNALPROJE are obligatory importparameters (one of the two keys can remain initial) as well as PROJECT_DEFINITION_STRU and PROJECT_DEFINITION_UP.

    Messages are returned in the return parameter. You can find information
    about the return value and their meaning in the parameter documentation.

    Further Information

    For more information, see the R/3 Library for PS - Project System - Work breakdown structure.


    11-Dec-2005