SAP CALCULATE_LENGTH_TO_TRANSFER Function Module for Determine length of the CAD transfer string with tables TCIM and TCID
CALCULATE_LENGTH_TO_TRANSFER is a standard calculate length to transfer SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Determine length of the CAD transfer string with tables TCIM and TCID 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 calculate length to transfer FM, simply by entering the name CALCULATE_LENGTH_TO_TRANSFER into the relevant SAP transaction such as SE37 or SE38.
Function Group: CCAD
Program Name: SAPLCCAD
Main Program: SAPLCCAD
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CALCULATE_LENGTH_TO_TRANSFER 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 'CALCULATE_LENGTH_TO_TRANSFER'"Determine length of the CAD transfer string with tables TCIM and TCID.
EXPORTING
CADSY = "CAD system identifier
PCODE = "Process code
STRLN = "Length of output string according to table TCID
UCODE = "Subprocess Code
IMPORTING
ERROR = "Error flag
MESSG = "Error message
MSGLN = "Length of error message
SETNM = "Set ID from the table TCIM
IMPORTING Parameters details for CALCULATE_LENGTH_TO_TRANSFER
CADSY - CAD system identifier
Data type: TCIM-CADSYOptional: No
Call by Reference: No ( called with pass by value option)
PCODE - Process code
Data type: TCIM-PCODEOptional: No
Call by Reference: No ( called with pass by value option)
STRLN - Length of output string according to table TCID
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
UCODE - Subprocess Code
Data type: TCIM-UCODEOptional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for CALCULATE_LENGTH_TO_TRANSFER
ERROR - Error flag
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
MESSG - Error message
Data type: MESSAGEOptional: No
Call by Reference: No ( called with pass by value option)
MSGLN - Length of error message
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SETNM - Set ID from the table TCIM
Data type: TCIM-SETNMOptional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for CALCULATE_LENGTH_TO_TRANSFER 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_cadsy | TYPE TCIM-CADSY, " | |||
| lv_error | TYPE TCIM, " | |||
| lv_messg | TYPE MESSAGE, " | |||
| lv_pcode | TYPE TCIM-PCODE, " | |||
| lv_msgln | TYPE TCIM, " | |||
| lv_strln | TYPE TCIM, " | |||
| lv_setnm | TYPE TCIM-SETNM, " | |||
| lv_ucode | TYPE TCIM-UCODE. " |
|   CALL FUNCTION 'CALCULATE_LENGTH_TO_TRANSFER' "Determine length of the CAD transfer string with tables TCIM and TCID |
| EXPORTING | ||
| CADSY | = lv_cadsy | |
| PCODE | = lv_pcode | |
| STRLN | = lv_strln | |
| UCODE | = lv_ucode | |
| IMPORTING | ||
| ERROR | = lv_error | |
| MESSG | = lv_messg | |
| MSGLN | = lv_msgln | |
| SETNM | = lv_setnm | |
| . " CALCULATE_LENGTH_TO_TRANSFER | ||
ABAP code using 7.40 inline data declarations to call FM CALCULATE_LENGTH_TO_TRANSFER
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 CADSY FROM TCIM INTO @DATA(ld_cadsy). | ||||
| "SELECT single PCODE FROM TCIM INTO @DATA(ld_pcode). | ||||
| "SELECT single SETNM FROM TCIM INTO @DATA(ld_setnm). | ||||
| "SELECT single UCODE FROM TCIM INTO @DATA(ld_ucode). | ||||
Search for further information about these or an SAP related objects