Flat file extraction with FILE
Hi BWers,
I want to extract a flat file to BW with an infopackage.
This flat file is located in a physical path changing according to the system :
- in the developpment server, path is :
...\dev\file.csv
- in the quality server, path is :
...\qual\file.csv
- in the production server, path is :
...\prod\file.csv
In the Name of the File into the infopackage extraction tab, i have to put the physical path or the logical file or routine.
I don't want to put directly the physical path, because i would have to change this path in qual and prod servers.
I don't want too to use a routine.
So I created a logical file with FILE T-code. But in physical path i put :
...\dev\<FILENAME>
How to put a directory variable like that : $(director)<filename> which says : if we are in Dev, so $directory =
...\dev\file, else qual...
Thanks for help.
Cheers,
Hi,
Here is the answer i found:
Use in FILE\Assignment of Physical Paths to Logical Path the variable like that:
<V=Z_INT_SRV>
Declare this variables in Definition of Variables.
Z_INT_SRV
Similar Messages
-
Batch file extracting all files from nested archives
I have managed to leverage a powerful
forfiles command line utility with the mighty
7z compression program.
Below is a simple batch file extracting all files from nested archives hidden at any depth inside other archives and/or folders. After the extraction each archive file turns into a folder having the archive file name. If, for example, there was an "outer.rar"
archive file containing nothing but an "inner.zip" archive with only "afile.txt" inside, "outer.rar" becomes "...\outer.rar\inner.zip\afile.txt" file system path.
@echo off
rem extract_nested_archives.bat
move %1 "%TMP%"\%2
md %2
7z x -o%1 -y %TMP%\%2
del "%TMP%"\%2
for %%a in (zip rar jar z bz2 gz gzip tgz tar lha iso wim cab rpm deb) do forfiles /P %1 /S /M *.%%a /C "cmd /c if @isdir==FALSE extract_nested_archives.bat @path @file"
ARCHIVES ARE DELETED DURING THE EXTRACTION! Make a copy before running the script!
"7z.exe" and "extract_nested_archives.bat" should be in folders available via the %PATH% environment variable.
The first parameter of extract_nested_archives.bat is the full path name of the archive or folder that should be fully expanded; the second parameter is just the archive or folder name without the path. So you should run "c:\temp\extract_nested_archives.bat
c:\temp\outer.rar outer.rar" from the command line to completely expand "outer.rar". "c:\temp" must be the current folder.
Best regards, 0x000000AFIncredibly useful! Thank you so much. I did make a couple of small changes to make the script a little easier to use from the end-user perspective.
First - I don't like making the user input the redundant second parameter, so I added this snippet which extracts it from the first parameter. The first line of the snippet enables delayed expansion so that special characters in our file name don't
break anything. The second line pulls the parameter into a variable, and the 3rd line uses delayed expansion on that new variable. Before implementing delayed expansion I had problems with file paths which included parentheses.
SetLocal EnableDelayedExpansion
Set SOURCE=%1
For %%Z in (!source!) do (
set FILENAME=%%~nxZ
set FILENAME=%FILENAME:"=%
Anyway once that was done, I just used %FILENAME% everywhere in the script instead of
%2 (making sure to correct quotes as needed)
This way, to run my script all you need to run is:
C:\temp\extract_nested_archives.bat C:\temp\Archive.zip
Second - I didn't want to modify the Windows environment variable. So I replaced
7z with "%PROGRAMFILES%\7-zip\7z.exe"
I also replaced extract_nested_archives.bat with "%~f0" (which represents the full path+filename of the current script).
Here is my full script now. Tested on Windows 8 with the 64-bit version of 7-zip installed:
@echo off
Setlocal EnableDelayedExpansion
Set source=%1
For %%Z in (!source!) do (
set FILENAME=%%~nxZ
set FILENAME=%FILENAME:"=%
move /Y %1 "%TMP%\%FILENAME%"
md "%FILENAME%"
"%PROGRAMFILES%\7-zip\7z.exe" x -o%1 -y "%TMP%\%FILENAME%"
DEL "%TMP%\%FILENAME%"
for %%a in (zip rar jar z bz2 gz gzip tgz tar lha iso wim cab rpm deb) do (
forfiles /P %1 /S /M *.%%a /C "cmd /c if @isdir==FALSE "%~f0" @path @file" -
FILE NAME WITH FILE EXTENTIONS
HI EXPERTS!!
I WANT TO GET THE FULL FILE NAME STRORED IN THE SERVER FOLDER. I USED FM RZL_READ_DIR_LOCAL BUT I AM GETTING ONLY 32 DIGITS OF NAME NOT FULL NAME AND ALSO SIZE PARAMETER IS CONCATENATING WITH NAME.
I WANT THE FILE NAME WITH FILE EXTENTIONS(TXT. .PDF ETC)..
PLZ SUGGEST ME HOW TO GET THE SAME..
PLZ REPLYE ME..
MAHESHHi Mahesh,
Try the below FM in the below code.
DATA:
LV_PERMISSION(10), " Permission
LV_H2, " H2
LV_FLNM(13), " File name
LV_USER(10), " User
LV_GROUP(10), " Group
LV_SIZE(15), " Size
LV_MONTH(3), " Month
LV_DAY_C(2), " Day
LV_YEAR(5), " Year
LV_FILE_NAME TYPE FILE_NAME, " Filename
LV_JUNK, " Junk
RETURN_CODE TYPE I. " Return code
DATA:
CMD_PARAMS LIKE SXPGCOLIST-PARAMETERS,
" External prg.parameters
CMD_OUTPUT TYPE BTCXPM OCCURS 0, " Log message
STATUS TYPE EXTCMDEXEX-STATUS. " Status
CONSTANTS:
LC_DIR TYPE C VALUE 'd'. " Directory
FIELD-SYMBOLS: <CMD_OUTPUT_LINE> LIKE LINE OF CMD_OUTPUT.
CMD_PARAMS = PV_DIRECTORY.
CLEAR CMD_OUTPUT.
CALL FUNCTION 'SXPG_CALL_SYSTEM'
EXPORTING
COMMANDNAME = 'Y_LS_LN'
ADDITIONAL_PARAMETERS = CMD_PARAMS
IMPORTING
STATUS = STATUS
EXITCODE = RETURN_CODE
TABLES
EXEC_PROTOCOL = CMD_OUTPUT
EXCEPTIONS
NO_PERMISSION = 1
COMMAND_NOT_FOUND = 2
PARAMETERS_TOO_LONG = 3
SECURITY_RISK = 4
WRONG_CHECK_CALL_INTERFACE = 5
PROGRAM_START_ERROR = 6
PROGRAM_TERMINATION_ERROR = 7
X_ERROR = 8
PARAMETER_EXPECTED = 9
TOO_MANY_PARAMETERS = 10
ILLEGAL_COMMAND = 11
OTHERS = 12.
Check Status first then check sy-subrc
CASE SY-SUBRC.
WHEN 0.
CASE STATUS.
WHEN 'F'.
MESSAGE I057(YS) WITH 'SXPG_CALL_SYSTEM'(002).
GF_EXIT = GC_TRUE.
WHEN 'E'.
MESSAGE I058(YS) WITH 'SXPG_CALL_SYSTEM'(002).
GF_EXIT = GC_TRUE.
WHEN 'S'.
MESSAGE I059(YS) WITH 'SXPG_CALL_SYSTEM'(002).
GF_EXIT = GC_TRUE.
WHEN 'C'.
MESSAGE I061(YS) WITH 'SXPG_CALL_SYSTEM'(002).
GF_EXIT = GC_TRUE.
ENDCASE. " CASE STATUS.
WHEN 1.
MESSAGE I048(YS) WITH 'SXPG_CALL_SYSTEM'(002).
GF_EXIT = GC_TRUE.
WHEN 2.
MESSAGE I049(YS) WITH 'Y_LS_LN'(003).
GF_EXIT = GC_TRUE.
WHEN 3.
MESSAGE I050(YS) WITH 'SXPG_CALL_SYSTEM'(002).
GF_EXIT = GC_TRUE.
WHEN 9.
MESSAGE I054(YS) WITH 'SXPG_CALL_SYSTEM'(002).
GF_EXIT = GC_TRUE.
WHEN 10.
MESSAGE I055(YS) WITH 'SXPG_CALL_SYSTEM'.
GF_EXIT = GC_TRUE.
WHEN 11.
MESSAGE I056(YS) WITH 'SXPG_CALL_SYSTEM'(002).
GF_EXIT = GC_TRUE.
WHEN OTHERS.
MESSAGE I022(YS) WITH SY-SUBRC.
GF_EXIT = GC_TRUE.
ENDCASE. " CASE SY-SUBRC.
IF GF_EXIT = ' '.
READ TABLE CMD_OUTPUT ASSIGNING <CMD_OUTPUT_LINE> INDEX 1.
IF SY-SUBRC = 0.
CONDENSE <CMD_OUTPUT_LINE>-MESSAGE.
IF <CMD_OUTPUT_LINE>-MESSAGE CS 'total' OR
<CMD_OUTPUT_LINE>-MESSAGE CS 'TOTAL'.
DELETE CMD_OUTPUT INDEX 1.
ENDIF.
ENDIF.
LOOP AT CMD_OUTPUT ASSIGNING <CMD_OUTPUT_LINE>.
CONDENSE <CMD_OUTPUT_LINE>-MESSAGE.
SPLIT <CMD_OUTPUT_LINE>-MESSAGE AT SPACE INTO
LV_PERMISSION
LV_H2
LV_USER
LV_GROUP
LV_SIZE
LV_MONTH
LV_DAY_C
LV_YEAR
LV_FILE_NAME
LV_JUNK.
IF LV_PERMISSION(1) = LC_DIR.
CONTINUE.
ELSE.
LV_FLNM = LV_FILE_NAME(13).
TRANSLATE LV_FLNM TO UPPER CASE.
IF LV_FLNM = '1W_FIARFUNNEL'.
PT_FILE-FILE_NAME = LV_FILE_NAME.
APPEND PT_FILE.
ENDIF. " IF LV_FLNM = '1D_FIARFUNNEL'.
ENDIF. " IF lv_permission(1) = ...
ENDLOOP. " LOOP AT CMD_OUTPUT
ENDIF. " IF GF_EXIT = ' '. -
Sender File Adapter with file conversion
Hi guys,
Im using a Sender File adapter with file conversion. The message to be processed has a structure with fixed lengths and in your content are some values that needs to be ignored.
An example:
value1 <b>value2</b> value3
I want to ignore <b>value 2</b> but I cant find a parameter for that! Do I need to define dummy fields on my data type and ignore those fields during mapping? Or there is a specific parameter for that?
Thanks in advance,
Ricardo.hi,
there always is another way:)
you can import the whole line to one field
and cut it inside the adapter module
(then you can define start and stop of the substring that you need to use)
but of course it's not standard even though it's quite easy to achieve in java
Regards,
michal
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a> -
Sign on problems within Elements 10; plus cannot backup, writing files error with file catalog.pse10db. No indication what the problem is. How do I get adobe help with these problems?
Sign on problems within Elements 10; plus cannot backup, writing files error with file catalog.pse10db. No indication what the problem is. How do I get adobe help with these problems?
-
Will the current plugins for Sigma DP1/2 RAW files work with files from the DP1/2 Merrill cameras? And if not, is Adobe developing plugins for these cameras?
Not sure what plugins you mean, Hornet - Lr doesn't rely on plugins to read new cameras.
If you mean the Adobe Camera Raw (ACR) plugin - that's for Photoshop, not Lightroom. Lr has the same functionality as ACR, but it's hard-coded into the program, so if you're looking for support for a new camera, you need to wait for a new version of Lr.
And nobody here can say when Lr support for a given camera will happen.
Hopefully someone with a Merrill will be able to chime in about whether its files work with the current Lr. -
Get additional file attachements with file adapter
Hello,
Has anyone ever had the following situation:
A Sender interface sends a little bit of data to XI.
This data contains the filenames of some files on a FTP server.
Based on these filename the file needs to be retreived from a FTP server and further handled as an attachement of the XI message?
Is it possible to trigger a sender file adapter with a variable directory and filename from XI, in a BPM or Mapping?
Warm Regards,
Leon Boeijenhi,
>>>>Is it possible to trigger a sender file adapter with a variable directory and filename from XI, in a BPM or Mapping?
no it's not possible to start a file adapter from BPM
you can use a java proxy that will do the trick
we've used a solution like this many times with no big issues
remember that it's better to use an async java proxy
(with correlation) then a sync one...
Regards,
michal
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a> -
Sender File Adapter with file conversion Multimapping
Hello all,
i have to use multimapping with the file sender adapter
XML for multimapping ist like this
ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1>
<ns1:KVNR_Senden_MT xmlns:ns1="urn:lsv.de/SENDER">
<Inhalt>
<KE/>
<VF/>
<BBNRAB/>
<BBNREP/>
<VERNR/>
<ED/>
<FEKZ/>
in File adapter
DocumentName Messages
RecordsetName Inhalt
Recorset Struc Inhalt,20
Inhalt.fieldFixedLength 4,5,6.....
Inhalt.fieldNames KE,VF,.....
but were can I generate Message1?????
any Hints?
regards
ralfsorry but the message tags will not be add dynamically
i have change an existing message mapping 1:1 with file content conversion
into a multimapping.
by changing into multimapping the message was surrounded with
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1>.......
no changing in File Adapter an in the IE there was an error
com.sap.aii.utilxi.misc.api.BaseRuntimeException geworfen: RuntimeException in Message-Mapping transformatio~.
if i added the stuct
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1>.......
by hand and it works???
so i think i had to add
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1>.......
to the file content conversion but i don't know how to do it???
Ralf -
Pdf files download with .file extension thus wont open as a pdf
Hi , when I try to download a pdf document with Firefox, the file downloads but add a .file extension thus wont open as a pdf.
I do not know if this is relevant but if you try to get the file to open with adobe viewer by telling the pc to open this type of file always with adobe viewer, nothing happens the tick box is greyed out, however if I double click the adobe viewer icon it will quite happily open the downloaded file as a pdfThe next time you download, STOP, and double check the full name of the file.
Firefox would not change the file name. But an add-on could. -
Received File send with file name to destination side
Hi All,
Here I have used FILE adapter in Receive location and WCF-BasicHttp adapter in send ports.
Requirment is should be able to send the file name also along
with the file to destination from BizTalk.
No orchestrations in this project. DynamicSendPassThru sendport. Please find the below screenshot for send port properties.
How can i fix this please assist me on this.
Thanks & Regards,
VasuHi Osman,
below code is custom pipeline code. and what code and where can i add the code.
regarding send the file with file name from BizTalk to OutBound transport location.
Please assist me on this.I'm not aware coding part.
publicMicrosoft.BizTalk.Message.Interop.IBaseMessageExecute(Microsoft.BizTalk.Component.Interop.IPipelineContextpc,
Microsoft.BizTalk.Message.Interop.IBaseMessageinmsg)
System.Diagnostics.
Debug.WriteLine("Inside
SendFileRenameWithDate Pipeline",
"SLNG.BizTalk");
IBaseMessageContextmessageContext = inmsg.Context;
// if the transport type is file for outbound, then change the add in the date in the file name.
stringadapterType = (string)inmsg.Context.Read("OutboundTransportType",
"http://schemas.microsoft.com/BizTalk/2003/system-properties");
// The file name in the file adapter must contain '%SourceFileName%', e.g. CB_%SourceFileName%.xml
if(adapterType ==
"FILE")
// Retreive the file name from the message context
//object obj = messageContext.Read("FileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties");
//string customSendFileName = obj.ToString();
//System.Diagnostics.Debug.WriteLine("FileName:" + customSendFileName, "SLNG.BizTalk");
// Append with date in ddMMyyyy_HHmmss format
stringcustomSendFileName =
if(string.IsNullOrEmpty(DateFormat))
customSendFileName =
DateTime.Now.ToString("yyyyMMdd_HHmmss");
else
customSendFileName =
DateTime.Now.ToString(DateFormat);
System.Diagnostics.
Debug.WriteLine("FileName:"+
customSendFileName, "SLNG.BizTalk");
// Write back with new file name to the message context
messageContext.Write(
"ReceivedFileName",
"http://schemas.microsoft.com/BizTalk/2003/file-properties",
customSendFileName);
//if (messageContext.IsPromoted("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties")
== false)
// messageContext.Promote("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties",
customSendFileName);
//messageContext.Write("FileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties", customSendFileName);
System.Diagnostics.
Debug.WriteLine("Going
off SendFileRenameWithDate Pipeline",
"SLNG.BizTalk");
returninmsg;
#endregion
Thanks & Regards,
Vasu -
Anyone know if the long standing duplicate files problem with File History has been fixed yet?
There are loads of public threads about the duplicate files problem
with Windows 8/8.1 File History backup system.
From all the threads I've looked at, there seems to be no solution,
and no acknowledgement from MS that they can even repro the problem
(which surprises me considerably as there are so many people who
notice the problem).
Is anyone aware of whether MS (may) have fixed this for Win10?
Are MS aware of the problem and if they're able to fix it?
Dave - with many GB of duplicated files in File History :)Hmm, is that the attitude MS would recommend? :)
Why would I care what Microsoft would recommend?
Clearly you don't, and you appear to have missed my smiley. Calm down
Noel, many of us are as annoyed by aspects of modern Windows as you
are. :)
I'm all about making Windows actually WORK/./
Aren't we all? Windows is software I use too many hours every day, I
along with many millions of others need it to work really well. You
are not alone.
When they implement something that doesn't work, and even if it did work doesn't do what's needed - and/beyond that/ they remove features people DO need (such as the GUI for Windows Backup), I see no wrong in advising people of the way things
really are.
File History essentially does work - it's saved me a couple of times
in the past couple of weeks. It just has a highly annoying habit of
creating 100% duplicates of some files for no apparent reason. If MS
have fixed that I won't have any known complaints about it.
If you don't like it, you don't have to use it. I generally like it, I
just want to see that its fixed.
Dave -
CS4 apps are VERY slow to open Windows file browser with File Open or File Save As commands
We are running CS4 on Windows 7 with all available updates installed. Photoshop and the other CS4 applications are VERY slow to open a Windows file browsing window to select files when File Open or File Save As menu options are run -- it can take as long as a minute or two for the window to open. Once the window opens and a file is selected, then opening or saving the file is very quick. The location of the default directory, whether it is on a local drive or a network drive, makes no difference. Any suggestions as to what the problem might be?
Raphman02
The link that I posted earlier is off. Read this one
http://support.microsoft.com/kb/2501584. I discovered in my network that the MS Office File Validation Patch made excel crawl when opening over the network though nothing else changed. At the time I was opening Excel on Office 2003.
You can manually turn this off by editing the registry and tunring it off. Going forward I skipped the patch to keep my sanity. Not sure if this is the same as your issue, but the support article will go into detail how to either have Fix it
clear the issue or change the proper registry keys.
Hope this helps -
JBIG2 Object Stream - Extract with file header?
Hello,
I'm attempting to extract JBIG2 images only from a PDF. The only problem is that the JBIG2 images are raw data streams without a header, and so I can't just save it into a .jb2 file, as no application will recognize it.
It looks like this:
<</Subtype/Image/Width 1740/Height 3002/ColorSpace/DeviceGray/BitsPerComponent 1/Decode[1 0]/Length 12268/Filter/JBIG2Decode>>
stream
(DATA)
endstream
etc.
I can easily extract the data, but how can I repair the header?
Thank you.You will need to learn the JB2 file format and construct one based on the data in the ImageXObject dictionary.
Don't forget that JB2 also supports a global data block in the PDF as well, you will need that too! -
Receiver File Adapter with File content Conversion
I have a requirement to send 2 different files to the target directory. Source is the same and different mapping for the 2 files.
This I can achieve through multi-mapping but there is a problem. How can I use the File content for receiver File adapter which is using Multimapping.
The structure of the 2 files also different.Why would you need FCC on receiver file adapter? If you need different files to be generated from the source, you could create two receiver channels with different mappings and just add them to the same Receiver Detemination. Isn't feasible?
-
Dynamic file naming with File/FTP adapter
Hi all,
I have a requirement for writing files with names of the files based on a customer ID.... a dynamic name based on a value retrieved from the customer DB.
I have already tried using the dynamic file naming suggestion in the bpel dev guide, it does not work. I followed the instructions, the process fails to compile and throws "part" and "undefined variables" errors etc.
Has anyone succesfully used file/ftp adapter to write files with dynamic file names (using a varibale), not %SEQ% or %datetime% formats?
Thanks,
HasanYou can create a header variable that will allow you to set the outbound file name inside the process. This variable is a message type. From the type chooser select:
Message Types
Partner Links
Outbound Partner Link
Outbound wsdl
Message Types
Imported WSDL
fileAdapterOutboundHeader.wsdl
OutboundHeader_msg
This variable will have a part filename.
Set this part to whatever you wish your file to be named.
Select the invoke to your outbound file/ftp partnerlink. Move to the adapters tab and select the header variable you created as the Input Header Variable.
Maybe you are looking for
-
How to pass the context from Portal to Database for fine grain access?
Hi, I am developing an omniportlet and I need to pass on the context of the logged in user to the database so that when the user tries to access data in the omniportlet, he can see data relevant to him only. Does anyone know how to do that? I have se
-
We have a company written PPTX that is 9 megs in size. We can load it fine in Keynote on an iPod 5 running IOS 6.1.3, but cannot on an iPad or iPhone running 7.1.1 or the previous version of IOS. Keynote has been removed and reinstalled on the 2 de
-
How to used BAPI_SALESORDER_CHANGE to add items
Hi, I am trying to use the above bapi to add items to a sales order, but I can't get the qty to map across. I had the same problem using the create bapi whcih I resolved by populating the schedule tables, but in change this just causes an "unhandled
-
Clustered timers object is not an instance of declaring class
WLS 12.1.3 installation, one cluster of two managed servers. An enterprise application contains 3 EJB timers. Timers are clustered and persisted to DB (table WEBLOGIC_TIMERS). The application is written for JEE version 5 and timers are coded accordin
-
Mail 2.0.5 initialisation fails
Having installed OS X 4.3 on a new disk partition I tried to initialise Mail 2.0.5. After entering the incoming server and the mail type (POP), a waiting wheel appears for a while with the message "Checking connection to POP server "in.versateladsl.b