Skip to Content
author's profile photo Former Member
Former Member

Download Excel 'EXCEL_OLE_STANDARD_DAT'

Hi Guru,

I have 2 questions regarding this FM 'EXCEL_OLE_STANDARD_DAT'.

1. How do I change the file directory to sap directory. Instead of downloading to my own local pc directory, I wan it to download to AL11 (Sap directory).

2. How do I prevent the excel from showing in background? If I schedule it to batch job, will it cause problem?

Thanks.

CALL FUNCTION 'EXCEL_OLE_STANDARD_DAT'

EXPORTING

FILE_NAME = 'C:\USR03.XLS'

DATA_SHEET_NAME = 'USER LIST'

TABLES

DATA_TAB = ITABUSR03

FIELDNAMES = FLDITAB

EXCEPTIONS

FILE_NOT_EXIST = 1

FILENAME_EXPECTED = 2

COMMUNICATION_ERROR = 3

OLE_OBJECT_METHOD_ERROR = 4

OLE_OBJECT_PROPERTY_ERROR = 5

INVALID_FILENAME = 6

INVALID_PIVOT_FIELDS = 7

DOWNLOAD_PROBLEM = 8

OTHERS = 9.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Edited by: Hui Leng Yeoh on Jul 23, 2008 10:18 AM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 23, 2008 at 08:20 AM

    Hi Hui

    It is not possible to download excel file in background mode.

    Regards

    Anbu

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 23, 2008 at 08:27 AM

    Hi

    That fm can works online only and it can download a file into presentation server only, so

    1. How do I change the file directory to sap directory. Instead of downloading to my own local pc directory, I wan it to download to AL11 (Sap directory).

    It means the SAP server can be available in your network, your network account (no SAP user) has to have the authorization to see the SAP server.

    U can use the method FILE_OPEN_DIALOG of class CL_GUI_FRONTEND_SERVICES in order to show a popup to choose the path.

    2. How do I prevent the excel from showing in background? If I schedule it to batch job, will it cause problem?

    Just I've wrotten above, it can't works in background so u can test the system variable SY-BATCH in order to prevent it.

    Max

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.