on 01-30-2007 10:35 AM
Hi Experts,
i am able to save the file on local disk but if i am trying to save another one it's replacing the first file. i know methods where in i can save any number of files at
runtime. actually i am trying to save mini statements(banking software) so i want
these files to be saved with their respective account no or names of the concerned person.
* using below code u can get the account no as filename
loop at it_accounts.
p_filename = it_accounts-accounts.
CALL FUNCTION 'GUI_DOWNLOAD'.
filename = p_filename
endloop.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vipin,
<b>* This method of file download with check uses the latest techniques
and achieves a very neat solution
DATA: ld_filename TYPE string,
ld_path TYPE string,
ld_fullpath TYPE string,
ld_result TYPE i.
Display save dialog window
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
window_title = ' '
DEFAULT_EXTENSION = 'XLS'
default_file_name = 'accountsdata'
INITIAL_DIRECTORY = 'c:\temp\'
CHANGING
filename = ld_filename
path = ld_path
fullpath = ld_fullpath
user_action = ld_result.
Check user did not cancel request
CHECK ld_result EQ '0'.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = ld_fullpath
filetype = 'ASC'
APPEND = 'X'
write_field_separator = 'X'
CONFIRM_OVERWRITE = 'X'
TABLES
data_tab = it_datatab[] "need to declare and populate
EXCEPTIONS
file_open_error = 1
file_write_error = 2
OTHERS = 3.</b>
hi vipin...
example--
p_filename contains <b>C:\Documents and Settings\nreddy\Desktop\SAP_install_latest.xxx</b> so wht i mean to say is change this name dinamically to avoid u r problem...
suppose u have file on deskto OUTPUT.XXX.
u r program is replacing the existing file.. so u wanto avoid this. am i right?
if yes chage the file name..OUTPUT.xxx to OUTPUT123.xx like that,,,
but u need to do this with out u r interference at run time that why i have give the above solution..
try to omplement the solutions .. then u r problem willbe solve...
probaly u r giving the same name every time...
so u need to change the name every time
use this statement
V_PATH is the file path u r using..
CONCATENATE V_PATH 'xxx' SY-DATUM sy-time INTO P_FLNAM.
by conatnating this every second the file name will be changed.... so the existing one will be safe
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi vipin,
If the file names are same then it replace the existing file. So try changing the file names.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Vipin,
Try changing the filename with an account number dynamcally.
Regards,
santosh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.