SAP Function Modules

EHS003_SET_DATA_SD SAP Function module







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

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


Pattern for FM EHS003_SET_DATA_SD - EHS003 SET DATA SD





CALL FUNCTION 'EHS003_SET_DATA_SD' "
  EXPORTING
*   i_vbak_vbtyp =              " vbak-vbtyp
*   i_likp_vbtyp =              " likp-vbtyp
    i_tvak_fehgr =              " tvak-fehgr
    i_trtyp =                   " t180-trtyp
*   i_fehler =                  " c
*   i_fehlerfeld =              " tbfdnam_vb
*   i_tc_selline =              " sy-stepl
*   i_shp_cursor =              " shp_cursor-fieldname
*   i_shp_cursor_line =         " shp_cursor-line
    i_posnr =                   " posnr
  TABLES
    i_xvbuvtab =                " vbuvvb
    i_dvbuvtab =                " vbuvvb
    i_hvbuvtab =                " vbuvvb
  EXCEPTIONS
    OTHERS_ = 1                 "
    .  "  EHS003_SET_DATA_SD

ABAP code example for Function Module EHS003_SET_DATA_SD





The ABAP code below is a full code listing to execute function module EHS003_SET_DATA_SD 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_i_xvbuvtab  TYPE STANDARD TABLE OF VBUVVB,"TABLES PARAM
wa_i_xvbuvtab  LIKE LINE OF it_i_xvbuvtab ,
it_i_dvbuvtab  TYPE STANDARD TABLE OF VBUVVB,"TABLES PARAM
wa_i_dvbuvtab  LIKE LINE OF it_i_dvbuvtab ,
it_i_hvbuvtab  TYPE STANDARD TABLE OF VBUVVB,"TABLES PARAM
wa_i_hvbuvtab  LIKE LINE OF it_i_hvbuvtab .


SELECT single VBTYP
FROM VBAK
INTO @DATA(ld_i_vbak_vbtyp).


SELECT single VBTYP
FROM LIKP
INTO @DATA(ld_i_likp_vbtyp).


SELECT single FEHGR
FROM TVAK
INTO @DATA(ld_i_tvak_fehgr).


SELECT single TRTYP
FROM T180
INTO @DATA(ld_i_trtyp).

DATA(ld_i_fehler) = 'Check type of data required'.
DATA(ld_i_fehlerfeld) = 'Check type of data required'.
DATA(ld_i_tc_selline) = 'Check type of data required'.

DATA(ld_i_shp_cursor) = some text here

DATA(ld_i_shp_cursor_line) = 123
DATA(ld_i_posnr) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_i_xvbuvtab to it_i_xvbuvtab.

"populate fields of struture and append to itab
append wa_i_dvbuvtab to it_i_dvbuvtab.

"populate fields of struture and append to itab
append wa_i_hvbuvtab to it_i_hvbuvtab. . CALL FUNCTION 'EHS003_SET_DATA_SD' EXPORTING * i_vbak_vbtyp = ld_i_vbak_vbtyp * i_likp_vbtyp = ld_i_likp_vbtyp i_tvak_fehgr = ld_i_tvak_fehgr i_trtyp = ld_i_trtyp * i_fehler = ld_i_fehler * i_fehlerfeld = ld_i_fehlerfeld * i_tc_selline = ld_i_tc_selline * i_shp_cursor = ld_i_shp_cursor * i_shp_cursor_line = ld_i_shp_cursor_line i_posnr = ld_i_posnr TABLES i_xvbuvtab = it_i_xvbuvtab i_dvbuvtab = it_i_dvbuvtab i_hvbuvtab = it_i_hvbuvtab EXCEPTIONS OTHERS_ = 1 . " EHS003_SET_DATA_SD
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "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_i_vbak_vbtyp  TYPE VBAK-VBTYP ,
it_i_xvbuvtab  TYPE STANDARD TABLE OF VBUVVB ,
wa_i_xvbuvtab  LIKE LINE OF it_i_xvbuvtab,
ld_i_likp_vbtyp  TYPE LIKP-VBTYP ,
it_i_dvbuvtab  TYPE STANDARD TABLE OF VBUVVB ,
wa_i_dvbuvtab  LIKE LINE OF it_i_dvbuvtab,
ld_i_tvak_fehgr  TYPE TVAK-FEHGR ,
it_i_hvbuvtab  TYPE STANDARD TABLE OF VBUVVB ,
wa_i_hvbuvtab  LIKE LINE OF it_i_hvbuvtab,
ld_i_trtyp  TYPE T180-TRTYP ,
ld_i_fehler  TYPE C ,
ld_i_fehlerfeld  TYPE TBFDNAM_VB ,
ld_i_tc_selline  TYPE SY-STEPL ,
ld_i_shp_cursor  TYPE SHP_CURSOR-FIELDNAME ,
ld_i_shp_cursor_line  TYPE SHP_CURSOR-LINE ,
ld_i_posnr  TYPE POSNR .


SELECT single VBTYP
FROM VBAK
INTO ld_i_vbak_vbtyp.


"populate fields of struture and append to itab
append wa_i_xvbuvtab to it_i_xvbuvtab.

SELECT single VBTYP
FROM LIKP
INTO ld_i_likp_vbtyp.


"populate fields of struture and append to itab
append wa_i_dvbuvtab to it_i_dvbuvtab.

SELECT single FEHGR
FROM TVAK
INTO ld_i_tvak_fehgr.


"populate fields of struture and append to itab
append wa_i_hvbuvtab to it_i_hvbuvtab.

SELECT single TRTYP
FROM T180
INTO ld_i_trtyp.

ld_i_fehler = 'Check type of data required'.
ld_i_fehlerfeld = 'Check type of data required'.
ld_i_tc_selline = 'Check type of data required'.

ld_i_shp_cursor = some text here

ld_i_shp_cursor_line = 123
ld_i_posnr = '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 EHS003_SET_DATA_SD or its description.