Ansicht
Dokumentation
/CPD/CREATE_MP_FP_FROM_REL_OBJ - RFC: Create Master Project and Financial Plan from a Rel. Object
Addresses (Business Address Services) PERFORM Short ReferenceThis documentation is copyright by SAP AG.
FU /CPD/CREATE_MP_FP_FROM_REL_OBJ
____________________________________________________
Functionality
The RFC function module creates a commercial project as per details passed in the following parameters:
- IS_MP_HDR ,,(Commercial Project Header)
- IS_MP_DESCRIPTION ,,(Commercial Project Description)
- IT_MP_REPT_ATTR ,,(Commercial Project Reporting Attributes)
- IS_MP_CONTACT_PERSON ,,(Contact Person of Commercial Project)
- IT_MP_ITEM_HDR (Related object linked to Commercial Project)
- IT_MP_ITEM_REL (Related Object line items to create Financial Plans)
The function module also creates one or more financial plans based on the items of the related object passed in the parameter IT_MP_ITEM_REL linked to the commercial project.In the financial plan, a bid structure element is created and mapped to the respective item of the related object linked to the commercial project.
BAdI definitions Commercial Project BAdI( /CPD/PWS_MP_DEFAULTS ) and Financial Plan (/CPD/PFP_BADI_FP_DEFAULTSIf possible, please enter the names of the BAdIs with technical names in brackets. BAdI names can be found from SPRO.) are provided within this API for commercial project and financial plan creation respectively. Customers can have their own implementations of these BAdIs.
BAdI /CPD/PFP_BADI_FP_DEFAULTS can be used by customer to have their own rules and determine how financial plans should be created and their bid structure elements linked to items of the related object.
Note:
1),,Commercial projects and financial plans will be created only if there are no errors.
2),,As per standard behavior, one financial plan is created for each item of the related object.
Parameters
IS_MP_HDR: | Master Project Header information |
IS_MP_DESCRIPTION: | Master Project Description |
IS_MP_CONTACT_PERSON: | Master Project Contact Person details |
IT_MP_REPT_ATTR: | Reporting Attributes for Master Project Header |
IT_MP_ITEM_HDR: | Related Object Link to Master Project |
IT_MP_ITEM_REL: | Items of Related Object Link |
IV_SAVE_IMMEDIATELY: | Controls whether the API should be executed in Simulation mode or Save in Database (IV_SAVE_IMMEDIATELY = 'X'). |
MP_ITM_OTYP | Type of the reference object maintained in the Customizing for Commercial Project Management > Master Data > Commercial Project > Define Object Link . For a CRM Opportunity, the object type is 0OPP. | |
MP_ITEM_OKEY | Header GUID of the reference object | |
REP_ATTR | Table type for reporting attributes of the reference object linked to the commercial project (for example, CRM Opportunity) |
,,,,
MP_PITEM_OKEY | Header GUID of the reference object | |
MP_ITM_OTYP | Type of the reference object maintained in the Customizing for Commercial Project Management > Master Data > Commercial Project > Define Object Links. . For CRM Opportunity, the object type is 0OPI. | |
MP_ITEM_OKEY | Reference object item GUID | |
REP_ATTR | Table type for reporting attributes of items of the reference object link (for example, CRM Opportunity item). However, REL_OBJ_ID and REL_OBJ_ITM_DESC are the mandatory attributes to be passed. REL_OBJ_ID is used for the reference object ID and REL_OBJ_ITM_DESC is for providing a relevant description for the reference object item. This information is used to form the plan item name in the bid structure of the financial plan. | |
IS_FP_HEADER | Financial plan header details (to be passed if there is specific financial plan to be created for an item of a related object link. |
Note: Items of the related object link are not stored in the database for the commercial project. However, this data is required so that customers can have their own implementation in the BAdI and set rules to determine financial plan creation.
Example
Scenario: Suppose you want to create a commercial project by adding a SAP CRM Opportunity as a related object. You also want to create a financial plan for each item of the CRM Opportunity.
,,
This example uses the following sample data only for the main parameters that are required.
CRM Opportunity ID: 123
CRM Opportunity Header Guid: XXX
Assuming this CRM Opportunity contains two line items – CRM Opportunity line item 10 – Item GUID – XXX10; CRM Opportunity line item 20 – Item GUID – XXX20.
Commercial Project ID: An input can be passed OR if only one reference object is to be linked (as per IT_MP_ITEM_HDR) to the commercial project then the object reference ID will be copied as the commercial project ID. Otherwise, an error message is raised. As an example, let’s consider MP-1 as the commercial project ID.
Importing parameters
IS_MP_HDR:
-,,MP_ID - MP-1
-,,MP_TYPE - 0001
-,,MP_STAGE - 0001
-,,START_DATE - 10.01.2017
-,,END_DATE – 10.04.2017
IV_MP_DESCRIPTION: MP for ABC customer
IT_MP_ITEM_HDR:
-,,MP_ITM_OTYP: 0OPP (Reference object type maintained in Customizing, in this case 0OPP is the CRM Opportunity type)
-,,MP_ITEM_OKEY: XXX (Reference object header GUID, in this case CRM Opportunity header GUID as mentioned above)
-,,MP_ITM_ID: 123 (Reference object header ID, in this case CRM Opportunity header ID as mentioned above)
IT_MP_ITEM_REL:
(Record1)
-,,MP_PITEM_OKEY – XXX ((Reference object header GUID, in this case CRM Opportunity header guid as mentioned above)
-,,MP_ITM_OTYP – 0OPI (Reference object item type maintained in Customizing, in this case 0OPI is the CRM Opportunity item type)
-,,MP_ITEM_OKEY – XXX10 (Reference object item GUID, in this case CRM Opportunity item GUID which will be used to be linked to a financial plan)
-,,REP_ATTR:
o,,REL_OBJ_ID: 123 (Reference object ID being linked to the commercial project)
o,,REL_OBJ_ITM_DESC: CRM Opportunity (description field which will be used for plan item description for 1st financial plan)
(Record2)
-,,MP_PITEM_OKEY – XXX ((Reference object header GUID, in this case CRM Opportunity header GUID as mentioned above)
-,,MP_ITM_OTYP – 0OPI (Reference object item type maintained in Customizing, in this case 0OPI is the CRM Opportunity item type)
-,,MP_ITEM_OKEY – XXX20 (Reference object item GUID, in this case CRM Opportunity item GUID which will be used to be linked to another financial plan)
-,,REP_ATTR:
o,,REL_OBJ_ID: 123 (Reference object ID being linked to the commercial project)
o,,REL_OBJ_ITM_DESC: CRM Opportunity (description field which will be used for plan item description for 2nd financial plan)
IV_SAVE_IMMEDIATELY: X
Exporting parameters
EV_MP_GUID: (GUID of the commercial project created)
EV_MP_ID: MP-1
ET_FP_DETAILS:
(Record 1)
-,,REF_OBJ_KEY: Reference object header GUID (here it will be XXX)
-,,REF_OBJ_LITM_KEY: Reference object item guid (here it will be XXX10)
-,,PLAN_KEY: Generated financial plan GUID
-,,PLAN_ID: Generated financial plan ID
-,,EXTERNAL_PLAN_ID: Concatenation of commercial project ID and index (here it will be MP-1-1)
-,,PLAN_STRUCTURE:
(Record 1)
o,,PLAN_ITEM_ID: 1
o,,PLAN_ITEM_NAME: Determined internally
o,,OBJECT_TYPE: CMP
o,,REF_OBJECT_GUID: Null (for 1st level)
(Record 2)
o,,PLAN_ITEM_ID: 2
o,,PLAN_ITEM_NAME: Concatenated information passed in REL_OBJ_ITM_DESC and REL_OBJ_ID in the REP_ATTR field of IT_MP_ITEM_REL for the reference object item (here it will be CRM Opportunity(123)
o,,OBJECT_TYPE: WBS
o,,REF_OBJECT_GUID: XXX10 (Reference object item GUID)
(Record 2)
-,,REF_OBJ_KEY: Reference object header GUID (here it will be XXX)
-,,REF_OBJ_LITM_KEY: Reference object item GUID (here it will be XXX20)
-,,PLAN_KEY: Generated financial plan GUID
-,,PLAN_ID: Generated financial plan ID
-,,EXTERNAL_PLAN_ID: Concatenation of commercial project ID and index (here it will be MP-1-2)
-,,PLAN_STRUCTURE:
(Record 1)
o,,PLAN_ITEM_ID: 1
o,,PLAN_ITEM_NAME: Determined internally
o,,OBJECT_TYPE: CMP
o,,REF_OBJECT_GUID: Null (for 1st level)
(Record 2)
o,,PLAN_ITEM_ID: 2
o,,PLAN_ITEM_NAME: Concatenated information passed in REL_OBJ_ITM_DESC and REL_OBJ_ID in the REP_ATTR field of IT_MP_ITEM_REL for the reference object item (here it will be CRM Opportunity(123)
o,,OBJECT_TYPE: WBS
o,,REF_OBJECT_GUID: XXX20 (Reference object item GUID)
ET_MESSAGES: The message structure is in BAPIRET format.
Function Group
/CPD/MP_SERVICES
Parameters
ET_FP_DETAILSET_MESSAGES
EV_MP_GUID
EV_MP_ID
IS_MP_CONTACT_PERSON
IS_MP_HDR
IT_MP_ITEM_HDR
IT_MP_ITEM_REL
IT_MP_REPT_ATTR
IV_MP_DESCRIPTION
IV_SAVE_IMMEDIATELY
Exceptions
Function Group
/SAPLMP_SERVICESrdisp/max_wprun_time - Maximum work process run time rdisp/max_wprun_time - Maximum work process run time
This documentation is copyright by SAP AG.
Length: 11710 Date: 20240426 Time: 091454 sap01-206 ( 149 ms )