We have added search box. Key in SAP issue keyword to search
TopBottom

Announcement: wanna exchange links? contact me at sapchatroom@gmail.com.

RE:[sap-dev] Gui_Download export to excel delivering only one row in excel output

Posted by Admin at
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Posted by Adamsap
on May 26 at 11:52 PM
Mark this reply as helpfulMark as helpful
Hello,
There is nothing much in the code. Its just a sample export to excel program.

REPORT ZITAB2EXCEL1.
*using GUI_DOWNLOAD
*2 ITABS USED. ONE FOR DATA AND OTHER FOR HEADING
DATA:BEGIN OF ITAB OCCURS 0,
GRP TYPE C,
VAL TYPE I,
END OF ITAB.

DATA:BEGIN OF HEADINGTAB OCCURS 0,
TEXT(10) TYPE C,
END OF HEADINGTAB.

ITAB-GRP = 'A'.
ITAB-VAL = 100.
APPEND ITAB.

ITAB-GRP = 'B'.
ITAB-VAL = 200.
APPEND ITAB.

HEADINGTAB-TEXT = 'GROUP'.
APPEND HEADINGTAB.

HEADINGTAB-TEXT = 'VALUE'.
APPEND HEADINGTAB.

CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = 'C:\ITAB2XLS.xls'
FILETYPE = 'DAT'
WRITE_FIELD_SEPARATOR = '|'
SHOW_TRANSFER_STATUS = 'X'
TABLES
DATA_TAB = ITAB[]
FIELDNAMES = HEADINGTAB[]
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 NE 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.



---------------Original Message---------------
From: Adamsap
Sent: Monday, May 24, 2010 1:52 AM
Subject: Gui_Download export to excel delivering only one row in excel output

> Hello,
>
> I am using Vista Os with the SAP front end logon 710 and Office 2007. Also my company is using Ecc6.0 in the server.
>
> I am able to export the Itab data to excel but all the rows are on the first row in Excel.
> If i have 3 rows in ITAB then all the 3 rows are on the First row of Excel
>
> I have supplied these parameters
> filename = 'C:\ITAB2XLS.xls'
> FILETYPE = 'ASC'
> WRITE_FIELD_SEPARATOR = 'X'
> SHOW_TRANSFER_STATUS = 'X'
>
> tables
> data_tab = itab[]
> FIELDNAMES = headingTab[]
>
> Is anyone having the same issue like me ?
>
> Thanks.
__.____._
Copyright © 2010 Toolbox.com and message author.

Toolbox.com 4343 N. Scottsdale Road Suite 280, Scottsdale, AZ 85251

0 comments:

Post a Comment

T r a n s l a t e to your language