2007 Dec 26 6:07 AM
I am using open data sets to download data to Appl server. After download data to Appl server, that should be saved as Excel format. In Excel I got that data, but problem is
I am not getting data as columns wise. Is there any solution for this.
Rgards,
Naseer.
2007 Dec 26 6:28 AM
hie...
For Downloading excel file...if ur using the Function module 'GUI_DOWNLOAD' ..then check the following..
--> the internal table which contains the data is populated properly...i.e .desired data in correct cloumns
--> export parameter filed type as 'DAT'
--> export parameter write_field_separator as 'X'
Hope this will solve ur problem
Regards
Pranali.
2007 Dec 26 6:28 AM
hie...
For Downloading excel file...if ur using the Function module 'GUI_DOWNLOAD' ..then check the following..
--> the internal table which contains the data is populated properly...i.e .desired data in correct cloumns
--> export parameter filed type as 'DAT'
--> export parameter write_field_separator as 'X'
Hope this will solve ur problem
Regards
Pranali.
2007 Dec 26 6:32 AM
Use CG3Y transaction to download application server file to presentation server.
and hence use ws_download or ALSM_EXCEL_TO_INTERNAL_TABLE to download into internal table.
Thanks and Regards,
Chandra
2007 Dec 26 6:38 AM
Hi naser,
I will send a sample code for this check it once ok..
code:
&----
*& Report YBDC_DATASETS_INPUT_AL11 *
*& *
&----
*& DEVELOPER : KIRAN KUMAR.G *
*& PURPOSE : FETCHING DATA FROM THE APPLICATION SERVER AND DISPLAY *
*& CREATION DT: 30/11/2007 *
*& REQUEST : ERPK900035 *
&----
REPORT YBDC_DATASETS_INPUT_AL11.
----
Internal Table
----
DATA: BEGIN OF gt_data OCCURS 0,
vbeln like vbap-vbeln,
posnr like vbap-posnr ,
END OF gt_data.
----
OPEN THE DATASET
----
OPEN DATASET 'ZBDCDEMO' FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc = 0.
DO.
READ DATA FROM THE DATASET(APPSERVER) AND PLACE THEM IN Internal Table
CLEAR : gt_data. "Clear Header Line
READ DATASET 'ZBDCDEMO' INTO gt_data.
IF sy-subrc = 0.
APPEND gt_data.
ELSE.
EXIT.
ENDIF.
ENDDO.
ENDIF.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
filename =
filetype = 'ASC'
APPEND = ' '
write_field_separator = 'X'
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
IMPORTING
FILELENGTH =
TABLES
data_tab = gt_data
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.
CLOSE DATASET 'ZBDCDEMO'.
Award points if helpful.
Kiran Kumar.G
Have a Nice Day..