2007 Nov 14 11:10 AM
Hi Experts,
I am having a requirement of appending new records in a flat file every time when i am executing a transaction.
I am having a flat file ( DAT type ). When I am executing a transaction code some new records will be generated and these records should be appended to the existing flat file with out deleting the existing data in it.
What function module I have to use and how to use that?
Helpful answers will be rewarded.
Hi Experts,
I am having a requirement of appending new records in a flat file every time when i am executing a transaction.
I am having a flat file ( DAT type ). When I am executing a transaction code some new records will be generated and these records should be appended to the existing flat file with out deleting the existing data in it.
What function module I have to use and how to use that?
Helpful answers will be rewarded.
2007 Nov 14 11:15 AM
Hi..
You can do this with GUI_Download FM.
This is the sample code...
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = lv_len
filename = lv_filename
filetype = 'ASC'
<b> APPEND = 'X'</b> "To append the records to existing file
TABLES
data_tab = lt_itab .
<b>Reward if Helpful.</b>
2007 Nov 14 11:21 AM
Hi,
Is this a flat file on the application server or on the presentation server?
Gareth.
2007 Nov 14 11:25 AM
Hi,
If ur flate file is on presentation server then use fm GUI_DOWNLOAD
*--Call function to download the error file
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = file
filetype = 'ASC'
APPEND = 'X'
TABLES
data_tab = pr_eord_error
EXCEPTIONS
file_write_error = 1
no_authority = 5
unknown_error = 6
access_denied = 15
file_not_found = 19.
And if its on application server then use open dataset
ex. *-- Open Dataset
OPEN DATASET lv_dsn FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
Regards,
Prashant
2007 Nov 14 11:30 AM
> if its on application server then use open dataset
>
> ex. *-- Open Dataset
> OPEN DATASET lv_dsn FOR OUTPUT IN TEXT MODE
> ENCODING DEFAULT.
>
>
> Regards,
> Prashant
I think you mean
open dataset lv_path for appending
in text mode encoding default.All of this is explained quite clearly in the on line help if you press F1 on the OPEN DATASET command.
Gareth.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |