Skip to Content
avatar image
Former Member

Is it possible to propose another default file name in ALV Excel Export?

Hello All,

I have a problem while exporting to Excel from the WD ALV. The whole process works fine, the problem occurs when the user wants to open (without saving) multiple exported Excel documents at the same time. In this case he gets an error message, that the document with the same name has already been opened.

Therefore I have a question, is it possible to customize default file name, so that instead of 'export.xlsx' the file name will contain e.g. WD title&time (or something like that)?

Thank you very much in advance.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Mar 03, 2014 at 04:31 PM

    Hi,

    It's the standard functionality. You actually have to enhance the standard method, which is not advisable as the same will be called in other applications as well.

    So, Instead of that, hide the standard Export functionality and create a new Tool bar button, say, 'Export to Excel' and in on action of that button, use cl_wd_runtime_services=>attach_file_to_response ( and pass the file name by concatenating date/time) method to open/save the file.

    Check this document to create a custom button in ALV tool bar: Creating Self-Defined Functions in WDA ALV

    And, check this blog by Chris for code reference to have Export to Excel functionality: Using WD ABAP ALV export - the hacked way

    Hope this helps u,

    Regards,

    Kiran

    Add comment
    10|10000 characters needed characters exceeded