SAP Function Modules

HR_WRITE_D3 SAP Function module







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

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


Pattern for FM HR_WRITE_D3 - HR WRITE D3





CALL FUNCTION 'HR_WRITE_D3' "
* EXPORTING
*   it_hist =                   " hrd3_t_hist
  TABLES
    dsap =                      " pd3dsap
    dsme =                      " pd3dsme
*   dbme =                      " pd3dbme
*   dbna =                      " pd3dbna
*   dban =                      " pd3dban
*   dbgb =                      " pd3dbgb
*   dbso =                      " hrdesv_ds_s_dbso_d3
*   dbuv =                      " pd3dbuv
*   dbuv_dat =                  " pd3dbuv_dat
*   dbeu =                      " pd3dbeu
*   dbks =                      " pd3dbks
*   dbkv =                      " pd3dbkv
*   flag =                      " pd3flag
*   delete =                    " hrd3key
  EXCEPTIONS
    DUPLICATE_KEY = 1           "
    MISSING_ENTRY = 2           "
    MISSING_DSME = 3            "
    .  "  HR_WRITE_D3

ABAP code example for Function Module HR_WRITE_D3





The ABAP code below is a full code listing to execute function module HR_WRITE_D3 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_dsap  TYPE STANDARD TABLE OF PD3DSAP,"TABLES PARAM
wa_dsap  LIKE LINE OF it_dsap ,
it_dsme  TYPE STANDARD TABLE OF PD3DSME,"TABLES PARAM
wa_dsme  LIKE LINE OF it_dsme ,
it_dbme  TYPE STANDARD TABLE OF PD3DBME,"TABLES PARAM
wa_dbme  LIKE LINE OF it_dbme ,
it_dbna  TYPE STANDARD TABLE OF PD3DBNA,"TABLES PARAM
wa_dbna  LIKE LINE OF it_dbna ,
it_dban  TYPE STANDARD TABLE OF PD3DBAN,"TABLES PARAM
wa_dban  LIKE LINE OF it_dban ,
it_dbgb  TYPE STANDARD TABLE OF PD3DBGB,"TABLES PARAM
wa_dbgb  LIKE LINE OF it_dbgb ,
it_dbso  TYPE STANDARD TABLE OF HRDESV_DS_S_DBSO_D3,"TABLES PARAM
wa_dbso  LIKE LINE OF it_dbso ,
it_dbuv  TYPE STANDARD TABLE OF PD3DBUV,"TABLES PARAM
wa_dbuv  LIKE LINE OF it_dbuv ,
it_dbuv_dat  TYPE STANDARD TABLE OF PD3DBUV_DAT,"TABLES PARAM
wa_dbuv_dat  LIKE LINE OF it_dbuv_dat ,
it_dbeu  TYPE STANDARD TABLE OF PD3DBEU,"TABLES PARAM
wa_dbeu  LIKE LINE OF it_dbeu ,
it_dbks  TYPE STANDARD TABLE OF PD3DBKS,"TABLES PARAM
wa_dbks  LIKE LINE OF it_dbks ,
it_dbkv  TYPE STANDARD TABLE OF PD3DBKV,"TABLES PARAM
wa_dbkv  LIKE LINE OF it_dbkv ,
it_flag  TYPE STANDARD TABLE OF PD3FLAG,"TABLES PARAM
wa_flag  LIKE LINE OF it_flag ,
it_delete  TYPE STANDARD TABLE OF HRD3KEY,"TABLES PARAM
wa_delete  LIKE LINE OF it_delete .

DATA(ld_it_hist) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_dsap to it_dsap.

"populate fields of struture and append to itab
append wa_dsme to it_dsme.

"populate fields of struture and append to itab
append wa_dbme to it_dbme.

"populate fields of struture and append to itab
append wa_dbna to it_dbna.

"populate fields of struture and append to itab
append wa_dban to it_dban.

"populate fields of struture and append to itab
append wa_dbgb to it_dbgb.

"populate fields of struture and append to itab
append wa_dbso to it_dbso.

"populate fields of struture and append to itab
append wa_dbuv to it_dbuv.

