SAP SCT1_COMPARE_DATA Function Module for Compare data boxes









SCT1_COMPARE_DATA is a standard sct1 compare data SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Compare data boxes 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 sct1 compare data FM, simply by entering the name SCT1_COMPARE_DATA into the relevant SAP transaction such as SE37 or SE38.

Function Group: SCT1
Program Name: SAPLSCT1
Main Program: SAPLSCT1
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function SCT1_COMPARE_DATA 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 'SCT1_COMPARE_DATA'"Compare data boxes
EXPORTING
* IV_LANGU_REMOTE = SY-LANGU "
* IV_BCSET_OFFSET = 0 "
* IV_RFC_DEST = "
* IV_CONTAINS_ADDRESS = ' ' "

CHANGING
CS_CMP_RESULT = "

TABLES
IT_BOX_LOCAL = "
ET_VIEW_KEYS_CMP = "
IT_BOX_REMOTE = "
IT_NAMTAB_INDEX = "
IT_NAMTAB_LOCAL = "
IT_NAMTAB_REMOTE = "
IT_HEADER_LOCAL = "
IT_HEADER_REMOTE = "
* IT_TEMPLATE_ATTR = "
IT_ADDRESS = "

EXCEPTIONS
KEYS_MUST_BE_COMPARED = 1
.



IMPORTING Parameters details for SCT1_COMPARE_DATA

IV_LANGU_REMOTE -

Data type: SY-LANGU
Default: SY-LANGU
Optional: Yes
Call by Reference: No ( called with pass by value option)

IV_BCSET_OFFSET -

Data type: I
Optional: Yes
Call by Reference: No ( called with pass by value option)

IV_RFC_DEST -

Data type: CMPWLH-RFCDEST
Optional: Yes
Call by Reference: No ( called with pass by value option)

IV_CONTAINS_ADDRESS -

Data type: C
Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)

CHANGING Parameters details for SCT1_COMPARE_DATA

CS_CMP_RESULT -

Data type: CMPWL_S_CMPWL_TYPE
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for SCT1_COMPARE_DATA

IT_BOX_LOCAL -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

ET_VIEW_KEYS_CMP -

Data type: VIEW_CMP
Optional: No
Call by Reference: No ( called with pass by value option)

IT_BOX_REMOTE -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

IT_NAMTAB_INDEX -

Data type: NTAB_IDX
Optional: No
Call by Reference: No ( called with pass by value option)

IT_NAMTAB_LOCAL -

Data type: NTAB_CMP
Optional: No
Call by Reference: No ( called with pass by value option)

IT_NAMTAB_REMOTE -

Data type: NTAB_CMP
Optional: No
Call by Reference: No ( called with pass by value option)

IT_HEADER_LOCAL -

Data type: NTAB_HDR
Optional: No
Call by Reference: No ( called with pass by value option)

IT_HEADER_REMOTE -

Data type: NTAB_HDR
Optional: No
Call by Reference: No ( called with pass by value option)

IT_TEMPLATE_ATTR -

Data type: SCPRVALS
Optional: Yes
Call by Reference: No ( called with pass by value option)

IT_ADDRESS -

Data type: CMPWL_T_ADDRESS_TYPE
Optional: No
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

KEYS_MUST_BE_COMPARED -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for SCT1_COMPARE_DATA 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:
lt_it_box_local  TYPE STANDARD TABLE OF STRING, "   
lv_cs_cmp_result  TYPE CMPWL_S_CMPWL_TYPE, "   
lv_iv_langu_remote  TYPE SY-LANGU, "   SY-LANGU
lv_keys_must_be_compared  TYPE SY, "   
lt_et_view_keys_cmp  TYPE STANDARD TABLE OF VIEW_CMP, "   
lt_it_box_remote  TYPE STANDARD TABLE OF VIEW_CMP, "   
lv_iv_bcset_offset  TYPE I, "   0
lv_iv_rfc_dest  TYPE CMPWLH-RFCDEST, "   
lt_it_namtab_index  TYPE STANDARD TABLE OF NTAB_IDX, "   
lt_it_namtab_local  TYPE STANDARD TABLE OF NTAB_CMP, "   
lv_iv_contains_address  TYPE C, "   ' '
lt_it_namtab_remote  TYPE STANDARD TABLE OF NTAB_CMP, "   
lt_it_header_local  TYPE STANDARD TABLE OF NTAB_HDR, "   
lt_it_header_remote  TYPE STANDARD TABLE OF NTAB_HDR, "   
lt_it_template_attr  TYPE STANDARD TABLE OF SCPRVALS, "   
lt_it_address  TYPE STANDARD TABLE OF CMPWL_T_ADDRESS_TYPE. "   

  CALL FUNCTION 'SCT1_COMPARE_DATA'  "Compare data boxes
    EXPORTING
         IV_LANGU_REMOTE = lv_iv_langu_remote
         IV_BCSET_OFFSET = lv_iv_bcset_offset
         IV_RFC_DEST = lv_iv_rfc_dest
         IV_CONTAINS_ADDRESS = lv_iv_contains_address
    CHANGING
         CS_CMP_RESULT = lv_cs_cmp_result
    TABLES
         IT_BOX_LOCAL = lt_it_box_local
         ET_VIEW_KEYS_CMP = lt_et_view_keys_cmp
         IT_BOX_REMOTE = lt_it_box_remote
         IT_NAMTAB_INDEX = lt_it_namtab_index
         IT_NAMTAB_LOCAL = lt_it_namtab_local
         IT_NAMTAB_REMOTE = lt_it_namtab_remote
         IT_HEADER_LOCAL = lt_it_header_local
         IT_HEADER_REMOTE = lt_it_header_remote
         IT_TEMPLATE_ATTR = lt_it_template_attr
         IT_ADDRESS = lt_it_address
    EXCEPTIONS
        KEYS_MUST_BE_COMPARED = 1
. " SCT1_COMPARE_DATA




ABAP code using 7.40 inline data declarations to call FM SCT1_COMPARE_DATA

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 LANGU FROM SY INTO @DATA(ld_iv_langu_remote).
DATA(ld_iv_langu_remote) = SY-LANGU.
 
 
 
 
 
"SELECT single RFCDEST FROM CMPWLH INTO @DATA(ld_iv_rfc_dest).
 
 
 
DATA(ld_iv_contains_address) = ' '.
 
 
 
 
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!