Application Development and Automation 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: 
Read only

adding our own function to sap standard function code.

Former Member
0 Likes
643

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
Read only

Former Member
0 Likes
534

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
Read only

Former Member
0 Likes
534

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

Read only

0 Likes
534

hi but that is not possible for 362 fields.

Read only

Former Member
0 Likes
535

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