Presentation on theme: "SAP - CRM. SAP - CRM CRM One Order Model CRM One Order concept. layers of one order framework Function modules in the one order framework Table Relationship."— Presentation transcript:
4 CRM One Order concept.layers of one order frameworkFunction modules in the one order frameworkTable RelationshipCRMV_EVENTS
5 CRM One Order conceptExamples of one order document in SAP CRM:ActivitiesTaskSales OrderService OrderService RequestContractsLeadOpportunity…
6 CRM One Order conceptThis means same BDoc (BUS_TRANS_MSG) , FM and Module pool programming would be used for all the transaction data.They would be handled as if they are same transaction.Hence the name One Order which is basically framework to handle these related transaction data.
8 Business TransactionAll the Business transactions (Tcode : CRMD_ORDER) can have a number of objects as shown in the previous slide.The different object like Texts, Status, Actions, Shipping, Billing are a few generic objects, they can be assigned to the Business Transactions as and when needed.The Objects are assigned to business transactions as and when required.
9 Advantage s of One Order Model Reusable objectsSimple and consistent flow logic for all objects and all levelsAvoid big program and module poolsHandling of error message
11 One Order Layer ModelA four layer model is used as basic for programming in the CRM system. This model takes a strict differentiation between the user interface, interaction, and application logic and database access. Every layer is separate and contains data in a local memory. Access to the individual layer is carried out via the interfaces, but can only occur between the next direct layers or in the same layer.READSAVE
12 One Order Layer ModelUser Interface: User Interface is responsible for the displaying of the fields on the GUI.Interaction Layer: The interaction layer controls the business transaction process. It uses the user entries ( field changes, function keys...), the methods called up from the object (FCODE control), the object which should be displayed and processes, or the elements in the relevant user interface are activated (screen or fields controls).Object Layer: The object layer contains the complete application logic for editing an object for Ex.Changing order headerAdding itemsDetermining priceReading customizing dataDetermining default valuesEct.Database Layer: The database layer is the interface to the database. All database operations for one object are carried out at this level (read, delete and change). The last original copy of the document before the changes were saved is kept in the local memory of the database layer.
15 Function Modules Function modules and reports are named as <Component>_<Object>_<Method>_<Layer>Example : CRM_ORDERADM_H_READ_OBFor layers the abbreviations used are as below:
16 Function ModulesCRM_ORDER_READCRM_ORDER_MAINTAINCRM_ORDER_SAVE
17 CRM_ORDER_READCRM_ORDER_READ is a function module which can be used to get the details of any business transaction based on the Header GUID, Item GUID or both.Always pass the IT_REQUESTED_OBJECTS structure to this function module to fetch the required details only.This function module can not be executed directly instead SAP has provided a report CRM_ORDER_READ for the same for testing purpose. We can pass Business Transaction Number (Object ID), Header GUID or Item GUID to this report to get the required details.
18 Some Exporting parameters of the CRM_ORDER_READ Return Structure NameDetails FetchedET_ORDERADM_HHeader Details of a Business Transaction such as OBJECT_ID, PROCESS_TYPE etc.ET_ORDERADM_IItem Details of a Business Transaction such as PRODUCT, PRODUCT_KIND, HEADER etc.ET_ACTIVITY_HHeader Details of an activity such as PRIORITY, OBJECTIVE, Address Details etc.ET_ACTIVITY_IItem Details of an activity.ET_CUSTOMER_HAdditional details at Header levelET_CUSTOMER_IAdditional details at Item levelET_APPOINTMENTAll the dates at Header and Item levelET_PARTNERPartner Details at Header and Item levelET_STATUSStatus of Business Transaction at Header and Item levelET_BILLINGBilling related details for a Business Transaction both at Header and Item (This structure was enhanced in a leading ISU SAP-CRM implementation to include BUAG_ID(Business Agreement) field in a Service ContractET_ORDPRP_OBJL_I_DObject List details such as PRODUCTET_DOC_FLOWRef. Details of the previous Business Transaction
19 Call Stack of CRM_ORDER_READ FM The Function module CRM_ORDER_READ is called to retrieve all relevant data for the one order objects.This FM Read in turn calls CRM_ORDER_READ_OW (for retrieving data from work area). If no data is available in the Work area then the this function module calls CRM_ORDERADM_H_READ_OB to fetch header data from the buffer. If no data is available in the buffer then this function module in turn calls CRM_ORDERADM_H_DB (to read the header data from the database).In a similar manner the item data retrieval FM are called to fetch the item data.
21 CRM_ORDER_MAINTAIN FM The FM CRM_ORDER_MAINTAIN updates the one order documents after user interaction or for system defaulting.For each of the objects like status, pricing, shipping this FM is called to maintain the data.This Function module in turns calls : CRM_ORDER_MAINTAIN_MULTI_OW which is used to m1aintain the Object work area at a time for different One order documents.This in turn calls CRM_ORDER_MAINTAIN_SINGLE_OW for each document.The CRM_ORDER_MAINTAIN_SINGLE_OW calls the header and Item which contain maintain functions and for each object (status, pricing ..etc) as CRM_<OBJECT>_MAINTAIN_OW.
22 Call Stack of CRM_ORDER_SAVE FM This function module Persists the document and changes in the database.The latest call in order to prepare the document data for saving (checks, manipulation) should be done in the Badi ORDER_SAVE using the *OB* function modules in order to modify specific segments.
23 Call Stack of CRm_Order_Save FM They are finally called in Update mode to actually commit the data to the database.CRM_ORDERADM_H_UPDATE_DUCRM_ORDERADM_I_UPDATE_DU
24 Data Creation Function Module’s Name Description GUID_CREATE Create GUID for a Business TransactionBAPI_BUSPROCESSND_CREATEMULTIBapi to create Service Contracts programmatically. Pass the inputfields to be created in the contract.Note: BAPI_BUSPROCESSND_SAVE must be called after this function call to save the Service Contract.BAPI_BUSPROCESSND_SAVEBapi to save the Service Contracts.BAPI_ECRMISUTO_INITInitialize the creation of Ibase in CRMBAPI_ECRMISUTO_CREATEMULTIPLECreate the Installed Base and its components.Note:Always call the function module‘BAPI_TRANSACTION_COMMIT’after call to any BapiCRM_IBASE_INITIALIZEInitialize the changes to be done in Ibase in CRMCRM_IBASE_SAVECall this FM to save the changes in the IbaseBAPI_BUPA_FRG0130_CREATEBapi to create Business Agreement for a customerBAPI_BUPA_ADDRESS_ADDAdd invoice address for business partner. Pass the address type as 'rechnung' to add invoice addressBAPI_BUPA_BANKDETAIL_ADDAdd bank details for the business partnerBAPI_BUPA_CREATE_FROM_DATABAPI for business partner creation as Organization, Person or Group in general role. Same BAPI can be used to create Contact Person for the Business PartnerBAPI_BUPR_RELATIONSHIP_CREATEFunction module to establish the Business Partner and Contact PersonRelationship. Pass the Relationship Category as ‘BUR001’BAPI_BUPA_ROLE_ADDAdd Role to Business Partner for e.g. Sold to Party ‘CRM001’, Contact Person ‘BUP001’BAPI_BUPA_TAX_ADDBAPI Add Tax Number for the existing Business PartnerBAPI_BUPA_FRG0040_CREATECreate Classification Data for a Business PartnerCreate Business AgreementBAPI to create Contract. Populate the Header and Line Item Details before calling the BAPI
25 Function Module’s Data Retrieval Name Description BAPI_BUPA_ADDRESSES_GETDetermine All AddressesBAPI_BUPA_ADDRESS_GETDETAILRead AddressBAPI_BUPA_ADDRESS_GET_NUMBERSRead Address NumbersBAPI_BUPA_BANKDETAILS_GETDetermine All Bank DetailsBAPI_BUPA_BANKDETAIL_GETDETAILRead Bank DetailsBAPI_BUPA_BANKDETAIL_NUMBERSRead Bank Details NumbersBAPI_BUPA_CENTRAL_GETDETAILRead Central DataBAPI_BUPA_EXISTENCE_CHECKCheck Existence of Business PartnerBAPI_BUPA_GET_NUMBERSRead Business Partner NumbersBAPI_BUPA_RELATIONSHIPS_GETDetermine All BP RelationshipsBAPI_BUPA_ROLES_GETDetermine All RolesBAPI_BUPA_ROLE_EXISTENCE_CHECKCheck Existence of RoleBAPI_BUPA_SEARCHSearch Business Partner for Telephone, , AddressBAPI_BUPA_STATUS_GETDETAILBusiness Partner: Read StatusBAPI_BUPR_ACTIVITYP_EXISTCHECKCheck Existence of Contact Partner RelationshipBAPI_BUPR_CONTP_ADDRESSES_GETRead Contact Person Relationship AddressesBAPI_BUPR_CONTP_ADDR_GETDETAILBAPI_BUPR_CONTP_GETDETAILRead Contact Person RelationshipBAPI_BUPR_EMPLO_ADDRESSES_GETBAPI_BUPR_EMPLO_ADDR_GETDETAILRead Employee Relationship AddressBAPI_BUPR_EMPLO_GETDETAILRead Employee RelationshipBAPI_BUPR_RELATIONSHIP_GETRead General RelationshipBAPI_BUPR_RELSHIP_CHECKEXISTCheck Existence of General RelationshipBAPI_BUPR_RELSHIP_GET_DETAILBAPI_BUPR_RESP_EMPLO_CHEKEXISTRead Relationship of Employee ResponsibleBUPA_PARTNER_CONTACT_SEARCHSearches business partners for telephone, , addressECRM_ISU_COMP_BY_ADDRESSCheck for Existence of IbaseCRM_ORDER_GET_HEADER_GUIDGet Header GUID for Item GUID pass ref_kind as bCRM_ORDERADM_H_READ_OWRead the Header Details for a Business Transaction. Pass the Header guid.CRM_ORDERADM_I_READ_OWRead the Line Item Details for a line item. Pass the line item guid.CRM_ORDER_READGet all the Service Contract details.Note: Pass the requested objects to fetch only the required details.This can also be used to get the details of activities/leads/opportunities etc.CRM_ORDER_GETSTATUSGet status of the Service Contract
26 Data Maintenance Function Module’s Name Description BAPI_BUSPROCESSND_CHANGEMULTIBapi to change Service Contracts programmatically. Pass the inputfields to be modified.Note: CRM_ORDER_SAVE function module must be called to save the changed contract explicitly after call to this function module.CRM_ORDER_SAVESave the changes made to the Service Contract. Just pass the Header_GUID of the service contract.CRM_APPT_MAINTAIN_SINGLE_OWMaintain the Dates for a Service Contract (Start Date, End date, Date of Sale, Planned Contract Start Date etc). Don’t forget to pass the input_fields to be maintained.CRM_STATUS_MAINTAIN_OWMaintain the user status of Service Contracts. Don’t forget to pass the input_fields to be maintained.CRM_IBASE_COMP_CHANGEChange the Installed Base componentsNote:Always call the FM‘CRM_IBASE_SAVE’ to save thechanges done to IbaseBAPI_BUPA_BANKDETAIL_CHANGEChange Bank DetailsBAPI_BUPA_BANKDETAIL_REMOVEDelete Bank DetailsBAPI_BUPA_CENTRAL_CHANGEChange Central DataBAPI_BUPA_ADDRESS_CHANGEChange AddressBAPI_BUPA_ADDRESS_REMOVEDelete AddressBAPI_BUPA_CENTRAL_SAVEREPLICAALE Replicating Central DataBAPI_BUPA_STATUS_REMOVEBusiness Partner: Delete StatusBAPI_BUPR_ACTIVITYP_CHANGEChange Contact Partner RelationshipBAPI_BUPR_ACTIVITYP_DELETEDelete Contact Partner RelationshipBAPI_BUPR_CONTP_ADDR_CHANGEChange Contact Person Relationship AddressBAPI_BUPR_CONTP_ADDR_REMOVEDelete Contact Person Relationship AddressBAPI_BUPR_CONTP_CHANGEBAPI_BUPR_CONTP_DELETEDelete Contact Person RelationshipBAPI_BUPR_EMPLO_ADDR_CHANGEChange Employee Relationship AddressBAPI_BUPR_EMPLO_ADDR_REMOVEDelete Employee Relationship AddressBAPI_BUPR_EMPLO_DELETEDelete Employee RelationshipBAPI_BUPR_RELATIONSHIP_CHANGEChange General RelationshipBAPI_BUPR_RELATIONSHIP_DELETEDelete RelationshipsBAPI_BUPR_RELATIONSHIP_REMOVEDelete General RelationshipBAPI_BUPR_RESP_EMPLO_DELETEDelete Relationship of Employee Responsible
27 Business Transaction Category Categorization of CRM Business Transaction based on Subobject CategoryWe have used Subobjects to categorize the Business Transactions in CRM for a leading ISU-SAP CRM implementation. Business Transaction NameBusiness Transaction NameSUBOBJECT CATEGORYActivityBUSService ContractBUSLeadBUSBUSTaskBUSUtility contract itemBUS
28 Business Tranasaction Program Names DescriptionCRM_ORDER_READCRM_BUPA*Business partner related programsCRM_ ACTIVITIES*CRM_ACTIVITY*Activity related programsCRM_ARC*Archiving related programsCRM_BILLING*Billing related programsCRM_ORDER*CRM document related programsCRM_LEASING*CRM*LEASING*Leasing related programsNote:For Example if you want to retrieve all the activities in CRM, pass the OBJECT_TYPEas ‘BUS ‘ in CRMD_ORDER_INDEX table.2. The Subobject Category can be customized for a business transaction from thetransaction SPRO.
30 CRM Table Relationship Linking Business Partner Tables logically BUT000 - contains the key as Business Partner Number – thus other details of business partner such as Category, Type, Name, Language, Country, Contact Person etc can be obtained from it by using the corresponding BP Number.BUT0BK- Using the BP Number and Bank Detail ID, details such as Bank Account Number, Account Holder’s Name, and Name of Bank Account etc can be obtained.BUT020 – ADRC – ADR2 – ADR6 is the link of tables used to get the Address Details of the BP corresponding to Business Partner Number (obtained from BUT000) and the address number from BUT020 table.Roles of Business Partner can be obtained from the table BUT100.Contact Person and related details for a BP number (BUT000) can be obtained using the table BUT051.Business Partner’s Roles and Relationship Details for BP number (BUT000) can be obtained from BUT050.
31 CRM Table Relationship Linking Service Contract Tables LogicallyCRMD_ORDER_INDEX: Contains GUID’s of all the transactions in CRM. Also provides a link to connect Business Partner with the CRM Transaction.CRMD_CUSTOMER_H: Contains Additional Contract Details (enhanced fields), linked to Header GUID.CRMD_CUSTOMER_I: Contains Additional Site Details (enhanced fields), links Header and Item GUID’s for all the transactions.CRMD_ORDERADM_H: Contains Header Details. GUID field can be used to link with CRMD_ORDER_INDEX.CRMD_ORDERADM_I: Contains Item Details. HEADER field can be used to link with CRMD_ORDERADM_H (header guid).
40 Master Data Table Table Name Description Business Partner BUT000 BP: General dataContains Business Partner Number, Partner Category, Partner Type, First Name, Last Name etc.BUT020BP: AddressesBUT050BP relationships/role definitions: General dataContains Relationship, Partner Number (PARTNER1), Relationship CategoryBUT051BP Relationship: Contact Person RelationshipSimilar to BUT050 , additionally contains Contact Person’s Address dataBUT0BKBusiness Partner: Bank Data & DetailsBP Number, Bank Key, Bank Country Key, Bank Account NumberBNKABank Master DataBUT100BP: RolesADR2Telephone Numbers (Business Address Services)ADR6SMTP Numbers (Business Address Services)Contains – Id of the BP.ADRCAddresses (Business Address Services)BP’s , Country, Post Code, District, Street, Title No EtcTSAD3TTable containing the Title text against a Title No.Note:Pass the langu key with thelanguage in which you want thetext.
41 Master Data Table COMM_PRODUCT Master Table for Product CRMM_BUAG Master table for Business AgreementCRMM_BUAG_HHeader Data for Business Agreement such as Tax Category, Tax Characteristic, Form key, Business Agreement Class. Data in this table correspond to ISU Contract account table FKKVKP.CRMM_BABR_HRule data for business agreements – data in this table correspond to ISU Contract account table FKKVKBusiness Transaction(Service Contracts in Particular)CNCCRMPRCUSZZBURCondition Records for Service Contracts. We get Basic Unit Rate, Standing Charge Rate etc.(This is a Z table used in a leading ISU SAP-CRM implementation. You can give the table SAP0090 – this is a standard table. – in general all condition tables have the naming convention CNCC*)CRMD_ORDERADM_HContains the Header Information for a Business Transaction.Note:It doesn’t store the Business Partnerresponsible for the transaction. Toget the Partner No, link it withCRM_ORDER_INDEX.This table can be used for searchbased on the Object Id(BusinessTransaction No).CRMD_CUSTOMER_HAdditional Site Details at the Header Level of a Business TransactionCRMC_PROC_TYPEMaster table Business Transaction TypeCRMC_PARTNER_FCTDefinition of Partner FunctionsSCPRIOTPriorities for Activities with priority text.Pass the langu key with thelanguage in which you want thetext.CRMC_PROC_TYPE_TText for a transaction typeCRMC_ACT_OBJ_TObjective Number and Text for ActivitiesTJ30TAll the status code and textCRMC_PR_ASSIGNTransaction Type and its Transaction Type Object.IBIBInstalled Base/I baseIBINInstalled Base Components
42 Transaction Data Table Table NameDescriptionCRMD_LINKTransaction GUID set for all the Business TransactionsCRMD_ORDER_INDEXContains Header as well as Item details for a Business Transaction.Note:It doesn’t store the BusinessTransaction No (Object ID).To get the Business Transaction Nolink the table withCRMD_ORDERADM_H2. This table can be used for searchbased on the Partner NoCRMD_ORDERADM_IStores the Item information for a Business Transaction. The scenarios where we have a Contract Header and within contract we have Line Items for the contract, this table can be useful.E.g. Service ContractsCRMD_CUSTOMER_IAdditional Site Details at the Item Level of a Service ContractSCAPPTSEGTable for individual Appointment Types for a transaction.CRM_JESTIndividual Object Status for any business transaction.CRM_JCDSCurrent Status for a business transaction along with set date, set time and status code.
43 Badi’s in SAP CRM One Order Model Badi's NameDescriptionCRM_ORDER_FIELDCHECKField check during transactional processingCRM_ORDERADM_H_BADIUpdate of the table CRM_ORDERADM_HCRM_ORDER_STATUSManipulating the status of the transactionCRM_APPOINTMENT_BADICRM_SERVICE_OS_BADICRM_ORGMAN_BADIManipulating the automatic organization determinationCRM_PARTNER_BADICOM_PARTNER_DETERMManipulating the automatic parterner determinationCRM_ORDERCRM_CUSTOMER_H_BADIORDER_SAVECheck and manipulate data before the doc is savedCRM_DATAEXCHG_BADIControls the data while the data exchange with R/3CRM_EEW_CUSTOMER_HManipulating EEWB fieldsEXEC_METHODCALL_PPFAction BadiCRM_COPY_BADICopy controls for one order documentsCRM_ORDER_INDEX_BADIUpdate of the table CRM_ORDER_INDEX