SAP Function Modules

EXCEL_OLE_STANDARD_DAT SAP Function module







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

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


Pattern for FM EXCEL_OLE_STANDARD_DAT - EXCEL OLE STANDARD DAT





CALL FUNCTION 'EXCEL_OLE_STANDARD_DAT' "
  EXPORTING
    file_name =                 " rlgrap-filename  Name of download file
*   create_pivot = 0            "               Create pivot table
*   data_sheet_name = SPACE     " rlgrap-filename
*   pivot_sheet_name = SPACE    " rlgrap-filename
*   password = SPACE            "               Password for XLS file
*   password_option = 0         " i             Controls password use
* TABLES
*   pivot_field_tab =           " excelpivot
*   data_tab =                  "               Data table
*   fieldnames =                "               Table with column headers
  EXCEPTIONS
    FILE_NOT_EXIST = 1          "               Specified file does not exist
    FILENAME_EXPECTED = 2       "               No file name transferred
    COMMUNICATION_ERROR = 3     "               SAPGUI receive error
    OLE_OBJECT_METHOD_ERROR = 4  "              Error while calling OLE method
    OLE_OBJECT_PROPERTY_ERROR = 5  "            Error while calling OLE attribute
    INVALID_PIVOT_FIELDS = 6    "
    DOWNLOAD_PROBLEM = 7        "
    .  "  EXCEL_OLE_STANDARD_DAT

ABAP code example for Function Module EXCEL_OLE_STANDARD_DAT





The ABAP code below is a full code listing to execute function module EXCEL_OLE_STANDARD_DAT 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_pivot_field_tab  TYPE STANDARD TABLE OF EXCELPIVOT,"TABLES PARAM
wa_pivot_field_tab  LIKE LINE OF it_pivot_field_tab ,
it_data_tab  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_data_tab  LIKE LINE OF it_data_tab ,
it_fieldnames  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_fieldnames  LIKE LINE OF it_fieldnames .


DATA(ld_file_name) = some text here
DATA(ld_create_pivot) = 'some text here'.

DATA(ld_data_sheet_name) = some text here

DATA(ld_pivot_sheet_name) = some text here
DATA(ld_password) = 'some text here'.
DATA(ld_password_option) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_pivot_field_tab to it_pivot_field_tab.

"populate fields of struture and append to itab
append wa_data_tab to it_data_tab.

"populate fields of struture and append to itab
append wa_fieldnames to it_fieldnames. . CALL FUNCTION 'EXCEL_OLE_STANDARD_DAT' EXPORTING file_name = ld_file_name * create_pivot = ld_create_pivot * data_sheet_name = ld_data_sheet_name * pivot_sheet_name = ld_pivot_sheet_name * password = ld_password * password_option = ld_password_option * TABLES * pivot_field_tab = it_pivot_field_tab * data_tab = it_data_tab * fieldnames = it_fieldnames EXCEPTIONS FILE_NOT_EXIST = 1 FILENAME_EXPECTED = 2 COMMUNICATION_ERROR = 3 OLE_OBJECT_METHOD_ERROR = 4 OLE_OBJECT_PROPERTY_ERROR = 5 INVALID_PIVOT_FIELDS = 6 DOWNLOAD_PROBLEM = 7 . " EXCEL_OLE_STANDARD_DAT
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_file_name  TYPE RLGRAP-FILENAME ,
it_pivot_field_tab  TYPE STANDARD TABLE OF EXCELPIVOT ,
wa_pivot_field_tab  LIKE LINE OF it_pivot_field_tab,
ld_create_pivot  TYPE STRING ,
it_data_tab  TYPE STANDARD TABLE OF STRING ,
wa_data_tab  LIKE LINE OF it_data_tab,
ld_data_sheet_name  TYPE RLGRAP-FILENAME ,
it_fieldnames  TYPE STANDARD TABLE OF STRING ,
wa_fieldnames  LIKE LINE OF it_fieldnames,
ld_pivot_sheet_name  TYPE RLGRAP-FILENAME ,
ld_password  TYPE STRING ,
ld_password_option  TYPE I .


ld_file_name = some text here

"populate fields of struture and append to itab
append wa_pivot_field_tab to it_pivot_field_tab.
ld_create_pivot = 'some text here'.

"populate fields of struture and append to itab
append wa_data_tab to it_data_tab.

ld_data_sheet_name = some text here

"populate fields of struture and append to itab
append wa_fieldnames to it_fieldnames.

ld_pivot_sheet_name = some text here
ld_password = 'some text here'.
ld_password_option = '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 EXCEL_OLE_STANDARD_DAT or its description.