SAP Function Modules

HRGPBS_ABS_INFOTYPES_HIST_ADD SAP Function module - Create Cover History For Absences (being passed ALL infotypes)







HRGPBS_ABS_INFOTYPES_HIST_ADD 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 HRGPBS_ABS_INFOTYPES_HIST_ADD into the relevant SAP transaction such as SE37 or SE80.

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


Pattern for FM HRGPBS_ABS_INFOTYPES_HIST_ADD - HRGPBS ABS INFOTYPES HIST ADD





CALL FUNCTION 'HRGPBS_ABS_INFOTYPES_HIST_ADD' "Create Cover History For Absences (being passed ALL infotypes)
  EXPORTING
    p_pernr =                   " pernr-pernr   Personnel number
    p_begda =                   " sy-datum      Start date
    p_endda =                   " sy-datum      End date
*   p_abs_no =                  " p08p1_abs_submark-cdseq  Single-character flag
  TABLES
    p_p0000 =                   " p0000         HR Master Record: Infotype 0000 (Actions)
    p_p0001 =                   " p0001         HR Master Record: Infotype 0001 (Org. Assignment)
    p_p0002 =                   " p0002         HR Master Record: Infotype 0002 (Personal Data)
    p_p0004 =                   " p0004         HR Master Record: Infotype 0004 (Challenge)
    p_p0007 =                   " p0007         HR Master Record: Infotype 0007 (Planned Working Time)
    p_p0008 =                   " p0008         HR Master Record: Infotype 0008 (Basic Pay)
    p_p0016 =                   " p0016         HR Master Record: Infotype 0016 (Contract Elements)
    p_p0041 =                   " p0041         HR Master Record: Infotype 0041 (Date Specifications)
    p_p2001 =                   " p2001         HR Time Record: Infotype 2001 (Absences)
    p_error =                   " edimessage
    .  "  HRGPBS_ABS_INFOTYPES_HIST_ADD

ABAP code example for Function Module HRGPBS_ABS_INFOTYPES_HIST_ADD





The ABAP code below is a full code listing to execute function module HRGPBS_ABS_INFOTYPES_HIST_ADD 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:
it_p_p0000  TYPE STANDARD TABLE OF P0000,"TABLES PARAM
wa_p_p0000  LIKE LINE OF it_p_p0000 ,
it_p_p0001  TYPE STANDARD TABLE OF P0001,"TABLES PARAM
wa_p_p0001  LIKE LINE OF it_p_p0001 ,
it_p_p0002  TYPE STANDARD TABLE OF P0002,"TABLES PARAM
wa_p_p0002  LIKE LINE OF it_p_p0002 ,
it_p_p0004  TYPE STANDARD TABLE OF P0004,"TABLES PARAM
wa_p_p0004  LIKE LINE OF it_p_p0004 ,
it_p_p0007  TYPE STANDARD TABLE OF P0007,"TABLES PARAM
wa_p_p0007  LIKE LINE OF it_p_p0007 ,
it_p_p0008  TYPE STANDARD TABLE OF P0008,"TABLES PARAM
wa_p_p0008  LIKE LINE OF it_p_p0008 ,
it_p_p0016  TYPE STANDARD TABLE OF P0016,"TABLES PARAM
wa_p_p0016  LIKE LINE OF it_p_p0016 ,
it_p_p0041  TYPE STANDARD TABLE OF P0041,"TABLES PARAM
wa_p_p0041  LIKE LINE OF it_p_p0041 ,
it_p_p2001  TYPE STANDARD TABLE OF P2001,"TABLES PARAM
wa_p_p2001  LIKE LINE OF it_p_p2001 ,
it_p_error  TYPE STANDARD TABLE OF EDIMESSAGE,"TABLES PARAM
wa_p_error  LIKE LINE OF it_p_error .


DATA(ld_p_pernr) = Check type of data required
DATA(ld_p_begda) = '20210129'.
DATA(ld_p_endda) = '20210129'.

DATA(ld_p_abs_no) = some text here

"populate fields of struture and append to itab
append wa_p_p0000 to it_p_p0000.

"populate fields of struture and append to itab
append wa_p_p0001 to it_p_p0001.

