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

download data

Former Member
0 Likes
1,191

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

6 REPLIES 6
Read only

Former Member
0 Likes
1,035

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

Read only

Former Member
0 Likes
1,035

Hi Hema,

In the fieldcatalog pass the Reference Table & reference field for WBS element & then test.

Best regards,

Prashant

Read only

0 Likes
1,035

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.

Read only

0 Likes
1,035

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.

Read only

Former Member
0 Likes
1,035

hi

try calling function MS_EXCEL_OLE_STANDARD_DAT

hope this helps

regards

Aakash Banga

Read only

Former Member
0 Likes
1,035

u hve this for ref table REF_TABNAME in the fieldcatalogue.