How to store files in shared-folder in background mode
Hello All,
My requirement seems to be simple but I have tried many ways in achieving this, but failed. So require the help in accomplishing this task.
Requirement
I have to create a program in SE38 which will create a internal table with data in it in .XML format(which I can achieve).
My requirement is this .XML file needs to be placed in a shared-folder in "BACKGROUND MODE".
I have tried using GUI_DOWNLOAD function module, but this FM only runs in Foreground mode and fails in Background mode. I have tried convincing my client that I will keep the file in Application Server as it is achievable using OPEN DATASET statements, but they are not willing to accept this.
So can you please help me in achieving this task as I am not getting any solution how to keep the file in Shared-folder in BACKGROUND mode itself(not Foreground).
Best Regards,
Tousif
Hi Sanjeev,
I have just used normal GUI_DOWNLOAD FM. Please find my sample code below
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
* BIN_FILESIZE =
filename = 'D:\Users\baigtomx\Desktop\TOUSIF.XML'
* FILETYPE = 'ASC'
* APPEND = ' '
* WRITE_FIELD_SEPARATOR = ' '
* HEADER = '00'
* TRUNC_TRAILING_BLANKS = ' '
* WRITE_LF = 'X'
* COL_SELECT = ' '
* COL_SELECT_MASK = ' '
* DAT_MODE = ' '
* CONFIRM_OVERWRITE = ' '
* NO_AUTH_CHECK = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* WRITE_BOM = ' '
* TRUNC_TRAILING_BLANKS_EOL = 'X'
* WK1_N_FORMAT = ' '
* WK1_N_SIZE = ' '
* WK1_T_FORMAT = ' '
* WK1_T_SIZE = ' '
* WRITE_LF_AFTER_LAST_LINE = ABAP_TRUE
* SHOW_TRANSFER_STATUS = ABAP_TRUE
* VIRUS_SCAN_PROFILE = '/SCET/GUI_DOWNLOAD'
* IMPORTING
* FILELENGTH =
TABLES
data_tab = lt_wo
* FIELDNAMES =
* 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
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
When I run this program in foreground mode, the file gets saved(here in the above example I have just used my desktop path. but the actual requirement is to store file in shared-folder i-e Network Drive).
But when i run the same program in background mode, No file is getting stored.
Regards,
Similar Messages
-
Windows 2008 : How to Restrict Users to Copy file from Shared Folder
Hello All,
I need to Restrict Users to Copy file from Shared Folder. Please let me know is there any method to achieve this requirement.If user have Read permission, they can copy it. So actually you cannot restrict user from copy your files if they could read/edit.
Some programs could help restrict users from edit/modify/copy the content of their files such as Office files, PDF files etc as Oscar said above.
TechNet Subscriber Support in forum |If you have any feedback on our support, please contact [email protected] -
Can't copy file from Shared Folder
Hi,
Does anyone here knows how to copy file from shared music. I can view others shared music but can't do anything about it. When I tried to Right Click on music I want to copy. There are only 3 options (Get info, Unchecked Selection & Copy). I chose copy, but don't know what to do next. I wanted to place it in my Library but don't have an option to do it.
Please help.
Thanks,
guadzI've never copied music, but have you tried just dragging the file to your library? Not 100% sure if it works, never tried it myself. Also, if you right click in your library, can you paste?
-
How to store file content in database??????
how to store file in database and retrived
How to use Google to search for answers to questions that have been asked literally thousands of times previously??????
How to post into the correct forum???????
How to use less punctuation?????? -
How To Store Files On a Server?
I am using the Tomcat 5.0.27 web container. I have always store things into the database. Now, I am told to store files (uploaded files) on the server. And, when clients want the files later on, clients can download them.
Because I have not yet had this concept, I need help and explanation.
1. How to store files on a server?
2. Where on the server that files can be stored?
3. How to let clients download files when they are asked to be viewed?Look at the Jakarta Commons FileUpload package.
-
How to DEBUG a function module running in background mode? Please help!
Hi Experts,
I am calling a function module in my ABAP code in background module using the following syntax:
CALL FUNCTION 'YBBC2_CREATE_SNAPSHOT' IN BACKGROUND TASK
TABLES
itab_std_format_inv = itab_std_format_inv
itab_snapshot_inv = itab_snapshot_inv.
COMMIT WORK.
If I put the breakpoint in the CALL FUNCTION line and execute the program, the debugger does not take me to the valled function module. This may be because I am running the function module as background task.
I cannot comment this "IN BACKGROUND TASK" statement as well since i am debugging in Quality system where I don't have change access.
So how to DEBUG a function module running in background mode? Please help!
Thanks
GopalHi,
You could try to use the following trick:
(1) Put an endless loop into the coding of your function module where you want to start debugging, e.g.
DATA:
lx_exit_loop(1) TYPE c.
lx_exit_loop = ' '.
DO.
IF ( lx_exit_loop = 'X' ).
EXIT.
ENDIF.
ENDDO.
(2) Call your function module in background task
(3) Call transaction SM50 and search for the background process.
(3) Choose from menu Program/Mode -> Program -> Debugging
Now you the debugger should bring you right to your endless loop. Set lx_loop_exit = 'X' in the debugger and continue (F5 or F6).
<b>Reward points</b>
Regards -
Is it possible upload local file to internal table in background mode?
Hi, all,
Is it possbile to upload local file(not server file) to internal table in background mode.
If possbile ,please tell me detail . Thanks in advance.
Regards,
LilyHello,
This is possible.
If you report has to be executed in background using schedule Job. Then the file path should be constant and it can be hard coded in the report itself while populationg the internal table.
Then create a variant for your report and use that variant in the job.
This will solve your problem I guess.
Regards
Arindam -
How do i Secure & recover file from shared folder
Hi All,
I have Windows server 2008 R2 environment and one shared folder created on this with restricted permission by file sharing & security, now 1. I want to add one more restriction that owner of the folder should not able to delete that file? If this is
not available with Microsoft then
2. How do i recover file which deleted from MAP drive...
Please help me to resolve this issue...
Kalpesh ChauhanAs to your first problem, I am not so familiar. But, as to the second problem, I think I can help.
In fact, I have ever also accidentally deleted my hard drive files. In order to re-access them, I have also posted my question in forums, just like you. Fortunately, after browsing many related answers and threads, I just know that a third
party data recovery program can be a good chance to go on.
So, I follow some instructions in these forums and select three drive recovery freeware to go on, including Recuva, iCare Data Recovery Free and TestDisk and so on.
Finally, I have restored all my needed data back successfully with these freeware.
So, I hope it will also help you out.
PS: Never forget to back up everything important on different hard drives or places in case of any similar data recovery problems in the future. -
How to read .mdb file from shared folder
Hi All,
In one of my local computer I have a shared folder and within the folder I have a .mdb file. Now I am trying to read that file from MII. I have tried with Get_File_List action block. I am providing the following information to Get_File_List
Folder :
<Computer Name>\<Shared Folder Name>
Mask: .mdb
But in return of Get_File_List, I am not getting any file related information. It is only providing like below
<Rowsets>
<Rowset>
<Columns>
<Column Description="Name" MaxRange="0" MinRange="0" Name="Name" SQLDataType="1" SourceColumn="Name"/>
<Column Description="Date" MaxRange="0" MinRange="0" Name="Date" SQLDataType="93" SourceColumn="Date"/>
<Column Description="Size" MaxRange="100" MinRange="0" Name="Size" SQLDataType="4" SourceColumn="Size"/>
<Column Description="LastWriteDate" MaxRange="0" MinRange="0" Name="LastWriteDate" SQLDataType="93" SourceColumn="LastWriteDate"/>
<Column Description="ReadOnly" MaxRange="1" MinRange="0" Name="ReadOnly" SQLDataType="4" SourceColumn="ReadOnly"/>
<Column Description="FullPath" MaxRange="0" MinRange="0" Name="FullPath" SQLDataType="1" SourceColumn="FullPath"/>
</Columns>
</Rowset>
</Rowsets>
Can anybody suggest me how to achieve it.
Thanks in advance
ChandanHi Chandan,
Specify the mask as *.mdb and try.
Thanks,
Dipankar -
Archiving File on Shared Folder in Linux using java code
Hi All,
I have a requirement wherein I have to ftp a file (Feed.txt) from windows FTP server to Linux machine1 and archive the same file (with timestamp suffixed on file name like Feed.txt_22April) on Linux Machine2. I am
trying to achieve this through java code. I am able to ftp the file(Feed.txt) from windows ftp server to Linux machine1 /opt/ftproot directory and archiving the same file under /opt/ftproot/archive directory of Linux
Machine1 with timestamp suffixed on file name.
My archiving requirement is still not achieved. So, for that I created a shared folder /temp/shared on Linux Machine2 and mounted the /temp/shared folder of Linux Machine2 on /opt/ftproot/archive folder of
Linux Machine1 using following command:
# mount LinuxMachine2: /temp/shared /opt/ftproot/archive
Note: I have given full permission on both the folders.
Logically, archiving the Feed.txt with timestamp in it name under /opt/ftproot/archive folder should create the file in /temp/shared folder of Linux Machine2. But instead of archiving the file on
/opt/ftproot/archive folder, it archive the file on /opt/ftproot folder.
In my java code, I have specified copyDir as /opt/ftproot and archiveDir as /opt/ftproot/archive.
The code is being run from Linux Machine1 as a schedule task.
Please help.
PFB the code snippet:
package com.ftp;
import com.thortech.xl.scheduler.tasks.SchedulerBaseTask;
import org.apache.commons.net.ftp.*;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
public class FTPService extends SchedulerBaseTask {
private static String targetDir="";
private static String archiveDir="";
public void init() {
public void execute() {
try {
String server = "Machine1
String username = "username";
String password = "password";
String sourceDir = "C:\\Inetpub\\ftproot\\temp.txt";
//String archiveDir = "/home/ftproot1";
targetDir = getAttribute("Target Directory");
FTPClient ftp = new FTPClient();
* Connect to the server
ftp.connect(server);
ftp.login(username, password);
System.out.println("Connected to " + server + ".");
String[] names = ftp.listNames();
for (String name : names) {
System.out.println("Name = " + name);
* Get all file names that are present in the current working directory
FTPFile[] files = ftp.listFiles();
String fileName = "";
for (int i = 0; i < files.length; i++) {
if (files.isFile()) {
System.out.println("\t" + files[i].getName());
File file = new File(targetDir + File.separator +
files[i].getName());
FileOutputStream fos = new FileOutputStream(file);
* Copy the file to target system
ftp.retrieveFile(files[i].getName(), fos);
fos.close();
fileName = files[i].getName();
ftp.logout();
ftp.disconnect();
System.out.println("End of FTP....");
System.out.println("Calling fileCopy()");
System.out.println("Target Directory"+targetDir);
fileCopy(fileName,targetDir);
} catch (Exception e) {
e.printStackTrace();
public static String getDate() {
String sdate = "";
try {
System.out.println("Inside getDate()");
Calendar date = Calendar.getInstance();
SimpleDateFormat formatter = new SimpleDateFormat(
"yyyy-MM-dd HH:mm:ss.0");
sdate = formatter.format(date.getTime());
} catch (Exception e) {
return sdate;
public void moveFile(String t) {
try{
System.out.println("inside moveFile");
System.out.println("Moving Files");
File fro = new File(t);
archiveDir = getAttribute("Archive Directory");
System.out.println("Archiving Directory"+archiveDir);
File to = new File(archiveDir);
boolean archived = fro.renameTo(new File(to, fro.getName()));
if (archived) {
System.out.println("FileArchived");
/*String cmd="mv" +" "+t +" "+ "/home/ftproot/archive";
System.out.println("Archive Directory"+archiveDir);
System.out.println("Move Command"+cmd);
Process SshProc = (Runtime.getRuntime()).exec(cmd);
} catch (Exception e) {
e.printStackTrace();
public void fileCopy(String filename,String Directory) {
try{
//String ifile="/home/ftproot/sunny.txt";
String ifile=targetDir+"/"+filename;
String ofile=ifile+"_"+getDate();
File f1 = new File(ifile);
File f2 = new File(ofile);
InputStream in = new FileInputStream(f1);
//For Append the file.
// OutputStream out = new FileOutputStream(f2,true);
//For Overwrite the file.
OutputStream out = new FileOutputStream(f2);
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0){
out.write(buf, 0, len);
in.close();
out.close();
System.out.println("File copied.");
moveFile(ofile);
}catch(Exception e)
System.out.println("File copied."+e);
Cheers,
Sunnysunnyajmera wrote:
Please help.If it was me....
- You are connecting to a ftp server. I am guessing you didn't write that.
- Get a flexible ftp client, there are many but make sure it shows you the ftp result codes.
- Figure out how and if the ftp server will do what you want.
If it does do what you want then ftp client will let you do the same thing.
If that ftp server doesn't allow you to do it then you must do one of the following
- Find a different server
- Change the requirements
- Find a way to impose the requirements using a tool in addition to ftp like some command executed through telnet. -
Creating file in shared folder
I need to access a folder on a network ( say \\server1\test ). test folder is shared on \\server1 with permission only to user 'A'. Now a java program ( Simple code snippet given below ) running will not be able to access the given folder due to access restriction. How can I make this code access the given folder and create a file xyz.txt in it.
Code snippet :
import java.io.File;
import java.io.IOException;
public class test
public static void main(String[] args)
File file = new File(\\\\server1\\test\\xyz.txt );
try
file.createNewFile();
catch (IOException e)
// TODO Auto-generated catch block
e.printStackTrace();
}make sure that you have read and write permissions on that shared resource. i mean full access on that shared folder. with out full access you can't create/delete anything there. with read only access, you can read the content of the folder as well as that file only.
Diablo -
How to dowload files from a folder in domain
Hi
I've just started with coldfusion and i'm wondering is there any possibility to download files from domain shared folder, i was trying to solve the problem as same like files stored on local disk but it doesnt work, has someone idea how can i do this i will be thankfull
T.BrudnickiOk i used this example to tests but it still dosen't work
<html>
<head>
</head>
<body>
<cfinclude template="download.cfm">
Dupa i tyle i zacznijmu listowac <br>
<cfdirectory directory="\\pl1xpd-16286.ta.global\shared_data\applet\" name="dirQuery" action="LIST">
<br>Wynik<br>
<cfloop query = "dirQuery">
<cfoutput>
#dirQuery.name#
</cfoutput>
</cfloop>
</body>
</html>
it looks like that in this folder there is ona file but it doesnt list me, what iam doing wrong? -
How to store files in the cloud??
I just signed up to photoshop CC. How do I store files in the cloud?
Yes, finally, thank you.
I must say, this whole CC thing is opaque as far as learning something specific. The FAQ experience leads into a maze of irrelevant paths when you (rather, I) want somethin specific. I don't even know how to actually get into this forum -- I stumbled into it te first time, and the second, and now this time -- although your answer to my first question finally led me to set up the CC folder.
I hope things get easier from here. Having said that, I have to admit I don't know how to sign up to Behance. When I go there I have to sign in but I'm not given a place to Sign UP. Sigh. Maybe you can help me out again.
-yoram -
Can't Store Files in correct folder when Tethering in Aperture 2
Hi everyone,
I've been using Aperture 2 for two years now tether shooting with a Nikon D300 with no major problems with only minor problems along the way.
I'm now having problems when tethering storing my particular files in its designated folder. I have all my projects organized and referenced folders that mirror how my projects are organize. Its just one particular project and now I can not store file in its designated folder. When starting to tether, I can choose the correct project and from the Store Files drop down box, the designated folder is grayed out and I can't select the folder I want the images to store in.
If I select "Choose" from the drop down box, and then select the designated folder, Aperture selects the next folder down on the Store Files drop down box. It just started happening. I can correct the files location in Finder but thats just a nuisance. Its just this one folder thats giving me problems.
Any help would be appreciated? thx
fotokotoHi ana:
You might try indexing the external HD and see what happens:
http://docs.info.apple.com/article.html?artnum=301562
Barry -
Slow access to DBF files on shared folder in Win7 Prof
Hi,
I've a LAN based on 5 XP workstations and one Win7x64 computer with shared folder. No firewall, no antivirus software on this machine. There are some DBF-files in this folder. DOS application is running on these 5 workstations. This application uses shared
DBF-files. When I useed share folder based on XP-machine application worked normaly, access to these files was well rounded. After changing the "server" the access is never ending. Browsing/reading/writing data is a horror.
Have you any ideas?
Regards.Hi,
Could you please tell more details regarding this sentence” After changing the "server"
the access is never ending. Browsing/reading/writing data is a horror.”
How does the DOS application work here?
When we configured the application to access the DBF files on Windows 7, have we received any
special errors?
As the application worked well on the Windows XP workstation, might we consider to use process
monitor to compare with the same process on Windows 7?
Troubleshooting
with Process Monitor
Best regards
Michael Shao
TechNet Community Support
Maybe you are looking for
-
TS4020 Can I change my iCloud email address name without creating a new account?
CCan I change my iCloud email address name without creating a new account?
-
Authorize Computer with the latest version of iTunes installed?
I searched all the previous threads with detailed information on how to authorize your computer, and it goes like this: 1) Go to your library 2) On the menu bar, choose 'Store' and then from the drop down menu choose "Authorize Computer" I just downl
-
hi, we are using webforms (application server 11). when a client starts up a form in the browser the dialog for accepting the digital signature (oracle.forms.engine.Main) appears. in this dialog wether a button can be klicked nor the checkbox (always
-
Kodo 3.0.3 fails when detaching package local classes
When I try to detach a class that is package local to enforce usage of factories and interfaces Kodo throws the following exception: kodo.util.UserException: Cannot access the detached state of class "class xxx.core.model.competitor.CompetitorImpl".
-
How to find out theTables used in the program
hi experts, can any one tell what are the ways to find out the tables used in the program thanks in advance.