SAP Function Modules

HR_UA_RUNEXLREPORT SAP Function module - Run Excel Report







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

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


Pattern for FM HR_UA_RUNEXLREPORT - HR UA RUNEXLREPORT





CALL FUNCTION 'HR_UA_RUNEXLREPORT' "Run Excel Report
  EXPORTING
    p_filename =                " char255       Template file name
    p_path =                    " char255       Temporary directory path
    p_reporttitle =             " char255       Report title
    p_previewrows = 100         " i             Rows in preview
    p_portionsize = 1000        " i             Rows in portion
  TABLES
    p_header_tab =              "               Table with header data
    p_detail_tab =              "               Table with detail data
  EXCEPTIONS
    NOTHING_FOUND = 1           "
    ERROR_KPRO = 2              "
    INTERNAL_ERROR = 3          "
    PARAMETER_ERROR = 4         "
    NOT_AUTHORIZED = 5          "
    NOT_ALLOWED = 6             "
    OTHER_ERROR = 7             "
    .  "  HR_UA_RUNEXLREPORT

ABAP code example for Function Module HR_UA_RUNEXLREPORT





The ABAP code below is a full code listing to execute function module HR_UA_RUNEXLREPORT 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_header_tab  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_p_header_tab  LIKE LINE OF it_p_header_tab ,
it_p_detail_tab  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_p_detail_tab  LIKE LINE OF it_p_detail_tab .

DATA(ld_p_filename) = 'Check type of data required'.
DATA(ld_p_path) = 'Check type of data required'.
DATA(ld_p_reporttitle) = 'Check type of data required'.
DATA(ld_p_previewrows) = 'Check type of data required'.
DATA(ld_p_portionsize) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_p_header_tab to it_p_header_tab.

"populate fields of struture and append to itab
append wa_p_detail_tab to it_p_detail_tab. . CALL FUNCTION 'HR_UA_RUNEXLREPORT' EXPORTING p_filename = ld_p_filename p_path = ld_p_path p_reporttitle = ld_p_reporttitle p_previewrows = ld_p_previewrows p_portionsize = ld_p_portionsize TABLES p_header_tab = it_p_header_tab p_detail_tab = it_p_detail_tab EXCEPTIONS NOTHING_FOUND = 1 ERROR_KPRO = 2 INTERNAL_ERROR = 3 PARAMETER_ERROR = 4 NOT_AUTHORIZED = 5 NOT_ALLOWED = 6 OTHER_ERROR = 7 . " HR_UA_RUNEXLREPORT
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 ELSEIF SY-SUBRC EQ 6. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 7. "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_p_filename  TYPE CHAR255 ,
it_p_header_tab  TYPE STANDARD TABLE OF STRING ,
wa_p_header_tab  LIKE LINE OF it_p_header_tab,
ld_p_path  TYPE CHAR255 ,
it_p_detail_tab  TYPE STANDARD TABLE OF STRING ,
wa_p_detail_tab  LIKE LINE OF it_p_detail_tab,
ld_p_reporttitle  TYPE CHAR255 ,
ld_p_previewrows  TYPE I ,
ld_p_portionsize  TYPE I .

ld_p_filename = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_p_header_tab to it_p_header_tab.
ld_p_path = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_p_detail_tab to it_p_detail_tab.
ld_p_reporttitle = 'Check type of data required'.
ld_p_previewrows = 'Check type of data required'.
ld_p_portionsize = '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_UA_RUNEXLREPORT or its description.