SAP RH_OBJECT_CREATE Function Module for Create Object









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

Function Group: RHP0
Program Name: SAPLRHP0
Main Program: SAPLRHP0
Appliation area: H
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function RH_OBJECT_CREATE 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 'RH_OBJECT_CREATE'"Create Object
EXPORTING
* LANGU = SY-LANGU "Language
* VTASK = 'D' "Update (B=Buffer,D=Online,V=Update,S=Sync)
* GUID = "
* KEEP_LUPD = ' ' "
PLVAR = "Plan Version
OTYPE = "Object type
* EXT_NUMBER = '00000000' "
* SHORT = ' ' "
STEXT = "
* BEGDA = SY-DATUM "Validity start date
* ENDDA = '99991231' "Valid To Date
* OSTAT = '1' "Status

IMPORTING
OBJID = "Object ID

EXCEPTIONS
TEXT_REQUIRED = 1 INVALID_OTYPE = 2 INVALID_DATE = 3 ERROR_DURING_INSERT = 4 ERROR_EXT_NUMBER = 5 UNDEFINED = 6
.



IMPORTING Parameters details for RH_OBJECT_CREATE

LANGU - Language

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

VTASK - Update (B=Buffer,D=Online,V=Update,S=Sync)

Data type: HRRHAP-VTASK
Default: 'D'
Optional: Yes
Call by Reference: No ( called with pass by value option)

GUID -

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

KEEP_LUPD -

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

PLVAR - Plan Version

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

OTYPE - Object type

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

EXT_NUMBER -

Data type: HRP1000-OBJID
Default: '00000000'
Optional: Yes
Call by Reference: No ( called with pass by value option)

SHORT -

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

STEXT -

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

BEGDA - Validity start date

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

ENDDA - Valid To Date

Data type: HRP1000-ENDDA
Default: '99991231'
Optional: Yes
Call by Reference: No ( called with pass by value option)

OSTAT - Status

Data type: HRP1000-ISTAT
Default: '1'
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for RH_OBJECT_CREATE

OBJID - Object ID

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

EXCEPTIONS details

TEXT_REQUIRED -

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

INVALID_OTYPE -

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

INVALID_DATE -

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

ERROR_DURING_INSERT - Error during Insert

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

ERROR_EXT_NUMBER -

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

UNDEFINED - Other Error

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

Copy and paste ABAP code example for RH_OBJECT_CREATE 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_langu  TYPE SY-LANGU, "   SY-LANGU
lv_objid  TYPE HRP1000-OBJID, "   
lv_text_required  TYPE HRP1000, "   
lv_vtask  TYPE HRRHAP-VTASK, "   'D'
lv_guid  TYPE HRGUID, "   
lv_keep_lupd  TYPE CHAR1, "   ' '
lv_plvar  TYPE HRP1000-PLVAR, "   
lv_invalid_otype  TYPE HRP1000, "   
lv_otype  TYPE HRP1000-OTYPE, "   
lv_invalid_date  TYPE HRP1000, "   
lv_ext_number  TYPE HRP1000-OBJID, "   '00000000'
lv_error_during_insert  TYPE HRP1000, "   
lv_short  TYPE HRP1000-SHORT, "   ' '
lv_error_ext_number  TYPE HRP1000, "   
lv_stext  TYPE HRP1000-STEXT, "   
lv_undefined  TYPE HRP1000, "   
lv_begda  TYPE HRP1000-BEGDA, "   SY-DATUM
lv_endda  TYPE HRP1000-ENDDA, "   '99991231'
lv_ostat  TYPE HRP1000-ISTAT. "   '1'

  CALL FUNCTION 'RH_OBJECT_CREATE'  "Create Object
    EXPORTING
         LANGU = lv_langu
         VTASK = lv_vtask
         GUID = lv_guid
         KEEP_LUPD = lv_keep_lupd
         PLVAR = lv_plvar
         OTYPE = lv_otype
         EXT_NUMBER = lv_ext_number
         SHORT = lv_short
         STEXT = lv_stext
         BEGDA = lv_begda
         ENDDA = lv_endda
         OSTAT = lv_ostat
    IMPORTING
         OBJID = lv_objid
    EXCEPTIONS
        TEXT_REQUIRED = 1
        INVALID_OTYPE = 2
        INVALID_DATE = 3
        ERROR_DURING_INSERT = 4
        ERROR_EXT_NUMBER = 5
        UNDEFINED = 6
. " RH_OBJECT_CREATE




ABAP code using 7.40 inline data declarations to call FM RH_OBJECT_CREATE

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_langu).
DATA(ld_langu) = SY-LANGU.
 
"SELECT single OBJID FROM HRP1000 INTO @DATA(ld_objid).
 
 
"SELECT single VTASK FROM HRRHAP INTO @DATA(ld_vtask).
DATA(ld_vtask) = 'D'.
 
 
DATA(ld_keep_lupd) = ' '.
 
"SELECT single PLVAR FROM HRP1000 INTO @DATA(ld_plvar).
 
 
"SELECT single OTYPE FROM HRP1000 INTO @DATA(ld_otype).
 
 
"SELECT single OBJID FROM HRP1000 INTO @DATA(ld_ext_number).
DATA(ld_ext_number) = '00000000'.
 
 
"SELECT single SHORT FROM HRP1000 INTO @DATA(ld_short).
DATA(ld_short) = ' '.
 
 
"SELECT single STEXT FROM HRP1000 INTO @DATA(ld_stext).
 
 
"SELECT single BEGDA FROM HRP1000 INTO @DATA(ld_begda).
DATA(ld_begda) = SY-DATUM.
 
"SELECT single ENDDA FROM HRP1000 INTO @DATA(ld_endda).
DATA(ld_endda) = '99991231'.
 
"SELECT single ISTAT FROM HRP1000 INTO @DATA(ld_ostat).
DATA(ld_ostat) = '1'.
 


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!