‎2008 Jan 15 6:52 AM
Hi,
Does anybody knows a standard FM that creates a text file in the local hard drive in the given path.
Please Help...
Thank you...
regards,
mae
‎2008 Jan 15 7:10 AM
‎2008 Jan 15 6:58 AM
FM: GUI_DOWNLOAD can download required data to local hard drive
Kind Regards
Eswar
‎2008 Jan 15 7:01 AM
this will call a .bat or .exe which is the one who will create the text file..
So a FM that will will trigger a file to create a text file..
Do you have any idea regarding with this?
thank you..
regards,
mae
‎2008 Jan 15 7:09 AM
Mae,
Your requirement is not clear, do you need to create text file with data or invoke a batch file that creates text file?
Check below sample code, it creates a text file "DOWNLOAD.TXT" in local hard disk.
data: i_dat type table of string.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'C:\download.txt'
tables
data_tab = i_dat
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.
Populate internal table I_DAT with data that has to be download to the file.
Kind Regards
Eswar
‎2008 Jan 15 7:00 AM
Hi,
Use function module GUI_EXEC and in parameter give notepad.exe.
Regards,
Renjith Michael.
‎2008 Jan 15 7:10 AM
‎2008 Jan 15 7:24 AM
hi,
what i mean to say is that i need to trigger an executable program .exe or .bat...and this executable program will just responsible on creating the text file...
i have 3 parameter the PATH, ID, and Code..
does anybody knows a function module that will trigger an executable program?
Please help..
Thank you..
regards,
mae
‎2008 Jan 15 7:30 AM
Hi Mae,
Think you can use FM: SXPG_COMMAND_EXECUTE. I guess you can find few samples here in SDN. Please check.
Regards
Eswar
‎2008 Jan 15 7:56 AM
hi,
it seems that the examples from this forum makes me confused on using this FM...
can you explain how to use this FM?
please.......
thank you..
regards,
mae
‎2008 Jan 15 8:39 AM
hii,
check it step by step.
1) you fill the internal table for which you want to generate the file.
2) store the file name with the file type in a variable
3) call the function by pressing 'Pattren' button on the tool bar and write function name and it ll load code into your window.
4) set the parameter as shown below and execute the code.
it will generate file according to your specified file location and type.
call function 'GUI_DOWNLOAD'
exporting
BIN_FILESIZE =
filename = txtfile
filetype = 'ASC'
APPEND = ' '
write_field_separator = 'X'
confirm_overwrite = 'X'
tables
data_tab = it2_oh
.
reply if not clear
or
Reward if helpful
-Maharshi