SAP ECRM_CONTRACT_CHANGE Function Module for Change Contract Status
ECRM_CONTRACT_CHANGE is a standard ecrm contract change SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Change Contract Status processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for ecrm contract change FM, simply by entering the name ECRM_CONTRACT_CHANGE into the relevant SAP transaction such as SE37 or SE38.
Function Group: ECRM_DOWNLOAD_ISUCONTRACT
Program Name: SAPLECRM_DOWNLOAD_ISUCONTRACT
Main Program: SAPLECRM_DOWNLOAD_ISUCONTRACT
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function ECRM_CONTRACT_CHANGE pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'ECRM_CONTRACT_CHANGE'"Change Contract Status.
EXPORTING
* X_CONTRACTPOS = "GUID in 'RAW' Format
* X_PARTNER = "Business Partner Number
* X_SEND_ONLY = "Indicator
* X_NO_SEND = "
* X_NO_COMMIT = "Indicator
* X_LINK = "Transfer Structure: Contract Status from CRM to IS-U Item
* X_ISURQCONTSTART = "Indicator
* X_ISURQCONTEND = "Indicator
* X_SENDER = "GUID in 'CHAR' format with upper-/lowercase (!)
* X_PROC_LOG = "Transfer Structure: Contract Status from CRM to IS-U Item
* X_CONTRACTPOS_22 = "GUID in 'CHAR' format with upper-/lowercase (!)
* X_AB = "Date from Which a Time Slice is Valid
* X_BIS = "Date at Which a Time Slice Expires
* X_ACTIVATESTATUS = "Individual Status of an Object
* X_INACTIVATESTATUS = "Reasons for cancelling contracts
* X_CANCREASON = "Reasons for cancelling contracts
* X_CANCEL = "Indicator
* X_CREATECHANGETICKET = "Indicator
IMPORTING
Y_CHANGETICKET = "ISU-CRM Change Number
CHANGING
* XY_CONTRACT_DATA = "Replication Data for Contract
EXCEPTIONS
CONTRACT_NOT_FOUND = 1 MULTIPLE_CONTRACTS = 2 INSUFFICIENT_IMPORT_DATA = 3
IMPORTING Parameters details for ECRM_CONTRACT_CHANGE
X_CONTRACTPOS - GUID in 'RAW' Format
Data type: EVERH-CONTRACTPOSOptional: Yes
Call by Reference: No ( called with pass by value option)
X_PARTNER - Business Partner Number
Data type: BU_PARTNEROptional: Yes
Call by Reference: No ( called with pass by value option)
X_SEND_ONLY - Indicator
Data type: KENNZXOptional: Yes
Call by Reference: Yes
X_NO_SEND -
Data type: KENNZXOptional: Yes
Call by Reference: Yes
X_NO_COMMIT - Indicator
Data type: KENNZXOptional: Yes
Call by Reference: Yes
X_LINK - Transfer Structure: Contract Status from CRM to IS-U Item
Data type: ECRM_CRMCONTRACT_LINKOptional: Yes
Call by Reference: No ( called with pass by value option)
X_ISURQCONTSTART - Indicator
Data type: SYDATUMOptional: Yes
Call by Reference: No ( called with pass by value option)
X_ISURQCONTEND - Indicator
Data type: SYDATUMOptional: Yes
Call by Reference: No ( called with pass by value option)
X_SENDER - GUID in 'CHAR' format with upper-/lowercase (!)
Data type: GUID_22Optional: Yes
Call by Reference: No ( called with pass by value option)
X_PROC_LOG - Transfer Structure: Contract Status from CRM to IS-U Item
Data type: ECRM_CRMCONTRACT_PROC_LOGOptional: Yes
Call by Reference: No ( called with pass by value option)
X_CONTRACTPOS_22 - GUID in 'CHAR' format with upper-/lowercase (!)
Data type: ANYOptional: Yes
Call by Reference: No ( called with pass by value option)
X_AB - Date from Which a Time Slice is Valid
Data type: EVERH-ABOptional: Yes
Call by Reference: Yes
X_BIS - Date at Which a Time Slice Expires
Data type: EVERH-BISOptional: Yes
Call by Reference: Yes
X_ACTIVATESTATUS - Individual Status of an Object
Data type: ECRM_STATUS_TOptional: Yes
Call by Reference: Yes
X_INACTIVATESTATUS - Reasons for cancelling contracts
Data type: ECRM_STATUS_TOptional: Yes
Call by Reference: Yes
X_CANCREASON - Reasons for cancelling contracts
Data type: EECRM_CRMCONTRACTPOS-CANCREASON_NEWOptional: Yes
Call by Reference: No ( called with pass by value option)
X_CANCEL - Indicator
Data type: KENNZXOptional: Yes
Call by Reference: Yes
X_CREATECHANGETICKET - Indicator
Data type: KENNZXOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for ECRM_CONTRACT_CHANGE
Y_CHANGETICKET - ISU-CRM Change Number
Data type: ECRM_CHANGE_TICKETOptional: No
Call by Reference: Yes
CHANGING Parameters details for ECRM_CONTRACT_CHANGE
XY_CONTRACT_DATA - Replication Data for Contract
Data type: ECRM_CRMCONTRACT_DATAOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
CONTRACT_NOT_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
MULTIPLE_CONTRACTS -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INSUFFICIENT_IMPORT_DATA -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for ECRM_CONTRACT_CHANGE Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lv_x_contractpos | TYPE EVERH-CONTRACTPOS, " | |||
| lv_y_changeticket | TYPE ECRM_CHANGE_TICKET, " | |||
| lv_xy_contract_data | TYPE ECRM_CRMCONTRACT_DATA, " | |||
| lv_contract_not_found | TYPE ECRM_CRMCONTRACT_DATA, " | |||
| lv_x_partner | TYPE BU_PARTNER, " | |||
| lv_x_send_only | TYPE KENNZX, " | |||
| lv_x_no_send | TYPE KENNZX, " | |||
| lv_x_no_commit | TYPE KENNZX, " | |||
| lv_x_link | TYPE ECRM_CRMCONTRACT_LINK, " | |||
| lv_x_isurqcontstart | TYPE SYDATUM, " | |||
| lv_x_isurqcontend | TYPE SYDATUM, " | |||
| lv_x_sender | TYPE GUID_22, " | |||
| lv_x_proc_log | TYPE ECRM_CRMCONTRACT_PROC_LOG, " | |||
| lv_x_contractpos_22 | TYPE ANY, " | |||
| lv_multiple_contracts | TYPE ANY, " | |||
| lv_x_ab | TYPE EVERH-AB, " | |||
| lv_insufficient_import_data | TYPE EVERH, " | |||
| lv_x_bis | TYPE EVERH-BIS, " | |||
| lv_x_activatestatus | TYPE ECRM_STATUS_T, " | |||
| lv_x_inactivatestatus | TYPE ECRM_STATUS_T, " | |||
| lv_x_cancreason | TYPE EECRM_CRMCONTRACTPOS-CANCREASON_NEW, " | |||
| lv_x_cancel | TYPE KENNZX, " | |||
| lv_x_createchangeticket | TYPE KENNZX. " |
|   CALL FUNCTION 'ECRM_CONTRACT_CHANGE' "Change Contract Status |
| EXPORTING | ||
| X_CONTRACTPOS | = lv_x_contractpos | |
| X_PARTNER | = lv_x_partner | |
| X_SEND_ONLY | = lv_x_send_only | |
| X_NO_SEND | = lv_x_no_send | |
| X_NO_COMMIT | = lv_x_no_commit | |
| X_LINK | = lv_x_link | |
| X_ISURQCONTSTART | = lv_x_isurqcontstart | |
| X_ISURQCONTEND | = lv_x_isurqcontend | |
| X_SENDER | = lv_x_sender | |
| X_PROC_LOG | = lv_x_proc_log | |
| X_CONTRACTPOS_22 | = lv_x_contractpos_22 | |
| X_AB | = lv_x_ab | |
| X_BIS | = lv_x_bis | |
| X_ACTIVATESTATUS | = lv_x_activatestatus | |
| X_INACTIVATESTATUS | = lv_x_inactivatestatus | |
| X_CANCREASON | = lv_x_cancreason | |
| X_CANCEL | = lv_x_cancel | |
| X_CREATECHANGETICKET | = lv_x_createchangeticket | |
| IMPORTING | ||
| Y_CHANGETICKET | = lv_y_changeticket | |
| CHANGING | ||
| XY_CONTRACT_DATA | = lv_xy_contract_data | |
| EXCEPTIONS | ||
| CONTRACT_NOT_FOUND = 1 | ||
| MULTIPLE_CONTRACTS = 2 | ||
| INSUFFICIENT_IMPORT_DATA = 3 | ||
| . " ECRM_CONTRACT_CHANGE | ||
ABAP code using 7.40 inline data declarations to call FM ECRM_CONTRACT_CHANGE
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| "SELECT single CONTRACTPOS FROM EVERH INTO @DATA(ld_x_contractpos). | ||||
| "SELECT single AB FROM EVERH INTO @DATA(ld_x_ab). | ||||
| "SELECT single BIS FROM EVERH INTO @DATA(ld_x_bis). | ||||
| "SELECT single CANCREASON_NEW FROM EECRM_CRMCONTRACTPOS INTO @DATA(ld_x_cancreason). | ||||
Search for further information about these or an SAP related objects