SAP ISM_CONTRACT_COPY Function Module for Copy Contract
ISM_CONTRACT_COPY is a standard ism contract copy SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Copy Contract 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 ism contract copy FM, simply by entering the name ISM_CONTRACT_COPY into the relevant SAP transaction such as SE37 or SE38.
Function Group: JKSDCONTRACTAPI
Program Name: SAPLJKSDCONTRACTAPI
Main Program: SAPLJKSDCONTRACTAPI
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function ISM_CONTRACT_COPY 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 'ISM_CONTRACT_COPY'"Copy Contract.
EXPORTING
IM_VBELN_OLD = "Sales and Distribution Document Number
* IM_POSNR_OLD_TAB = "IS-M: Range Table for POSNR
* IM_PARTNER_TAB = "IS-M: Table Type for Partner Data
* IM_FLAG_TEST = 'X' "Test Run
* IM_FLAG_COMMIT = "Execute Commit
* IM_VALIDFROM = '00000000' "Contract Start
* IM_VALIDTO = '00000000' "Contract End
IMPORTING
EX_RETURN_TAB = "IS-M: BAPIRET2 Table
EX_VBELN = "Sales and Distribution Document Number
EX_CONTRACT_NOT_VALID = "
IMPORTING Parameters details for ISM_CONTRACT_COPY
IM_VBELN_OLD - Sales and Distribution Document Number
Data type: VBELNOptional: No
Call by Reference: Yes
IM_POSNR_OLD_TAB - IS-M: Range Table for POSNR
Data type: RJKSD_POSNR_RANGE_TABOptional: Yes
Call by Reference: Yes
IM_PARTNER_TAB - IS-M: Table Type for Partner Data
Data type: RJKSDPARTNER_TABOptional: Yes
Call by Reference: Yes
IM_FLAG_TEST - Test Run
Data type: XFLAGDefault: 'X'
Optional: Yes
Call by Reference: Yes
IM_FLAG_COMMIT - Execute Commit
Data type: XFLAGOptional: Yes
Call by Reference: Yes
IM_VALIDFROM - Contract Start
Data type: VBDAT_VEDADefault: '00000000'
Optional: Yes
Call by Reference: No ( called with pass by value option)
IM_VALIDTO - Contract End
Data type: VNDAT_VEDADefault: '00000000'
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for ISM_CONTRACT_COPY
EX_RETURN_TAB - IS-M: BAPIRET2 Table
Data type: BAPIRET2TABOptional: No
Call by Reference: Yes
EX_VBELN - Sales and Distribution Document Number
Data type: VBELNOptional: No
Call by Reference: Yes
EX_CONTRACT_NOT_VALID -
Data type: XFELDOptional: No
Call by Reference: Yes
Copy and paste ABAP code example for ISM_CONTRACT_COPY 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_im_vbeln_old | TYPE VBELN, " | |||
| lv_ex_return_tab | TYPE BAPIRET2TAB, " | |||
| lv_ex_vbeln | TYPE VBELN, " | |||
| lv_im_posnr_old_tab | TYPE RJKSD_POSNR_RANGE_TAB, " | |||
| lv_im_partner_tab | TYPE RJKSDPARTNER_TAB, " | |||
| lv_ex_contract_not_valid | TYPE XFELD, " | |||
| lv_im_flag_test | TYPE XFLAG, " 'X' | |||
| lv_im_flag_commit | TYPE XFLAG, " | |||
| lv_im_validfrom | TYPE VBDAT_VEDA, " '00000000' | |||
| lv_im_validto | TYPE VNDAT_VEDA. " '00000000' |
|   CALL FUNCTION 'ISM_CONTRACT_COPY' "Copy Contract |
| EXPORTING | ||
| IM_VBELN_OLD | = lv_im_vbeln_old | |
| IM_POSNR_OLD_TAB | = lv_im_posnr_old_tab | |
| IM_PARTNER_TAB | = lv_im_partner_tab | |
| IM_FLAG_TEST | = lv_im_flag_test | |
| IM_FLAG_COMMIT | = lv_im_flag_commit | |
| IM_VALIDFROM | = lv_im_validfrom | |
| IM_VALIDTO | = lv_im_validto | |
| IMPORTING | ||
| EX_RETURN_TAB | = lv_ex_return_tab | |
| EX_VBELN | = lv_ex_vbeln | |
| EX_CONTRACT_NOT_VALID | = lv_ex_contract_not_valid | |
| . " ISM_CONTRACT_COPY | ||
ABAP code using 7.40 inline data declarations to call FM ISM_CONTRACT_COPY
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.| DATA(ld_im_flag_test) | = 'X'. | |||
| DATA(ld_im_validfrom) | = '00000000'. | |||
| DATA(ld_im_validto) | = '00000000'. | |||
Search for further information about these or an SAP related objects