2014 Jun 03 8:38 AM
Hi Experts...!
I have one requirement like as bellow...
In VF02 Tcode ----->give one Billing number .
------>Goto Menu options click on Billing Doc menu button
------> Select Issue output
------> then we get print preview click on that
At this point i need.....
Not only out put preview but also down load that content into my local computer....at a time!( Excel sheet )
How could we reach this requirement ...........................
Can any body please help meeee.........!
Thanks & Regards,
Vamsilakshman.p
2014 Jun 03 8:47 AM
2014 Jun 03 9:08 AM
2014 Jun 03 9:18 AM
Yeah you can use GUI_DOWNLOAD.. below logic just write in driver program and set status or push buttons in your report selection screen. while click that button create the event.
data filename type string.
data path type string.
data path_2 type string.
data fullpath type string.
data:begin of it occurs 0,
grp type c,
val type i,
end of it.
data:begin of heading occurs 0,
text(10) type c,
end of heading.
it-grp = 'A'.
it-val = 100.
append it.
it-grp = 'B'.
it-val = 200.
append it.
heading-text = 'GROUP'.
append heading.
heading-text = 'VALUE'.
append heading.
cl_gui_frontend_services=>file_save_dialog(
exporting
window_title = 'SAVE PDF'
file_filter = 'xls|*.xls|(All file)|*.*'
changing
filename = filename
path = path
fullpath = fullpath
exceptions
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
others = 4
) .
call function 'GUI_DOWNLOAD'
exporting
filename = fullpath
filetype = 'ASC'
write_field_separator = '#'
show_transfer_status = 'X'
tables
data_tab = it[]
fieldnames = heading[]
exceptions
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
others = 22
.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
Regards,
Thangam.P
2014 Jun 03 9:20 AM
Hi,
Before you click 'print preview', type '/H' in command line. then you can find out this function code response at where. Try to add an implicit enhancement at the end. In this enhancement, call GUI_DOWNLOAD.
regards,
Archer
2014 Jun 03 9:44 AM
Dear Vamsi,
In order to convert the smart form print preview output to Excel, Perform the following steps.
1.View the print preview of the layout.
2.Use the menu Goto->List Display
3.Then use System->List->Save->Local file
4.Finally select the option Spreadsheet and select .txt to <filename>.xls
Regards,
Abbas.
2014 Jun 03 11:06 AM
Hi
thanks for instant reply...
I dont need to manual procedure.......
How to done this........ programmatic way......!
When i click on print preview button it will display out put and simultaneously downloaded as an Excel sheet...as local file...!
How to do this......pls help me
Thanks and Regards,
vamsi.