"populate fields of struture and append to itab
append wa_dbuv_dat to it_dbuv_dat.

"populate fields of struture and append to itab
append wa_dbeu to it_dbeu.

"populate fields of struture and append to itab
append wa_dbks to it_dbks.

"populate fields of struture and append to itab
append wa_dbkv to it_dbkv.

"populate fields of struture and append to itab
append wa_flag to it_flag.

"populate fields of struture and append to itab
append wa_delete to it_delete. . CALL FUNCTION 'HR_WRITE_D3' * EXPORTING * it_hist = ld_it_hist TABLES dsap = it_dsap dsme = it_dsme * dbme = it_dbme * dbna = it_dbna * dban = it_dban * dbgb = it_dbgb * dbso = it_dbso * dbuv = it_dbuv * dbuv_dat = it_dbuv_dat * dbeu = it_dbeu * dbks = it_dbks * dbkv = it_dbkv * flag = it_flag * delete = it_delete EXCEPTIONS DUPLICATE_KEY = 1 MISSING_ENTRY = 2 MISSING_DSME = 3 . " HR_WRITE_D3
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 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_it_hist  TYPE HRD3_T_HIST ,
it_dsap  TYPE STANDARD TABLE OF PD3DSAP ,
wa_dsap  LIKE LINE OF it_dsap,
it_dsme  TYPE STANDARD TABLE OF PD3DSME ,
wa_dsme  LIKE LINE OF it_dsme,
it_dbme  TYPE STANDARD TABLE OF PD3DBME ,
wa_dbme  LIKE LINE OF it_dbme,
it_dbna  TYPE STANDARD TABLE OF PD3DBNA ,
wa_dbna  LIKE LINE OF it_dbna,
it_dban  TYPE STANDARD TABLE OF PD3DBAN ,
wa_dban  LIKE LINE OF it_dban,
it_dbgb  TYPE STANDARD TABLE OF PD3DBGB ,
wa_dbgb  LIKE LINE OF it_dbgb,
it_dbso  TYPE STANDARD TABLE OF HRDESV_DS_S_DBSO_D3 ,
wa_dbso  LIKE LINE OF it_dbso,
it_dbuv  TYPE STANDARD TABLE OF PD3DBUV ,
wa_dbuv  LIKE LINE OF it_dbuv,
it_dbuv_dat  TYPE STANDARD TABLE OF PD3DBUV_DAT ,
wa_dbuv_dat  LIKE LINE OF it_dbuv_dat,
it_dbeu  TYPE STANDARD TABLE OF PD3DBEU ,
wa_dbeu  LIKE LINE OF it_dbeu,
it_dbks  TYPE STANDARD TABLE OF PD3DBKS ,
wa_dbks  LIKE LINE OF it_dbks,
it_dbkv  TYPE STANDARD TABLE OF PD3DBKV ,
wa_dbkv  LIKE LINE OF it_dbkv,
it_flag  TYPE STANDARD TABLE OF PD3FLAG ,
wa_flag  LIKE LINE OF it_flag,
it_delete  TYPE STANDARD TABLE OF HRD3KEY ,
wa_delete  LIKE LINE OF it_delete.

ld_it_hist = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_dsap to it_dsap.

"populate fields of struture and append to itab
append wa_dsme to it_dsme.

"populate fields of struture and append to itab
append wa_dbme to it_dbme.

"populate fields of struture and append to itab
append wa_dbna to it_dbna.

"populate fields of struture and append to itab
append wa_dban to it_dban.

"populate fields of struture and append to itab
append wa_dbgb to it_dbgb.

"populate fields of struture and append to itab
append wa_dbso to it_dbso.

"populate fields of struture and append to itab
append wa_dbuv to it_dbuv.

"populate fields of struture and append to itab
append wa_dbuv_dat to it_dbuv_dat.

"populate fields of struture and append to itab
append wa_dbeu to it_dbeu.

"populate fields of struture and append to itab
append wa_dbks to it_dbks.

"populate fields of struture and append to itab
append wa_dbkv to it_dbkv.

"populate fields of struture and append to itab
append wa_flag to it_flag.

"populate fields of struture and append to itab
append wa_delete to it_delete.

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