SAP RH_RES_MAT_REFDOC_CREATE Function Module for









RH_RES_MAT_REFDOC_CREATE is a standard rh res mat refdoc create SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 res mat refdoc create FM, simply by entering the name RH_RES_MAT_REFDOC_CREATE into the relevant SAP transaction such as SE37 or SE38.

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



Function RH_RES_MAT_REFDOC_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_RES_MAT_REFDOC_CREATE'"
EXPORTING
EVENT = "
* MAT_RESHDR = "
* MAT_REQHDR = "
* STATUS = '1' "

IMPORTING
REFDOCNO_RES = "
REFDOCNO_REQ = "

TABLES
* MAT_RESPOS = "
* MAT_REQPOS = "

EXCEPTIONS
EVENT_IS_INITIAL = 1 NO_MATERIAL_TO_PROCESS = 2 REF_NUMBER_ERROR = 3 REFDOC_ERROR = 4
.



IMPORTING Parameters details for RH_RES_MAT_REFDOC_CREATE

EVENT -

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

MAT_RESHDR -

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

MAT_REQHDR -

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

STATUS -

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

EXPORTING Parameters details for RH_RES_MAT_REFDOC_CREATE

REFDOCNO_RES -

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

REFDOCNO_REQ -

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

TABLES Parameters details for RH_RES_MAT_REFDOC_CREATE

MAT_RESPOS -

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

MAT_REQPOS -

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

EXCEPTIONS details

EVENT_IS_INITIAL -

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

NO_MATERIAL_TO_PROCESS -

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

REF_NUMBER_ERROR -

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

REFDOC_ERROR -

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

Copy and paste ABAP code example for RH_RES_MAT_REFDOC_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_event  TYPE HROBJECT, "   
lt_mat_respos  TYPE STANDARD TABLE OF HRCA_MAT_RESPOS, "   
lv_refdocno_res  TYPE T77REFDOC-REFDOCNO, "   
lv_event_is_initial  TYPE T77REFDOC, "   
lt_mat_reqpos  TYPE STANDARD TABLE OF HRCA_MAT_REQPOS, "   
lv_mat_reshdr  TYPE HRCA_MAT_RESV, "   
lv_refdocno_req  TYPE T77REFDOC-REFDOCNO, "   
lv_no_material_to_process  TYPE T77REFDOC, "   
lv_mat_reqhdr  TYPE HRCA_MAT_REQ, "   
lv_ref_number_error  TYPE HRCA_MAT_REQ, "   
lv_status  TYPE T77REFDOC-STATUS, "   '1'
lv_refdoc_error  TYPE T77REFDOC. "   

  CALL FUNCTION 'RH_RES_MAT_REFDOC_CREATE'  "
    EXPORTING
         EVENT = lv_event
         MAT_RESHDR = lv_mat_reshdr
         MAT_REQHDR = lv_mat_reqhdr
         STATUS = lv_status
    IMPORTING
         REFDOCNO_RES = lv_refdocno_res
         REFDOCNO_REQ = lv_refdocno_req
    TABLES
         MAT_RESPOS = lt_mat_respos
         MAT_REQPOS = lt_mat_reqpos
    EXCEPTIONS
        EVENT_IS_INITIAL = 1
        NO_MATERIAL_TO_PROCESS = 2
        REF_NUMBER_ERROR = 3
        REFDOC_ERROR = 4
. " RH_RES_MAT_REFDOC_CREATE




ABAP code using 7.40 inline data declarations to call FM RH_RES_MAT_REFDOC_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 REFDOCNO FROM T77REFDOC INTO @DATA(ld_refdocno_res).
 
 
 
 
"SELECT single REFDOCNO FROM T77REFDOC INTO @DATA(ld_refdocno_req).
 
 
 
 
"SELECT single STATUS FROM T77REFDOC INTO @DATA(ld_status).
DATA(ld_status) = '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!