Upload
prakashvdasari4647
View
2.483
Download
5
Embed Size (px)
Citation preview
BUT000 : BP: General dataContains Business Partner Number, Partner Category, Partner Type, First Name, Last Name etc.
BUT020 BP: AddressesBUT050 BP relationships/role definitions: General dataContains Relationship, Partner Number (PARTNER1), Relationship CategoryBUT051 BP Relationship: Contact Person RelationshipSimilar to BUT050 , additionally contains Contact Person’s Address dataBUT0BK Business Partner: Bank Data & DetailsBP Number, Bank Key, Bank Country Key, Bank Account NumberBNKA Bank Master DataBUT100 BP: RolesADR2 Telephone Numbers (Business Address Services)ADR6 SMTP Numbers (Business Address Services)Contains Email – Id of the BP.ADRC Addresses (Business Address Services)BP’s Complete Address Details- City, Country, Post Code, District, Street, Title No EtcTSAD3T Table containing the Title text against a Title No.COMM_PRODUCT Master Table for ProductCRMM_BUAG Master table for Business Agreement CRMM_BUAG_H Header Data for Business Agreement such as Tax Category, Tax Characteristic, Form key, Business Agreement Class. Data in this table correspond to ISU CRMD_ORDERADM_H Contains the Header Information for a Business Transaction.Note:1. It doesn’t store the Business Partner responsible for the transaction. To get the Partner No, link it with CRM_ORDER_INDEX.2. This table can be used for search based on the Object Id(Business Transaction No). CRMD_CUSTOMER_H Additional Site Details at the Header Level of a Business TransactionCRMC_PROC_TYPE Master table Business Transaction TypeCRMC_PARTNER_FCT Definition of Partner FunctionsSCPRIOT Priorities for Activities with priority text.CRMC_PROC_TYPE_T Text for a transaction typeCRMC_ACT_OBJ_T Objective Number and Text for Activities TJ30T All the status code and textCRMC_PR_ASSIGN : Transaction Type and its Transaction Type Object.IBIB : Installed Base/IbaseIBIN : Installed Base Components
CRM_ORDER_READ Function Module
1. CRM_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. 2. Always pass the IT_REQUESTED_OBJECTS structure to this function module to fetch the required details only. 3. 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.
data: lr_action_execute type ref to cl_action_execute,
lo_bea type ref to cl_bea_ppf,
lv_appl type bef_appl,
lw_guid_ref type crmt_object_guid.
types : begin of ty_bri_guid,
bdh_guid type /1bea/crmb_bdh-bdh_guid,
bill_type type /1bea/crmb_bdh-bill_type,
bill_org type /1bea/crmb_bdh-bill_org,
payer type /1bea/crmb_bdh-payer,
src_guid type /1bea/crmb_bdi-src_guid,
src_headno type /1bea/crmb_bdi-src_headno,
src_process_type type /1bea/crmb_bdi-src_process_type,
end of ty_bri_guid.
data: lit_header_guid type crmt_object_guid_tab,
lit_text type crmt_text_wrkt,
lit_bri_guid type standard table of ty_bri_guid,
lit_lines type standard table of tline,
lit_temp type standard table of tline,
lw_temp type tline,
ls_line type tline,
ls_text type crmt_text_wrk
data : lw_guid type crmt_object_guid,
lw_object type ty_bri_guid,
lw_kind type crmt_object_kind value 'A',
lw_boolean type crmt_boolean value 'X',
lw_thead type thead,
lw_process_type(4) type c.
create object lr_action_execute.
* (a) Get the GuidID of the billing document
LO_BEA ?= IO_APPL_OBJECT.
LV_APPL = LO_BEA->GET_BEA_NAME( ).
LW_GUID_REF = LO_BEA->GET_HEADGUID( ).
* (b) Get previous document (Contract) for the billing document
* (LW_GUID_REF in our case is the guid for the Billing Document)
SELECT H~BDH_GUID H~BILL_TYPE H~BILL_ORG H~PAYER
I~SRC_GUID I~SRC_HEADNO I~SRC_PROCESS_TYPE
INTO TABLE LIT_BRI_GUID FROM /1BEA/CRMB_BDH AS H
JOIN /1BEA/CRMB_BDI AS I
ON H~BDH_GUID = I~BDH_GUID
WHERE H~BDH_GUID = LW_GUID_REF.
* (c) Get previous document (Contract) text If multiple previous documents
* exist, get the text from all previous documents and copy to invoice.
* This is to get the guid of the Contract in our case.
LOOP AT LIT_BRI_GUID INTO LW_OBJECT.
SELECT SINGLE GUID INTO LW_GUID
FROM CRMD_ORDERADM_H
WHERE OBJECT_ID = LW_OBJECT-SRC_HEADNO.
clear: LIT_HEADER_GUID, lit_text[].
APPEND LW_GUID TO LIT_HEADER_GUID.
* To get the header text by passing the Contract guid and lw_kind = 'A'.
CALL FUNCTION 'CRM_TEXT_READ_API'
EXPORTING
IT_GUID = LIT_HEADER_GUID
IV_OBJECT_KIND = LW_KIND
IV_BUILD_INT_TABLES = LW_BOOLEAN
IMPORTING
ET_TEXT = LIT_TEXT.
LOOP AT LIT_TEXT INTO LS_TEXT
CLEAR LIT_LINES[].
LIT_LINES[] = LS_TEXT-LINES[].
* In our case we are getting only for Internal notes from several Contracts
* and then accumulating into the internal table LIT_LINES.
IF LS_TEXT-STXH-TDID = 'ZT3'.
APPEND LINES OF LIT_LINES TO LIT_LINES.
APPEND INITIAL LINE TO LIT_LINES.
ENDIF.
Endloop.
Endloop.
LW_THEAD-TDSPRAS = SY-LANGU.
LW_THEAD-TDNAME = LW_GUID_REF.
LW_THEAD-TDOBJECT = 'BEA_BDH'.
* Saving the text for Internal Notes
IF NOT LIT_LINES IS INITIAL.
LW_THEAD-TDID = 'ZI01'.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
CLIENT = SY-MANDT
HEADER = LW_THEAD
INSERT = 'I'
SAVEMODE_DIRECT = 'X'
TABLES
LINES = LIT_LINES_ZBSV_ZT3
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
OBJECT = 4
OTHERS = 5.
ENDIF.
CRMXIF_IBASE_SAVE IB_CRM_ADD CRM_IBASE_CHECK_TYP IB_CRM_API CRM_IBASE_ADDRESS_SEARCH CRM_IBASE_CHANGE CRM_IBASE_COMP_ADDRESS_SEARCH CRM_IBASE_COMP_CHANGE CRM_IBASE_COMP_CHANGE_TYPE2
CRM_IBASE_COMP_CREATE CRM_IBASE_COMP_DELETE CRM_IBASE_COMP_FIND CRM_IBASE_COMP_FIND_MULTI CRM_IBASE_COMP_FIND_MULTI_R CRM_IBASE_COMP_GET_ADDRESSCRM_IBASE_COMP_GET_DETAIL CRM_IBASE_COMP_GET_FATHER CRM_IBASE_COMP_GET_HIERARCHY CRM_IBASE_COMP_GET_PARTNER CRM_IBASE_COMP_GOTO_DETAIL CRM_IBASE_COMP_GOTO_PARTNER CRM_IBASE_COMP_IMPORT_DETAIL CRM_IBASE_COMP_IMPORT_SUBSCR CRM_IBASE_COMP_INDOBJ_SEARCH CRM_IBASE_COMP_INDOBJ_SEARCH_R CRM_IBASE_COMP_MOVE CRM_IBASE_COMP_PARTNER_SEARCH CRM_IBASE_COMP_PARTNER_SEARCHR CRM_IBASE_COMP_TABLEINFO CRM_IBASE_COMP_TRANSL_PARAM CRM_IBASE_COPY CRM_IBASE_CREATE CRM_IBASE_DEQUEUE CRM_IBASE_DRILL_DOWN_FOR_COMP CRM_IBASE_ENQUEUE CRM_IBASE_FIND CRM_IBASE_FIND_MULTI CRM_IBASE_FREE CRM_IBASE_GET_ADDRESS CRM_IBASE_GET_ALL CRM_IBASE_GET_CHANGE_STATUS CRM_IBASE_GET_DETAIL CRM_IBASE_GET_HANDLE CRM_IBASE_GET_PARTNER CRM_IBASE_GOTO_DETAIL CRM_IBASE_GOTO_PARTNER CRM_IBASE_INITIALIZE CRM_IBASE_PARTNER_SEARCH CRM_IBASE_PARTNER_SEARCH_RANGE CRM_IBASE_SAVE CRM_IBASE_SET_HANDLE CRM_IBASE_TABLEINFO CRM_IBASE_TRANSL_PARAM IB_BAPI_IBASE BAPI_IBASE_CREATE BAPI_IBASE_GET_DETAIL BAPI_IBASE_SAVE IB_BAPI_COMP BAPI_IBASE_COMP_CREATE BAPI_IBASE_COMP_GET_DETAIL BAPI_IBASE_CREATE IB_IBASE_CREATE IB_IBASE_CREATE_INITIAL CRM_IBASE_COMP_CREATE CRM_IBASE_CREATE IB_COM2_CREATE_IBASE IB_COM_CREATE_IBASE_INITIAL B_COM1_READ_IBASE CRMXIF_IBASE_SAVE
[b]Product Related FM's:[/b] COM_PRODUCT_CATEGORY_CHECK_ALL COM_PRODUCT_CATEGORY_API COM_PRODCAT_API_GET_PRODUCTS COM_PRODUCT_BASE_CATEGORY_READ COM_PRODUCT_CATEGORY_API_FREE COM_PRODUCT_CATEGORY_GETLIST COM_PRODUCT_CATEGORY_F4
COM_PRODUCT_CATEGORY_APPL_F4 COM_PRODUCT_CATEGORY_F4 COM_PRODUCT_CATEGORY_F4_HIERI COM_PRODUCT_CATEGORY_F4_PRREF COM_BSP_PRODUCT_GUID_GET BAPI_CRM_PRODUCT_GETLIST BAPI_PPRODUCT_READMULTIPLE COM_PRODUCT_CHANGEM COM_PRODUCT_CREATEM COM_PRODUCT_FREE COM_PRODUCT_GUID_GET_INTERNAL COM_PRODUCT_MAINTAIN_INIT COM_PRODUCT_MAINTAIN_READ COM_PRODUCT_MAINT_CHECK_ON_DB COM_PRODUCT_READ_MULTIPLE COM_PRODUCT_READ_SINGLE COM_PRODUCT_READ_SINGLEM COM_PRODUCT_READ_VIA_RFC COM_PRODUCT_SAVE COM_PRODUCT_SAVE_LOCAL_END COM_PRODUCT_SAVE_LOCAL_START COM_PRODUCT_GET_PARTNER_PROC COM_PRODUCT_GET_REFERENCE_PROD COM_PRODUCT_GUID_GET COM_PRODUCT_HISTORY_GET COM_PRODUCT_ID_GET COM_PRODUCT_GETLIST COM_PRODCAT_API_GET_PRODUCTS COM_PRODUCT_BASE_CATEGORY_REACOM_PRODUCT_CATEGORY_API_FREE COM_PRODUCT_CATEGORY_GETLIST COM_PRODUCT_GETDETAIL_API COM_PRODUCT_GETHISTORY_API COM_PRODUCT_MAPPING_MODULE COM_PRODUCT_GET_PRODUCT_STATUS COM_PRODUCT_GET_SALES_STATUS COM_PRODUCT_HANDLE_ARCHIVE COM_PRODUCT_HANDLE_RECAT COM_PRODUCT_MOBILE_CHANGE_BDOC COM_PRODUCT_SET_CHANGED_FIELDS COM_PRODUCT_SET_SENDBITS_TASK COM_PRODUCT_SET_UPDATE_TYPE COM_PRODUCT_VAR_MAP_TO_BDOC COM_PRODUCT_CHECK_DELETED COM_PRODUCT_MAINTAIN COM_PRODUCT_MAINTAIN_GETSTATUS COM_PRODUCT_MAINTAIN_GET_CC COM_PRODUCT_MAINTAIN_RESSTATUS COM_PRODUCT_MAINTAIN_RES_CC COM_PRODUCT_MAINTAIN_SETSTATUS COM_PRODUCT_MAINTAIN_SET_CC COM_PRODUCT_MAINTAIN_STATUS COM_PRODUCT_SAVE_DB COM_PRODUCT_GET_TABLES CRM_PRODUCT_GETLIST2 CRM_WAP_PRODUCT_GET_CATEGORY Get Hierarchy and Category of a product CRM_WAP_PRODUCT_GET_DETAILS Get ID,descrion,UOM, Price of a product CRM_WAP_PRODUCT_GET_LIST Get product list from favorit CRM_WAP_PRODUCT_GET_PPR Get the prp product list for a partner COM_PRODUCT_GET_CDB_TABLES CL_SCP_LINEBREAK_UTIL=>STRING_SPLIT_AT_POSITION. CRM_PRP_API APIs for Processing PPRs
CRM_PRP_GET_PPR_FOR_PRODUCTS Returns PPRs where given products are assigned CRM_PRP_PRODUCTS_FOR_A_PRP Retrieve a PPR's products CRM_PRP_PRODUCTS_IN_TIME_RANGE Listed products for a BP within given time ran COM_PRODUCT_IL_READ---> Read relation type
[b]Data Creation[/b]
GUID_CREATE Create GUID for a Business Transaction BAPI_BUSPROCESSND_CREATEMULTI Bapi 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_SAVE Bapi to save the Service Contracts. BAPI_ECRMISUTO_INIT Initialize the creation of Ibase in CRM BAPI_ECRMISUTO_CREATEMULTIPLE Create the Installed Base and its components. Note: Always call the function module ‘BAPI_TRANSACTION_COMMIT’ after call to any Bapi CRM_IBASE_INITIALIZE Initialize the changes to be done in Ibase in CRM CRM_IBASE_SAVE Call this FM to save the changes in the Ibase BAPI_BUPA_FRG0130_CREATE Bapi to create Business Agreement for a customer BAPI_BUPA_ADDRESS_ADD Add invoice address for business partner. Pass the address type as 'rechnung' to add invoice address BAPI_BUPA_BANKDETAIL_ADD Add bank details for the business partner BAPI_BUPA_CREATE_FROM_DATA BAPI for business partner creation as Organization, Person or Group in general role. Same BAPI can be used to create Contact Person for the Business Partner BAPI_BUPR_RELATIONSHIP_CREATE Function module to establish the Business Partner and Contact Person Relationship. Pass the Relationship Category as ‘BUR001’ BAPI_BUPA_ROLE_ADD Add Role to Business Partner for e.g. Sold to Party ‘CRM001’, Contact Person ‘BUP001’ BAPI_BUPA_TAX_ADD BAPI Add Tax Number for the existing Business Partner BAPI_BUPA_FRG0040_CREATE Create Classification Data for a Business Partner BAPI_BUPA_FRG0130_CREATE Create Business Agreement BAPI_BUSPROCESSND_CREATEMULTI BAPI to create Contract. Populate the Header and Line Item Details before calling the BAPI [b] Data Retrieval[/b] BAPI_BUPA_ADDRESSES_GET Determine All Addresses BAPI_BUPA_ADDRESS_GETDETAIL Read Address BAPI_BUPA_ADDRESS_GET_NUMBERS Read Address Numbers BAPI_BUPA_BANKDETAILS_GET Determine All Bank Details BAPI_BUPA_BANKDETAIL_GETDETAIL Read Bank Details BAPI_BUPA_BANKDETAIL_NUMBERS Read Bank Details Numbers BAPI_BUPA_CENTRAL_GETDETAIL Read Central Data BAPI_BUPA_EXISTENCE_CHECK Check Existence of Business Partner BAPI_BUPA_GET_NUMBERS Read Business Partner Numbers BAPI_BUPA_RELATIONSHIPS_GET Determine All BP Relationships BAPI_BUPA_ROLES_GET Determine All Roles BAPI_BUPA_ROLE_EXISTENCE_CHECK Check Existence of Role BAPI_BUPA_SEARCH Search Business Partner for Telephone, E-Mail, Address BAPI_BUPA_STATUS_GETDETAIL Business Partner: Read Status BAPI_BUPR_ACTIVITYP_EXISTCHECK Check Existence of Contact Partner Relationship BAPI_BUPR_CONTP_ADDRESSES_GET Read Contact Person Relationship Addresses BAPI_BUPR_CONTP_ADDR_GETDETAIL Read Contact Person Relationship Addresses BAPI_BUPR_CONTP_GETDETAIL Read Contact Person Relationship BAPI_BUPR_EMPLO_ADDRESSES_GET Read Contact Person Relationship Addresses BAPI_BUPR_EMPLO_ADDR_GETDETAIL Read Employee Relationship Address BAPI_BUPR_EMPLO_GETDETAIL Read Employee Relationship BAPI_BUPR_RELATIONSHIP_GET Read General Relationship BAPI_BUPR_RELSHIP_CHECKEXIST Check Existence of General Relationship BAPI_BUPR_RELSHIP_GET_DETAIL Read General Relationship BAPI_BUPR_RESP_EMPLO_CHEKEXIST Read Relationship of Employee Responsible BUPA_PARTNER_CONTACT_SEARCH Searches business partners for telephone, E-Mail, address ECRM_ISU_COMP_BY_ADDRESS Check for Existence of Ibase CRM_ORDER_GET_HEADER_GUID Get Header GUID for Item GUID pass ref_kind as b CRM_ORDERADM_H_READ_OW Read the Header Details for a Business Transaction. Pass the Header guid. CRM_ORDERADM_I_READ_OW Read the Line Item Details for a line item. Pass the line item guid. CRM_ORDER_READ Get 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_GETSTATUS Get status of the Service Contract