2009 Jan 22 6:05 AM
hi all,
in the ALV report i need to download the output data to excel format.
the process to download the bussiness is following is
goto tool bar click on
LIST and then
EXPORT
SPREADSHEET (EXCEL in HTML Format)
the output while downloading is getting changed for WBS ELEMENT.
In report output i am getting the correct output while downloading the output the WBS ELEMENT is getting changed.
please advise.
thanks in advance
hi all,
in the ALV report i need to download the output data to excel format.
the process to download the bussiness is following is
goto tool bar click on
LIST and then
EXPORT
SPREADSHEET (EXCEL in HTML Format)
the output while downloading is getting changed for WBS ELEMENT.
In report output i am getting the correct output while downloading the output the WBS ELEMENT is getting changed.
please advise.
thanks in advance
2009 Jan 22 6:08 AM
Hi,
try out the following code to download to excel.
form download.
if sy-ucomm = 'DOWNLOAD' and sy-lsind = 1.
data: fullpath type string,
filename type string,
path type string,
user_action type i,
encoding type abap_encoding.
call method cl_gui_frontend_services=>file_save_dialog
exporting
window_title = 'Gui_Download Demo'
with_encoding = 'X'
initial_directory = 'C:\'
changing
filename = filename
path = path
fullpath = fullpath
user_action = user_action
file_encoding = encoding
exceptions
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
others = 4.
if sy-subrc <> 0.
exit.
endif.
if user_action <> cl_gui_frontend_services=>action_ok.
exit.
endif.
Ascii download
call function 'GUI_DOWNLOAD'
exporting
filename = fullpath
filetype = 'DAT'
tables
data_tab = itab.
endif.
endform. "download
hope it will help you.
Regards
Rajesh Kumar
2009 Jan 22 6:09 AM
Hi Hema,
In the fieldcatalog pass the Reference Table & reference field for WBS element & then test.
Best regards,
Prashant
2009 Jan 22 6:28 AM
hi prashant
my code:
please tell how to add refernce table or reference field name.
PS_PSP_PNR IS THE FIELD FROM EKKN TABLE
LS_FIELDCAT-FIELDNAME = 'PS_PSP_PNR'.
LS_FIELDCAT-TABNAME = 'GT_FINAL'.
LS_FIELDCAT-SELTEXT_M = 'WBS Element'.
LS_FIELDCAT-COL_POS = LOC_COUNT.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
CLEAR LS_FIELDCAT.
2009 Jan 22 6:57 AM
Check this code
CLEAR WA_FIELDCAT.
WA_FIELDCAT-FIELDNAME = 'PS_PSP_PNR'
WA_FIELDCAT-REF_TABLE = 'EKKN'.
WA_FIELDCAT-REF_FIELD = 'PS_PSP_PNR'.
APPEND WA_FIELDCAT TO GT_FIELDCAT.
2009 Jan 22 6:11 AM
hi
try calling function MS_EXCEL_OLE_STANDARD_DAT
hope this helps
regards
Aakash Banga
2009 Jan 22 6:43 AM