I am trying to reverse engineer a csv file, so that I would use it to create an ODi mapping to load data from file to table. While doing reverse engineering under Attributes tab, I face the below error -
java.net.MalformedURLException: no protocol: #PROJECT.DIRECTORY_PATH/#PROJECT.FILE_NAME
where #PROJECT.DIRECTORY_PATH is a project-specific variable to get the unix directory path where the file resides and PROJECT.FILE_NAME is a variable indicating the file name. Could anyone please help me find the cause of this error? TIA.
I tried validating the queries which I had used in the variable and they seem to fetch the correct results for the directory path and the file name.
try with the name of the file in clear. I think that you cannot use variables there!
Related
I have got a service running in a specific directory in 5-second-intervals which is picking up an XML file created in that directory sending it for some necessary authorization checks to another client and then requesting a response file.
My issue is that my Z_PROGRAM creating the XML file might take longer than 5 seconds as a result of the file's size. Therefore creating the file in that specific directory is not preferable. I thought about creating a new folder in that directory called "temporary" and creating the file inside that folder, then once I'm done with it, moving it back outside for the service to pick it up.
Is there any way to move files from one directory to another via ABAP code only?
Copying the file manually is not an option since the problem that I have during file creation still persists. I need 2 alternatives, one used for local directories and one for application server directories. Any ideas?
Generally, we create another empty file for completed files after the file creation process ends. Third parties must be firstly checked empty file is there. Example:
data file.csv
data file.ok
If you already completed your integration and it is not easy to make any change with third parties, I prefer using OS level file moving commands. Sample document here. You can use mv for Linux server and move for Windows. If your file is big, you will get same problem with OPEN DATASET concept. We have ARCHIVFILE_SERVER_TO_SERVER FM for moving files but it is also using OPEN DATASET.
there is no explicit move command in ABAP code that move or copy files between directories in application server.
there is two tips can be helpfull in your case. if you are writing big file you may seperate the logic behind collecting data and writing file. I would say don't execute transfer data inside your loop. instead collect you data into an internal table once you're done, loop over this internal table and write direclty strings without any delay you should be able to write a big files upp to several hundred of MB under 1 sec.
next tips is to not modify your program, or if you are using function modules to construct xml is, write to a temp directory after finishing, then have another program open you file on source directory by read dataset and directly write data to the new directory again just strings without interruptions.
you should be ok if you just write strings.
You can simply use System Call Commands to perform actions in Application Directory.
CALL 'SYSTEM'
ID 'COMMAND'
FIELD 'mv /usr/sap/temporary/File.xml
/usr/sap/final/file.xml'
All,
I've got a package that downloads Excel files from an FTP site then loads them to a table in SQL Server at at the end archives the files to another folder.
I've written packages like this hundreds of times, and in fact have similar packages running here now.
However with this particular package the archive task is failing with the error "The parameter is incorrect".
I've compared it to other similar packages and the set up is the same.
I'm at a loss as to what could be causing this.
I've got source, archive and filename as variables, and the foreachfile container works fine and loops through the files with no issues. It's simply the move file task that fails.
Here are some screen shots for clarity's sake:
Variables:
ForeachFile containier:
Move File:
Well the solution was to create a new data connection to the existing source directory and use that in the move file task along with the variable for the archive path.
I had the same problem my fix was to copy the file instead and add another task to the loop after that and delete the files
I had this error as well and found out that the "Destination" must not contain a file path but a folder path. But I guess it's not your case.
If that can help other people.
My source: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/6db138e2-bb24-41de-a28c-7c61eee59f31/filea-system-task-copy-works-but-move-fails?forum=sqlintegrationservices
I am currently working on an installer for my software using the WiX toolset. Today I faced the problem of getting only the name of an file. In the main file I include another .wxs file, which is generated automatically and defines the files of the application. In this main file I want to get the file name of a file referenced in the included file. I know, that
[#FILE-ID]
returns the full path to the file with the specific id, but how can I get only the file name?
Is there an similar opportunity or are there any substring operations in Wix? I did not find any solution in the internet yet and hope, you can help me.
I want to load data into a greenplum database with gpload.py (Windows Server). But I only get a weird output:
|ERROR|A gload control file processing error occured. The gpload:input:source(1):file entry must be a YAML sequence
I tried to use gpload with linux and it worked fine. So my yaml file and my input data should be correct.
Does anyone know how to fix that problem?
You should post the yaml config file you are using to make sure there are no other problems. But I would guess since you said that it works on linux but not on windows that you have a line ending problem.
YAML files are line and whitespace sensitive. Try editing the file with a local editor on the Windows machine.
I tried to list the files in my local directory as well as to read a file. But was not able to do it. Can any one give me sample code to get the list of files in a directory using gwt-filesystem.
It depends from where you are reading. You can't obviously read from the client due to security issues (any HTML wouldn't let you do that). However, you could obviously read the list of files in a folder from the server side.