SAP ABAP IMG Activity CPRO_BAPI_BUS2170 (BAdI: BOR Object Project Template)
Hierarchy
CPRXRPM (Software Component) SAP Portfolio and Project Management 6.0
   PPM-PRO (Application Component) Project Management
     DEVELOPMENT_PROJECTS_CUSTOMIZE (Package) General Customizing for Project Management
IMG Activity
ID CPRO_BAPI_BUS2170 BAdI: BOR Object Project Template  
Transaction Code S_CP4_60000018   (empty) 
Created on 20040205    
Customizing Attributes CPRO_BAPI_BUS2170   BAdI: BOR Object Project Template 
Customizing Activity CPRO_BAPI_BUS2170   BAdI: BOR Object Project Template 
Document
Document Class SIMG   Hypertext: Object Class - Class to which a document belongs.
Document Name BAPIEXT_BUS2170    

Use

You use this BAdI if you also want to use customer-defined fields for the project template in the BAPIs.

The Create, Change, Copy, and Delete methods each contain the importing parameter IS_EXTENSION_IN and the exporting parameter ES_EXTENSION_OUT for your use. The GetDetail method contains the exporting parameter ES_EXTENSION_OUT.

BAPI 'Create'

If you fill the extension structure IS_EXTENSION_IN correctly and have implemented the CREATE_EXIT_IN method of the BAdI, you can carry out customer-specific checks before the current object is created.

If this method returns at least one message of the type 'E', 'A', or 'X' in the return table, the system stops processing the BAPI.

If you fill the extension structure IS_EXTENSION_IN correctly and the Extensions indicator is set in the update structure, you can use the CREATE_EXIT_MAP method of the BAdI to fill the customer-defined fields of the CI structure with the values of this extension structure.

Provided that the importing structure IS_EXTENSION_IN is filled correctly and you have implemented the CREATE_EXIT_OUT method of the BAdI, you can perform the following actions once the current object has been created:

  • Fill the exporting structure ES_EXTENSION_OUT
  • Perform customer-defined actions for customer-defined data

This method cannot undo the creation of the object. All messages from the return table are transferred to the log.

The IV_OBJECT_GUID parameter contains the GUID of the new object. This object does not exist in the database before the update. You can use the GUID to determine the reference to the relevant project element as follows and then use the instance methods of the referenced class. The object in the example is an operational task (CL_DPR_TASK_O), that is, the reference LR_TASK_O can use all public methods of the class CL_DPR_TASK_O.

...
data: lr_object_manager type ref to cl_dpr_appl_object_manager,
lr_common type ref to if_dpr_common,
lr_task_o type ref to cl_dpr_task_o.

* Get instance of object manager
lr_object_manager = cl_dpr_appl_object_manager=>get_instance( ).
try.
* Try to get object from application object mapper
lr_common =
lr_object_manager->mr_mapper->get_application_object_by_guid(
iv_object_guid ).
catch cx_dpr_object_mapping_error.
endtry.
check lr_common is bound.

* Get reference of current object
try.
lr_task_o ?= lr_common.
catch cx_sy_move_cast_error.
endtry.
check lr_task_o is bound.
...

BAPI 'Change'

If you fill the extension structure IS_EXTENSION_IN correctly and have implemented the CHANGE_EXIT_IN method of the BAdI, you can carry out customer-specific checks before the current object is changed.

If this method returns at least one message of the type 'E', 'A', or 'X' in the return table, the system stops processing the BAPI.

If you fill the extension structure IS_EXTENSION_IN correctly and the Extensionsindicator is set in the update structure, you can use the CHANGE_EXIT_MAP method of the BAdI to fill the customer-defined fields of the CI structure with the values of this extension structure.

Provided that the importing structure IS_EXTENSION_IN has been filled correctly and you have implemented the CHANGE_EXIT_OUT method of the BAdI, you can carry out the following actions after the current object has been changed:

  • Fill the exporting structure ES_EXTENSION_OUT
  • Carry out customer-defined actions for customer-defined data

This method cannot undo the changes made to the object. All messages from the return table are transferred to the log.

BAPI 'Delete'

If you fill the extension structure IS_EXTENSION_IN correctly and have implemented the DELETE_EXIT_IN method of the BAdI, you can carry out customer-specific tests before the current object is deleted.

If this method returns at least one message of the type 'E', 'A', or 'X' in the return table, the system stops processing the BAPI.

Provided that the importing structure IS_EXTENSION_IN is correctly filled and you have implemented the DELETE_EXIT_OUT method of the BAdI, you can carry out the following actions after the current object has been deleted:

  • Fill the exporting structure ES_EXTENSION_OUT
  • Carry out customer-defined actions for customer-defined data

This method cannot undo the deletion of the object. All messages from the return table are transferred to the log.

BAPI 'Copy'

If you fill the IS_EXTENSION_IN extension structure correctly and have implemented the COPY_EXIT_IN method of the BAdI, you can carry out customer-specific checks before the current object is created or copied using the template.

If this method returns at least one message of the type 'E', 'A', or 'X' in the return table, the system stops processing the BAPI.

Provided that the IS_EXTENSION_IN importing structure has been filled correctly and you have implemented the COPY_EXIT_OUT method of the BAdI, you can perform the following actions after the current object has been created with a template or copied:

  • Fill the ES_EXTENSION_OUT exporting structure
  • Perform customer-defined actions for customer-defined data

This method cannot undo the creation of the object with a template or copying the object. All messages in the return table are transferred to the log.

The IV_OBJECT_GUID parameter contains the GUID of the new object. This object does not exist in the database until after the update. You can use the GUID to determine the reference to the corresponding project element as follows, and then use the instance methods of the referenced class afterwards. In this example, the object is an operational task (CL_DPR_TASK_O), that is, the reference LR_TASK_O can use all public methods of the CL_DPR_TASK_O class.

...
data: lr_object_manager type ref to cl_dpr_appl_object_manager,
lr_common type ref to if_dpr_common,
lr_task_o type ref to cl_dpr_task_o.

* Get instance of object manager
lr_object_manager = cl_dpr_appl_object_manager=>get_instance( ).
try.
* Try to get object from application object mapper
lr_common =
lr_object_manager->mr_mapper->get_application_object_by_guid(
iv_object_guid ).
catch cx_dpr_object_mapping_error.
endtry.
check lr_common is bound.

* Get reference of current object
try.
lr_task_o ?= lr_common.
catch cx_sy_move_cast_error.
endtry.
check lr_task_o is bound.
...

BAPI 'GetDetail'

You can use the GET_DETAIL_EXIT_MAP method of the BAdI to transfer the customer-defined fields (that is, the content of the CI include for the current object) to the ES_EXTENSION_OUT parameter.

Requirements

Standard settings

Activities

Example

Business Attributes
ASAP Roadmap ID 257   Create User Exits 
Mandatory / Optional 2   Optional activity 
Critical / Non-Critical 2   Non-critical 
Country-Dependency A   Valid for all countries 
Maintenance Objects
Maintenance object type E   Business Add-In - Definition 
History
Last changed by/on SAP  20040205 
SAP Release Created in 310