SAP Function Modules

PT_IAC_LEAVREQ_INITIALIZE SAP Function module







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

Associated Function Group: PT_IAC_LEAVEREQUEST
Released Date: Not Released
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM PT_IAC_LEAVREQ_INITIALIZE - PT IAC LEAVREQ INITIALIZE





CALL FUNCTION 'PT_IAC_LEAVREQ_INITIALIZE' "
  EXPORTING
    webapp_debug_id = '00013'   " t77s0-semid
    local_date = SY-DATLO       " sy-datlo
    user_id = SY-UNAME          " p0105-usrid
    web_flag = 'X'              " char1
*   no_date_separators = 'X'    " xfeld
  IMPORTING
    proc_state =                " sy-subrc
    wi_id =                     " swwwihead-wi_id
    pernr =                     " p0001-pernr
    employeename =              " emnam
    switch_hrsif =              " char1
    today =                     " char10
    tomorrow =                  " char10
    date_format =               " dd07l-domvalue_l
* TABLES
*   message_list =              " bapiret2
  EXCEPTIONS
    PERNR_NOT_FOUND = 1         "
    IT0001_NOT_FOUND = 2        "
    IT0007_NOT_FOUND = 3        "
    UNKNOWN_ERROR = 4           "
    .  "  PT_IAC_LEAVREQ_INITIALIZE

ABAP code example for Function Module PT_IAC_LEAVREQ_INITIALIZE





The ABAP code below is a full code listing to execute function module PT_IAC_LEAVREQ_INITIALIZE 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_proc_state  TYPE SY-SUBRC ,
ld_wi_id  TYPE SWWWIHEAD-WI_ID ,
ld_pernr  TYPE P0001-PERNR ,
ld_employeename  TYPE EMNAM ,
ld_switch_hrsif  TYPE CHAR1 ,
ld_today  TYPE CHAR10 ,
ld_tomorrow  TYPE CHAR10 ,
ld_date_format  TYPE DD07L-DOMVALUE_L ,
it_message_list  TYPE STANDARD TABLE OF BAPIRET2,"TABLES PARAM
wa_message_list  LIKE LINE OF it_message_list .


SELECT single SEMID
FROM T77S0
INTO @DATA(ld_webapp_debug_id).

DATA(ld_local_date) = '20210129'.

DATA(ld_user_id) = some text here
DATA(ld_web_flag) = '20210129'.
DATA(ld_no_date_separators) = '20210129'.

"populate fields of struture and append to itab
append wa_message_list to it_message_list. . CALL FUNCTION 'PT_IAC_LEAVREQ_INITIALIZE' EXPORTING webapp_debug_id = ld_webapp_debug_id local_date = ld_local_date user_id = ld_user_id web_flag = ld_web_flag * no_date_separators = ld_no_date_separators IMPORTING proc_state = ld_proc_state wi_id = ld_wi_id pernr = ld_pernr employeename = ld_employeename switch_hrsif = ld_switch_hrsif today = ld_today tomorrow = ld_tomorrow date_format = ld_date_format * TABLES * message_list = it_message_list EXCEPTIONS PERNR_NOT_FOUND = 1 IT0001_NOT_FOUND = 2 IT0007_NOT_FOUND = 3 UNKNOWN_ERROR = 4 . " PT_IAC_LEAVREQ_INITIALIZE
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 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_proc_state  TYPE SY-SUBRC ,
ld_webapp_debug_id  TYPE T77S0-SEMID ,
it_message_list  TYPE STANDARD TABLE OF BAPIRET2 ,
wa_message_list  LIKE LINE OF it_message_list,
ld_wi_id  TYPE SWWWIHEAD-WI_ID ,
ld_local_date  TYPE SY-DATLO ,
ld_pernr  TYPE P0001-PERNR ,
ld_user_id  TYPE P0105-USRID ,
ld_employeename  TYPE EMNAM ,
ld_web_flag  TYPE CHAR1 ,
ld_switch_hrsif  TYPE CHAR1 ,
ld_no_date_separators  TYPE XFELD ,
ld_today  TYPE CHAR10 ,
ld_tomorrow  TYPE CHAR10 ,
ld_date_format  TYPE DD07L-DOMVALUE_L .


SELECT single SEMID
FROM T77S0
INTO ld_webapp_debug_id.


"populate fields of struture and append to itab
append wa_message_list to it_message_list.
ld_local_date = '20210129'.

ld_user_id = some text here
ld_web_flag = '20210129'.
ld_no_date_separators = '20210129'.

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