"populate fields of struture and append to itab
append wa_p_p0002 to it_p_p0002.

"populate fields of struture and append to itab
append wa_p_p0004 to it_p_p0004.

"populate fields of struture and append to itab
append wa_p_p0007 to it_p_p0007.

"populate fields of struture and append to itab
append wa_p_p0008 to it_p_p0008.

"populate fields of struture and append to itab
append wa_p_p0016 to it_p_p0016.

"populate fields of struture and append to itab
append wa_p_p0041 to it_p_p0041.

"populate fields of struture and append to itab
append wa_p_p2001 to it_p_p2001.

"populate fields of struture and append to itab
append wa_p_error to it_p_error. . CALL FUNCTION 'HRGPBS_ABS_INFOTYPES_HIST_ADD' EXPORTING p_pernr = ld_p_pernr p_begda = ld_p_begda p_endda = ld_p_endda * p_abs_no = ld_p_abs_no TABLES p_p0000 = it_p_p0000 p_p0001 = it_p_p0001 p_p0002 = it_p_p0002 p_p0004 = it_p_p0004 p_p0007 = it_p_p0007 p_p0008 = it_p_p0008 p_p0016 = it_p_p0016 p_p0041 = it_p_p0041 p_p2001 = it_p_p2001 p_error = it_p_error . " HRGPBS_ABS_INFOTYPES_HIST_ADD
IF SY-SUBRC EQ 0. "All OK 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_p_pernr  TYPE PERNR-PERNR ,
it_p_p0000  TYPE STANDARD TABLE OF P0000 ,
wa_p_p0000  LIKE LINE OF it_p_p0000,
ld_p_begda  TYPE SY-DATUM ,
it_p_p0001  TYPE STANDARD TABLE OF P0001 ,
wa_p_p0001  LIKE LINE OF it_p_p0001,
ld_p_endda  TYPE SY-DATUM ,
it_p_p0002  TYPE STANDARD TABLE OF P0002 ,
wa_p_p0002  LIKE LINE OF it_p_p0002,
ld_p_abs_no  TYPE P08P1_ABS_SUBMARK-CDSEQ ,
it_p_p0004  TYPE STANDARD TABLE OF P0004 ,
wa_p_p0004  LIKE LINE OF it_p_p0004,
it_p_p0007  TYPE STANDARD TABLE OF P0007 ,
wa_p_p0007  LIKE LINE OF it_p_p0007,
it_p_p0008  TYPE STANDARD TABLE OF P0008 ,
wa_p_p0008  LIKE LINE OF it_p_p0008,
it_p_p0016  TYPE STANDARD TABLE OF P0016 ,
wa_p_p0016  LIKE LINE OF it_p_p0016,
it_p_p0041  TYPE STANDARD TABLE OF P0041 ,
wa_p_p0041  LIKE LINE OF it_p_p0041,
it_p_p2001  TYPE STANDARD TABLE OF P2001 ,
wa_p_p2001  LIKE LINE OF it_p_p2001,
it_p_error  TYPE STANDARD TABLE OF EDIMESSAGE ,
wa_p_error  LIKE LINE OF it_p_error.


ld_p_pernr = Check type of data required

"populate fields of struture and append to itab
append wa_p_p0000 to it_p_p0000.
ld_p_begda = '20210129'.

"populate fields of struture and append to itab
append wa_p_p0001 to it_p_p0001.
ld_p_endda = '20210129'.

"populate fields of struture and append to itab
append wa_p_p0002 to it_p_p0002.

ld_p_abs_no = some text here

"populate fields of struture and append to itab
append wa_p_p0004 to it_p_p0004.

"populate fields of struture and append to itab
append wa_p_p0007 to it_p_p0007.

"populate fields of struture and append to itab
append wa_p_p0008 to it_p_p0008.

"populate fields of struture and append to itab
append wa_p_p0016 to it_p_p0016.

"populate fields of struture and append to itab
append wa_p_p0041 to it_p_p0041.

"populate fields of struture and append to itab
append wa_p_p2001 to it_p_p2001.

"populate fields of struture and append to itab
append wa_p_error to it_p_error.

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 HRGPBS_ABS_INFOTYPES_HIST_ADD or its description.