SAP RH_EVENTTYPECOSTS_GET Function Module for Determine cost items of business event types









RH_EVENTTYPECOSTS_GET is a standard rh eventtypecosts get 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 cost items of business event types 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 eventtypecosts get FM, simply by entering the name RH_EVENTTYPECOSTS_GET into the relevant SAP transaction such as SE37 or SE38.

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



Function RH_EVENTTYPECOSTS_GET 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_EVENTTYPECOSTS_GET'"Determine cost items of business event types
EXPORTING
* IN_DATE = SY-DATUM "Key date
* IN_COSTSSTATUS = '1' "Status of infotype 1036
* IN_COSTSSUBTYPE = '0001' "Subtype for reading infotype P1036
* IN_SCHEDULESUBTYPE = '0001' "Schedule model
* IN_CURRENCY = "Space = Orginal currency
* IN_CREATEMODUS_C = ' ' "'Create business event type'
* IN_C_CAPACITY = "Capacity
* IN_C_DAYS = "Duration in days
* IN_C_SECONDS = "Duration in seconds

TABLES
IN_EVENTTYPES = "Object list
* IN_C_D1036 = "Cost items of business event type
* IN_C_D022R = "Resource types required
* OUT_COSTELEMENTS = "Cost items
* OUT_INFO = "Additional info: capacity, total costs

EXCEPTIONS
NOTHING_FOUND = 1 UNKNOWN_ERROR = 2
.



IMPORTING Parameters details for RH_EVENTTYPECOSTS_GET

IN_DATE - Key date

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

IN_COSTSSTATUS - Status of infotype 1036

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

IN_COSTSSUBTYPE - Subtype for reading infotype P1036

Data type: P1036-SUBTY
Default: '0001'
Optional: Yes
Call by Reference: No ( called with pass by value option)

IN_SCHEDULESUBTYPE - Schedule model

Data type: HRV1042A-SUBTY
Default: '0001'
Optional: Yes
Call by Reference: No ( called with pass by value option)

IN_CURRENCY - Space = Orginal currency

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

IN_CREATEMODUS_C - 'Create business event type'

Data type: HRVCOST-FLAG_X
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

IN_C_CAPACITY - Capacity

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

IN_C_DAYS - Duration in days

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

IN_C_SECONDS - Duration in seconds

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

TABLES Parameters details for RH_EVENTTYPECOSTS_GET

IN_EVENTTYPES - Object list

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

IN_C_D1036 - Cost items of business event type

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

IN_C_D022R - Resource types required

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

OUT_COSTELEMENTS - Cost items

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

OUT_INFO - Additional info: capacity, total costs

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

EXCEPTIONS details

NOTHING_FOUND - No cost items exist

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

UNKNOWN_ERROR - Unknown error has occurred

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

Copy and paste ABAP code example for RH_EVENTTYPECOSTS_GET 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_in_date  TYPE SY-DATUM, "   SY-DATUM
lt_in_eventtypes  TYPE STANDARD TABLE OF HROBJECT, "   
lv_nothing_found  TYPE HROBJECT, "   
lt_in_c_d1036  TYPE STANDARD TABLE OF P1036, "   
lv_unknown_error  TYPE P1036, "   
lv_in_costsstatus  TYPE P1036-ISTAT, "   '1'
lt_in_c_d022r  TYPE STANDARD TABLE OF P1001, "   
lv_in_costssubtype  TYPE P1036-SUBTY, "   '0001'
lt_out_costelements  TYPE STANDARD TABLE OF RHKB1, "   
lv_in_schedulesubtype  TYPE HRV1042A-SUBTY, "   '0001'
lt_out_info  TYPE STANDARD TABLE OF RHKB2, "   
lv_in_currency  TYPE P1036-WAERS, "   
lv_in_createmodus_c  TYPE HRVCOST-FLAG_X, "   SPACE
lv_in_c_capacity  TYPE HRVEVDAT-KAPZ2, "   
lv_in_c_days  TYPE HRVSCHED-NDAYS, "   
lv_in_c_seconds  TYPE HRVSCHED-NSECO. "   

  CALL FUNCTION 'RH_EVENTTYPECOSTS_GET'  "Determine cost items of business event types
    EXPORTING
         IN_DATE = lv_in_date
         IN_COSTSSTATUS = lv_in_costsstatus
         IN_COSTSSUBTYPE = lv_in_costssubtype
         IN_SCHEDULESUBTYPE = lv_in_schedulesubtype
         IN_CURRENCY = lv_in_currency
         IN_CREATEMODUS_C = lv_in_createmodus_c
         IN_C_CAPACITY = lv_in_c_capacity
         IN_C_DAYS = lv_in_c_days
         IN_C_SECONDS = lv_in_c_seconds
    TABLES
         IN_EVENTTYPES = lt_in_eventtypes
         IN_C_D1036 = lt_in_c_d1036
         IN_C_D022R = lt_in_c_d022r
         OUT_COSTELEMENTS = lt_out_costelements
         OUT_INFO = lt_out_info
    EXCEPTIONS
        NOTHING_FOUND = 1
        UNKNOWN_ERROR = 2
. " RH_EVENTTYPECOSTS_GET




ABAP code using 7.40 inline data declarations to call FM RH_EVENTTYPECOSTS_GET

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 DATUM FROM SY INTO @DATA(ld_in_date).
DATA(ld_in_date) = SY-DATUM.
 
 
 
 
 
"SELECT single ISTAT FROM P1036 INTO @DATA(ld_in_costsstatus).
DATA(ld_in_costsstatus) = '1'.
 
 
"SELECT single SUBTY FROM P1036 INTO @DATA(ld_in_costssubtype).
DATA(ld_in_costssubtype) = '0001'.
 
 
"SELECT single SUBTY FROM HRV1042A INTO @DATA(ld_in_schedulesubtype).
DATA(ld_in_schedulesubtype) = '0001'.
 
 
"SELECT single WAERS FROM P1036 INTO @DATA(ld_in_currency).
 
"SELECT single FLAG_X FROM HRVCOST INTO @DATA(ld_in_createmodus_c).
DATA(ld_in_createmodus_c) = ' '.
 
"SELECT single KAPZ2 FROM HRVEVDAT INTO @DATA(ld_in_c_capacity).
 
"SELECT single NDAYS FROM HRVSCHED INTO @DATA(ld_in_c_days).
 
"SELECT single NSECO FROM HRVSCHED INTO @DATA(ld_in_c_seconds).
 


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!