11-19-2007 1:31 PM
i was using FM gui download, and everything is fine.
Question is how to gave new name for every new downloaded record.
Eg. ABC_1.txt ; ABC_2.txt; ABC_1.txt;......ABC_n
11-19-2007 1:35 PM
use Concatenate to generate the file name and use a count variable.Increase the count for every loop pass...
loop at table.
count = count + 1
concatenate 'ABC_' count '.txt' into wf_filename.
Download this file
endloop
Or you can also use NUMBER RANGE object to generate a new number everytime you want to download a file.
Instead of declaring the count variable and incrementing it. Use the Number range object.
11-19-2007 1:34 PM
11-19-2007 1:35 PM
use Concatenate to generate the file name and use a count variable.Increase the count for every loop pass...
loop at table.
count = count + 1
concatenate 'ABC_' count '.txt' into wf_filename.
Download this file
endloop
Or you can also use NUMBER RANGE object to generate a new number everytime you want to download a file.
Instead of declaring the count variable and incrementing it. Use the Number range object.
11-19-2007 1:35 PM
Nick,
Your Question is not clear...
By Using GUI_DOWNLOAD you can download to only one file per one call of FM, you can not have multiple file names for one FM Call.
Regards,
Satish
11-19-2007 1:40 PM
* **********************************Create a SNRO 'ZOBJ'.
data: gc_range TYPE inri-nrrangenr VALUE '1'.
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
nr_range_nr = gv_range
object = 'ZOBJ'
IMPORTING
number = gv_no
EXCEPTIONS
interval_not_found = 1
number_range_not_intern = 2
object_not_found = 3
quantity_is_0 = 4
quantity_is_not_1 = 5
interval_overflow = 6
buffer_overflow = 7
OTHERS = 8.
IF sy-subrc EQ 0.
CONCATENATE 'ABC_' gv_no ' .txt'INTO l_ofile1.
ENDIF.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = l_ofile1
filetype = 'ASC'
TABLES
data_tab = p_local_table
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.
MESSAGE e000 WITH text-036.
ENDIF.
11-19-2007 1:46 PM
this files ABC_1.txt .....ABC_n will be view of some internal tables , every new view must have new number, that's the point.
11-19-2007 1:49 PM
then use concatenate to build the filename and call gui_dowload as often as you need it.