SAP RHCT_OBJECT_COPY Function Module for Copy Object









RHCT_OBJECT_COPY is a standard rhct object 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 Object 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 rhct object copy FM, simply by entering the name RHCT_OBJECT_COPY into the relevant SAP transaction such as SE37 or SE38.

Function Group: RHCT
Program Name: SAPLRHCT
Main Program: SAPLRHCT
Appliation area: H
Release date: 17-Feb-1995
Mode(Normal, Remote etc): Normal Function Module
Update:



Function RHCT_OBJECT_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 'RHCT_OBJECT_COPY'"Copy Object
EXPORTING
SEL_OBJECT = "Reference Object (Object Type/ID)
PAR_OBJECT = "Parent of the Reference Object (Object Type/ID)
* CAT_PLVAR = "Plan Version
CAT_TYPE = "Catalog Type from Table T77OC
* PAR_ID = "Node ID of the Parent Object

IMPORTING
NEW_OBJECT = "New Object (Object Type / Object ID)
BEG_DATE = "Validity Start Date of New Object
END_DATE = "Validity End Date of New Object

EXCEPTIONS
NONE_ALLOWED = 1 COPY_FAILED = 2 CANCELED = 3 NOT_AVAILABLE = 4
.



IMPORTING Parameters details for RHCT_OBJECT_COPY

SEL_OBJECT - Reference Object (Object Type/ID)

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

PAR_OBJECT - Parent of the Reference Object (Object Type/ID)

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

CAT_PLVAR - Plan Version

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

CAT_TYPE - Catalog Type from Table T77OC

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

PAR_ID - Node ID of the Parent Object

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

EXPORTING Parameters details for RHCT_OBJECT_COPY

NEW_OBJECT - New Object (Object Type / Object ID)

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

BEG_DATE - Validity Start Date of New Object

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

END_DATE - Validity End Date of New Object

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

EXCEPTIONS details

NONE_ALLOWED - No Valid Relationship Could be Found

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

COPY_FAILED - Error When Copying

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

CANCELED - Action was canceled

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

NOT_AVAILABLE - Function Does Not Exist

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

Copy and paste ABAP code example for RHCT_OBJECT_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_new_object  TYPE HRHCTEXTD, "   
lv_sel_object  TYPE HRHCTOBJC, "   
lv_none_allowed  TYPE HRHCTOBJC, "   
lv_beg_date  TYPE OBJEC-BEGDA, "   
lv_par_object  TYPE HRHCTOBJC, "   
lv_copy_failed  TYPE HRHCTOBJC, "   
lv_canceled  TYPE HRHCTOBJC, "   
lv_end_date  TYPE OBJEC-ENDDA, "   
lv_cat_plvar  TYPE OBJEC-PLVAR, "   
lv_cat_type  TYPE T77OC-CATTP, "   
lv_not_available  TYPE T77OC, "   
lv_par_id  TYPE SNODE-ID. "   

  CALL FUNCTION 'RHCT_OBJECT_COPY'  "Copy Object
    EXPORTING
         SEL_OBJECT = lv_sel_object
         PAR_OBJECT = lv_par_object
         CAT_PLVAR = lv_cat_plvar
         CAT_TYPE = lv_cat_type
         PAR_ID = lv_par_id
    IMPORTING
         NEW_OBJECT = lv_new_object
         BEG_DATE = lv_beg_date
         END_DATE = lv_end_date
    EXCEPTIONS
        NONE_ALLOWED = 1
        COPY_FAILED = 2
        CANCELED = 3
        NOT_AVAILABLE = 4
. " RHCT_OBJECT_COPY




ABAP code using 7.40 inline data declarations to call FM RHCT_OBJECT_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.

 
 
 
"SELECT single BEGDA FROM OBJEC INTO @DATA(ld_beg_date).
 
 
 
 
"SELECT single ENDDA FROM OBJEC INTO @DATA(ld_end_date).
 
"SELECT single PLVAR FROM OBJEC INTO @DATA(ld_cat_plvar).
 
"SELECT single CATTP FROM T77OC INTO @DATA(ld_cat_type).
 
 
"SELECT single ID FROM SNODE INTO @DATA(ld_par_id).
 


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!