2010 Mar 19 4:33 AM
Hi all,
I'm trying to download the file into excel sheet getting data into excel but header is missing in SAP4.7 version , when i check my code in ECC6.0 then the header is coming. Below is my code.
TYPES: BEGIN OF it_int,
sales(3) TYPE n,
name(30) TYPE c,
END OF it_int.
DATA: t_int TYPE STANDARD TABLE OF it_int,
fs_int TYPE it_int.
DATA:
BEGIN OF t_header OCCURS 0,
header(50) TYPE c,
END OF t_header.
fs_int-sales = 001.
fs_int-name = 'Urea'.
APPEND fs_int TO t_int.
CLEAR fs_int.
fs_int-sales = 002.
fs_int-name = 'Ammonia'.
APPEND fs_int TO t_int.
CLEAR fs_int.
t_header-header = 'Sales'.
APPEND t_header.
t_header-header = 'ItemName'.
APPEND t_header.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename =
'C:\SAELS.xls'
filetype= 'ASC'
append = 'X'
write_field_separator = 'X'
TABLES
data_tab = t_int
fieldnames = t_header.
What needs to be done to get header in SAP4.7 version ?
Thanks in Advance.
Regards
VENk@
Hi all,
I'm trying to download the file into excel sheet getting data into excel but header is missing in SAP4.7 version , when i check my code in ECC6.0 then the header is coming. Below is my code.
TYPES: BEGIN OF it_int,
sales(3) TYPE n,
name(30) TYPE c,
END OF it_int.
DATA: t_int TYPE STANDARD TABLE OF it_int,
fs_int TYPE it_int.
DATA:
BEGIN OF t_header OCCURS 0,
header(50) TYPE c,
END OF t_header.
fs_int-sales = 001.
fs_int-name = 'Urea'.
APPEND fs_int TO t_int.
CLEAR fs_int.
fs_int-sales = 002.
fs_int-name = 'Ammonia'.
APPEND fs_int TO t_int.
CLEAR fs_int.
t_header-header = 'Sales'.
APPEND t_header.
t_header-header = 'ItemName'.
APPEND t_header.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename =
'C:\SAELS.xls'
filetype= 'ASC'
append = 'X'
write_field_separator = 'X'
TABLES
data_tab = t_int
fieldnames = t_header.
What needs to be done to get header in SAP4.7 version ?
Thanks in Advance.
Regards
VENk@
2010 Mar 19 4:50 AM
2010 Mar 19 4:50 AM
2010 Mar 19 5:15 AM
HI I have already gone through the given sites but no use.
Regards
VEnk@
2010 Mar 19 5:25 AM
Check if you were able to download the same to a txt file in 4.7 version.
I don't have the 4.7 version now to check it.
2010 Mar 19 5:35 AM
HI,
I have tried this to download in text file but didnt worked.
Regards
VEnk@
2010 Mar 19 5:26 AM
Hi Venkat reddy,
<li>Try this way .I tried to change your program. it works
Thanks
Venkat.O
REPORT ztest.
TYPES: BEGIN OF it_int,
sales(3) TYPE n,
name(30) TYPE c,
END OF it_int.
DATA: t_int TYPE STANDARD TABLE OF it_int,
fs_int TYPE it_int.
DATA:BEGIN OF t_header OCCURS 0,
field1(50) TYPE c,
field2(50) TYPE c,
END OF t_header.
fs_int-sales = 001.
fs_int-name = 'Urea'.
APPEND fs_int TO t_int.
CLEAR fs_int.
fs_int-sales = 002.
fs_int-name = 'Ammonia'.
APPEND fs_int TO t_int.
CLEAR fs_int.
t_header-field1 = 'Sales'.
t_header-field2 = 'ItemName'.
APPEND t_header.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'C:\SAELS.xls'
filetype = 'ASC'
* append = 'X'
write_field_separator = 'X'
TABLES
data_tab = t_header.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'C:\SAELS.xls'
filetype = 'ASC'
append = 'X'
write_field_separator = 'X'
TABLES
data_tab = t_int.
2010 Mar 19 5:38 AM
HI Venkat,
Its almost reached but not correctly, I'm Getting SALES and ITEMNAME in the same line i need to be in 2 different columns.
Any suggestions.
REgards
VEnk@
2010 Mar 19 5:41 AM
Hi Venkat, <li>I dont know whether you copied portion of code or executed the code i pasted. But try to copy the code I changed and paste it. Its absolutely working. Thanks Venkat.
2010 Mar 19 5:47 AM
HI Venkat,
Its working fine thks for a good concept. When i'm trying to assign marks to you its getting error as "An error has occured while assigning makrs. Please refresh the thread view and try again.
". Also one more question from me can we use this GUI_DOWNLOAD to schedule in background and generate excel sheet in the back ground.
Regards
VEnk@
2010 Mar 19 5:49 AM
2010 Mar 19 5:50 AM
Hi Venkat, <li>We can not use any GUI* Function in background processing. Thanks Venkat.O
2010 Mar 19 5:53 AM
Ok VEnk@ and Gautham can u suggest me which F.M shall i use to generate a EXCEL sheets in the background.
Regards
VEnk@
2010 Mar 19 5:57 AM
In background you cant save any file on local pc. You need to create the file in application server.
Using data sets, from there onwards, you can download anything to your local machine.
2010 Mar 19 5:59 AM
[Download excel in background|http://www.sap-img.com/abap/download-in-background-in-excel-format.htm]
This is one approach which you can try.
2010 Mar 22 8:01 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |