Skip to Content
avatar image
Former Member

adding our own function to sap standard function code.

HI,

My requirement is to add a functionality to icon(import) on alv application tool bar so that the customer get a popup message after data is transfered to excel.

is that possible.

else

i want to know the procedure to pass header of my alv when i try to download using gui_download.

here the problem is i am having 362 fields in my report.

so passsing header for these many fields is immposible.

when i use gui_download i am not getting header in my excel.

i am not good at ASML_====.

Pls help me.

Any helpful ans will be rewarded.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 21, 2007 at 12:11 PM

    For the ALV you can use the IT_EVENT_EXIT table parameter of the ALV function module to have the ALV call your user command form when it is used (before, after, or both). See the documentation on the function module.

    You then just check for the buttons UCOMM value and do your pre or post processing.

    Andrew

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 21, 2007 at 11:51 AM

    Declare two internal tables it_header for the header and it_downloads for data.

    data:begin of it_header occurs 0,

    string(100),

    end of it_header.

    <b>Perform Insert_header.
    Call Function GUI_DOWNLOAD
    exporting
    filename = c:xyz.xls
    filetype = DAT
    tables 
    data_tab = it_download                 " itab with data
    fieldnames = it_header                  " itab with header info.
    exceptions
    ...
    ...
    
    if sy-subrc <> 0.
    
    endif</b>.

    <b>Form Insert_header.     " You can put some logic ie some loop here for    * all the fields.
    
    it_header-string = text-001.
    append it_header.Clear it_header.
    
    it_header-string = text-002.
    append it_header.Clear it_header.
    
    it_header-string = text-003.
    append it_header.Clear it_header.
    
    it_header-string = text-004.
    append it_header.Clear it_header.
    
    Endform</b>.

    Add comment
    10|10000 characters needed characters exceeded