2007 Jun 05 5:28 PM
Hi Guys,
Can any body tell me whether we have to create a File before using Open dataset for writing files in Application Server.
Can anybody write a program for EKPO table to store it in application Server using OpendatasSet ?Is there any specific care we have to take for Executing pgm in Background?
I wrote the pgm for Foreground using GUI- Download.
PGM.
*******
select * into table it_ekpo from ekpo .
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename ='c:\EKPO.xls'
filetype = 'ASC'
WRITE_FIELD_SEPARATOR = 'X'
TABLES
data_tab = it_ekpo
*fieldnames = l_heading
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3 .
Plzzzzzzzzz Make the changes for existing Pgm.any help is awarded with points.Its Urgent.
Thanks,
Gopi.
2007 Jun 05 5:36 PM
open dataset p_fil for output in text mode .
the above command work like if file already exits then it will overwrite the recrds ,if not it create new file
open dataset p_fil for output in text mode .
the above command work like if file already exits then it will overwrite the recrds ,if not it create new file
2007 Jun 05 5:36 PM
open dataset p_fil for output in text mode .
the above command work like if file already exits then it will overwrite the recrds ,if not it create new file
2007 Jun 05 5:38 PM
Hi
yes Create a file: p_file
and put your data in ITAB after fetching from table EKPO.
Open dataset p_file for appending in text mode.
if sy-subrc = 0.
loop at itab.
transfer itab to p_file.
endloop.
close dataset p_file.
endif.
Reward points if useful
Regards
Anji
2007 Jun 05 5:39 PM
Hi,
Here sample code to write data to app. server.
DATA FILENAME(20) VALUE '/USR/TEMP/TEST.DAT'.
OPEN DATASET FILENAME FOR OUTPUT IN TEXT MODE.
LOOP AT ITAB. " ITAB here is contains EKPO data
TRANSFER ITAB TO FILENAME.
ENDLOOP.
CLOSE DATASET FILENAME.
aRs
2007 Jun 05 5:41 PM
Hi,
open dataset <file> for output in text mode encoding non-unicode.
if sy-subrc eq 0.
loop at it_ekpo. "Internal Table with header line
transfer it_ekpo to <file>.
endloop.
close dataset <file>.
endif.
there are several changes you can make:
open dataset ... in legacy text mode.
or open .. fo appending.
2007 Jun 05 5:54 PM
Hi Guys,
Thanks for ur immediate response.I am sending the code just confirm me whether is correct r not?
DATA : wa_EKPO_file TYPE file_table-filename.
select * into table it_ekpo from ekpo .
OPEN DATASET wa_EKPO_file FOR OUTPUT "Write to appl. server
IN TEXT MODE
ENCODING DEFAULT. "Open dataset Return code
IF sy-subrc = 0.
LOOP at IT_EKPO into WA_EKPO.
TRANSFER wa_ekpo to wa_ekpo_file.
ENDLOOP.
ENDIF.
I want write the data into SPREAD Sheet .Can u guys tell me how to write into Spread Sheet using Open data Set.
Thanks,
Gopi.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |