SAP Function Modules

HR_HEADER_GET SAP Function module







HR_HEADER_GET is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name HR_HEADER_GET into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: HRPAD00DYNPROHEADER
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM HR_HEADER_GET - HR HEADER GET





CALL FUNCTION 'HR_HEADER_GET' "
* EXPORTING
*   dhdid = '02'                " t588i-dhdid
*   begda = SY-DATUM            " sy-datum
*   tclas = 'A'                 " t588i-tclas
*   molga =                     " t001p-molga
*   p0001 =                     " p0001
*   pernr =                     " p0001-pernr
  IMPORTING
    prog =                      " d020s-prog
    dnum =                      " d020s-dnum
* TABLES
*   it588j =                    " t588j
  EXCEPTIONS
    HEADER_DEACTIVATED = 1      "
    HEADER_UNKNOWN = 2          "
    HEADER_GENERATE_DEACTIVATED = 3  "
    HEADER_GENERATE_FAILED = 4  "
    INTERNAL_ERROR = 5          "
    .  "  HR_HEADER_GET

ABAP code example for Function Module HR_HEADER_GET





The ABAP code below is a full code listing to execute function module HR_HEADER_GET including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
ld_prog  TYPE D020S-PROG ,
ld_dnum  TYPE D020S-DNUM ,
it_it588j  TYPE STANDARD TABLE OF T588J,"TABLES PARAM
wa_it588j  LIKE LINE OF it_it588j .


SELECT single DHDID
FROM T588I
INTO @DATA(ld_dhdid).

DATA(ld_begda) = '20210129'.

SELECT single TCLAS
FROM T588I
INTO @DATA(ld_tclas).


SELECT single MOLGA
FROM T001P
INTO @DATA(ld_molga).

DATA(ld_p0001) = '20210129'.

DATA(ld_pernr) = Check type of data required

"populate fields of struture and append to itab
append wa_it588j to it_it588j. . CALL FUNCTION 'HR_HEADER_GET' * EXPORTING * dhdid = ld_dhdid * begda = ld_begda * tclas = ld_tclas * molga = ld_molga * p0001 = ld_p0001 * pernr = ld_pernr IMPORTING prog = ld_prog dnum = ld_dnum * TABLES * it588j = it_it588j EXCEPTIONS HEADER_DEACTIVATED = 1 HEADER_UNKNOWN = 2 HEADER_GENERATE_DEACTIVATED = 3 HEADER_GENERATE_FAILED = 4 INTERNAL_ERROR = 5 . " HR_HEADER_GET
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_prog  TYPE D020S-PROG ,
ld_dhdid  TYPE T588I-DHDID ,
it_it588j  TYPE STANDARD TABLE OF T588J ,
wa_it588j  LIKE LINE OF it_it588j,
ld_dnum  TYPE D020S-DNUM ,
ld_begda  TYPE SY-DATUM ,
ld_tclas  TYPE T588I-TCLAS ,
ld_molga  TYPE T001P-MOLGA ,
ld_p0001  TYPE P0001 ,
ld_pernr  TYPE P0001-PERNR .


SELECT single DHDID
FROM T588I
INTO ld_dhdid.


"populate fields of struture and append to itab
append wa_it588j to it_it588j.
ld_begda = '20210129'.

SELECT single TCLAS
FROM T588I
INTO ld_tclas.


SELECT single MOLGA
FROM T001P
INTO ld_molga.

ld_p0001 = '20210129'.

ld_pernr = Check type of data required

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name HR_HEADER_GET or its description.