Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

adding our own function to sap standard function code.

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

3 REPLIES 3

Former Member
0 Kudos

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>.

0 Kudos

hi but that is not possible for 362 fields.

Former Member
0 Kudos

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