Passing file name dynamically to the file adapter
Hi All,
I'm using a file adapter to create a file from the XML message after mapping in XI. The file name is given in the file adapter configuration. Is it possible to have the file name as a part of the message and pass it to the file adapter dynamically? Or is it possible to have the file name in some variable or something in XI (like a BPM variable) and pass it to the adapter for every message?
Does someone have any idea?
Thanks,
Sandeep
Hi Sandeep,
This is possible.
For creating filenames dynamically for your sender, you will have to crate a variable name ( eg: %VAR%) as you file name and then you will have to give the name of your file under variable substitution. Just check this link for more info,
http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
In the case of receiver file adapaters, you have 5 options for file creation like,
1.Create
2.Append
3. Add time stamp
4.Add Counter
5. Add Message ID
You can choose any of these options or you can do it dynamically from you payload. Just check out this help link for more info,
http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
Hope this helps
Similar Messages
-
I get this message when I try to import some CD's to my library.
A window pops up and says
Error occurred while converting the file "name of song"
The file name was invalid or to long.
Anyone else ever get this message, and how can you import CD's???????I have had this exact same problem. I'm not sure how to fix it...
-
How to generate file name dynamically in receiver FIle adapter? Please help
Dear Experts,
I have a scenario where I need to generate output file with the name dynamically pulled from the XI payload.
In receiver File communication channel I don't see any option where we can specify the XML path for the file name.
For example:
If my inbound XML structure (inbound interface) is like below:
<filename>file123.txt</filename>
<RootNode>
<Element1>Product123</Element1>
<RootNode>
From this I need to pick the filename value and generate the output file with the same value.
How can I achieve this? Please help!
Thanks & Regards
Gopal
Edited by: gopalkrishna baliga on May 3, 2011 1:10 PMGopal,
You can use DynamicConfiguration class for this.
You need to write UDF for this and with input of filename you want to set and map this UDF to the top level node.
Refer the below famous blog from Micheal:
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
You can also use Variable substitution to get value from payload, search SDN on this.
--Divyesh Vasani -
Save image to camera roll with specified file name or get the file name
I am saving an image to camera roll but don't see an option to save the file using a custom name. Is it possible to do so? or is it possible to get the name of the file saved?
Ensure you have set the correct capability in your app to save the picture with the exact name you specified.
You can try the code below to iterate through all pictures in the cameraroll album and find out if the name exists.
using (var mediaLib = new MediaLibrary())
var camRollAlbum = mediaLib.RootPictureAlbum.Albums.Where(a=>a.Name == "Camera Roll").FirstOrDefault();
foreach (var pic in camRollAlbum.Pictures)
string picName = string.Empty;
if(pic.Name.Contains("Selfie"))
picName = pic.Name;
Let me know if this helps.
Abdulwahab Suleiman -
Need example to create File names dynamically using File adapter
hello,
I am mapping an IDOC to a flat file using XI and a file adapter. I need to be able to output a file name dynamically depending on the data in the IDOC. For example if the IDOC has 310 as the company code, the file name should be xyz.310 and if the IDOC has 600 as the company code, the file name created by the file adapter should be xyz.600. Please some body provide me with an example of the XSLT code that I will have to write in the dispatcher User Exit.
Any help will be greatly appreciated.Nope
But you could add a dummy row to your source to include column headers and then use options column headers in first row in flat file connection manager.
So suppose you've three columns column0,coulmn1,column2 and you want to make it as ID,Name,Datethen make source query as
SELECT 'ID' AS Col1,'Name' AS Col2,'Date' AS Col3, 0 AS ord
UNION ALL
SELECT Column1,Column2,Column3,1
FROM YourTable
ORDER BY Ord
then choose column headers in first row option
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
Passing file name dynamically to sql loader ctl file
Hi,
I am new to scripting and I have a complex requirement involving writing a script.
Requierment:
I need to upload a CSV file from a FTP server into oracle table using SQL Loader. The file name resembles like APF0912312359.csv represents 31-DEC-2009 23:59 and there will be multiple files in same day indicated by differnt timestamp as its filename. Once I load a file using SQL loader, I need to move the file to another directory for archival.
Since the sql loader ctl file has a fixed file name, I would like to know how I can pass the file name dynamically to ctl file to load a new file every time it runs.
Any help is greatly appreciated..
Bye
Sudheer
Edited by: user2138419 on Oct 28, 2009 4:08 PMI agree with Pradeep in regards to declaring the file names on the command line. However, I do have a concern regarding presenting the password on the command line as any user that can issue a ps (assuming Unix ~= Linux here) would be able to read it while the sqlldr command is running.
Unfortunately, you may not always have the option of declaring the files on the command line. I was recently challenged with this in a Windows 2003 Server environment running SQL*Loader: Release 10.2.0.1.0. In this environment I found that I am able to set a variable file name in a calling batch file and use that value in the control file successfully. Just to demonstrate the approach:
Batch file:
set IN_FILE=’c:\inbound\load_me.txt’
sqlldr user/pswd@db PARFILE=’c:\parameters.txt’
Parameter file:
errors=500000
rows=50000
control=%CTL_FILE%
bad=%BAD_FILE%
discard=%DSC_FILE%
log=%LOG_FILE%
Control file:
LOAD DATA
INFILE ‘%IN_FILE%’
INSERT
INTO TABLE table_to_be_loaded
I’m really interested to see if this would work on Unix.
-Luke -
Passing file name dynamically in Synchronous read operation of FTP adapter in OSB
Hi,
We are implementing the integration in OSB 11g and using FTP JCA adapters to check if the file exists in the FTP location or not. We are using Synchronous read operation of FTP adapters. We need to pass the file name dynamically at run time. In the JCA file we can hard code the file name. How that file name can be taken dynamically using OSB.
Regards,
SharmisthaHi Sandeep,
This is possible.
For creating filenames dynamically for your sender, you will have to crate a variable name ( eg: %VAR%) as you file name and then you will have to give the name of your file under variable substitution. Just check this link for more info,
http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
In the case of receiver file adapaters, you have 5 options for file creation like,
1.Create
2.Append
3. Add time stamp
4.Add Counter
5. Add Message ID
You can choose any of these options or you can do it dynamically from you payload. Just check out this help link for more info,
http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
Hope this helps -
Error in reciever file adapter , where i am getting file name dynamically
hi all,
error in reciever file adapter , where i am getting file name dynamically, please help me in this isssue , i am trying for a long time
MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'Conversion configuration error: Unknown structure 'ns0:MT_eINVOICE_RECV' found in document', probably configuration error in file adapter (XML parser error)': java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'Conversion configuration error: Unknown structure 'ns0:MT_eINVOICE_RECV' found in document', probably configuration error in file adapter (XML parser error)'i am getting new error
MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: Channel has not been correctly initialized and cannot process messages
this is my strcuture
and i have changed my structure
<HEADER>
<ADDRESS1/>
<ADDRESS2/>
<ADDRESS3/>
<ADDRESS4/>
</HEADER>
<HEADER_GST>
<TAX1/>
<TAX2/>
<TAX3/>
</HEADER_GST>
<LINE>
<QTY/>
<UOM/>
<UNIT_AMT/>
<CHARGE_TO_DT/>
</LINE>
<FILENAME>
<FILENAME/>
</FILENAME>
i have given the recordset structure as
HEADER,HEADER_GST,LINE,FILE -
Question about pass file name and path to file write adapter
I need to pass file name and path to file adapter for write. I got partial answers from thread Re: Get File name using File Adapter , but seems InboundHeader_msg or outboundHeader_msg only takes file name, how do I pass file directory?
since I still have to specify file format (like xxx_%xx%.txt) in the file adapter wizard. Will this name conflict with what the name defined in InboundHeader_msg ?
Similarly, how can I pass a file name and path to a file synchread adapter?
Thanks,
Message was edited by:
user531689Just overwrite the filename in the WSDL file that was generated
-
Dynamic File Name depending on the Source File name
Hi Experts,
I have a problem like Dynamic File name depending on the Source File Name. I will explain with example as follwos
Source File name Targer Folder/Filename
NK01.VR59.L2007030 VR59/Rec.l200
NK01.VR71.L2017030 VR71/Rec.l201
NK01.VR77.L2027030 VR77/Rec.l202
See above the exaple, Depending on the Source file name, I am deciding where i need to place my file and what name i need to name it.
So please suggest me the solution and How can i do this with a single communication channel ? Do i need to create multiple CC for each folder??
Points will be rewarded for Valuable anwer.
Thanks in Advance,
Best Regads,
VijayHi VIjay,
Thanks for quick reply. But i am getting error in End to End Scenarios only. If i remove the Return " " statement from the UDF, while activating it is showing the error saying like missing return statement. I also mapped to the top most node to this UDF.
I am getting the following error in End to End error Scenarios:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <!-- Request Message Mapping
-->
- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
<SAP:Category>Application</SAP:Category>
<SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>
<SAP:P1>com/sap/xi/tf/_MM_Target_File_determined_</SAP:P1>
<SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException</SAP:P2>
<SAP:P3>Fatal Error: com.sap.engine.lib.xml.parser.Parser~</SAP:P3>
<SAP:P4 />
<SAP:AdditionalText />
<SAP:ApplicationFaultMessage namespace="" />
<SAP:Stack>During the application mapping com/sap/xi/tf/_MM_Target_File_determined_ a com.sap.aii.utilxi.misc.api.BaseRuntimeException was thrown: Fatal Error: com.sap.engine.lib.xml.parser.Parser~</SAP:Stack>
<SAP:Retry>M</SAP:Retry>
</SAP:Error> -
Passing file name variable to the save as dialog
Hi:
I have an event listener that checks if the user has selected the file/"save as" menu and brings up another dialog window asking for some additional information about the client and job. I would like to pass a variable from this custom dialog to the file name field in the standard Save As dialog.
Anybody have an idea how I can do this?
I am using inDesign3 on Windows XP. I am using VB for the scripting.
thanks!!
DanHi: thanks for looking at it.
Actually, I am not calling the save as in my script, the user is clicking on Save As and the event listener I have in the start up folder is picking that up. The event listener calls up a script that asks users to fill in a couple of fields about the specific job and once they do that and click ok, the default inDesign "save as" dialog is brought up. So that is my question -- how to pass the information from my dialog to the standard "save as" dialog (as the file name of the file).
The event listener is of the beforeInvoke on the Save As... menu.
Any idea?
thanks!!
Dan -
Log4j - issue in configuring the file name for daily rolling file adapter
We have configured the log4j properties. We want to create back-up of log file each hour. The file name of the log file is MyApp.log and as per the below configuration after each hour backup file is created as
MyApp.log<<time>>
but we want that file should be created in follogin format
MyApp<<time>>.log
Below are the log4j properties configured, please let us know, what should be the correct option to create the filename in desired format.
# Set root logger level to DEBUG and its only appender to MyApp.
log4j.rootLogger=DEBUG, MyApp
log4j.appender.MyApp=org.apache.log4j.DailyRollingFileAppender
log4j.appender.MyApp.File=D:/logs/MyApp.log
log4j.appender.MyApp.DatePattern='.'yyyy-MM-dd-HH
log4j.appender.MyApp.Append=true
log4j.appender.MyApp.layout=org.apache.log4j.PatternLayout
log4j.appender.MyApp.layout.ConversionPattern=[%d{yyyy-MM-dd} %d{HH:mm:ss z}] %m%nyes you can use /SAPDMC/SAP_LSMW_IMPORT_TEXTS via LSMW
In the SAP system, there is no uniform rule for the structure of the actual text key Textname. However, in order to be able to maintain the structures and fields, you have to know what the structure of text name as well as the values for text object and text ID are.
Procedure
1. Display a text of the required text type.
2. Branch to the editor.
3. Choose Goto > Header.
The Text header dialog box appears.
Result
In the Text header dialog box, you gather the required information. -
Dynamic File Name in a Read File
Hello there.
I have a need and I don't know if there is possible in Oracle BPEL 10.1.3. I need to read a different file, based on the name of it. So, I need that the file name defined in the adapter is defined dynamically in run time, based in the name of a client.
It is possible ?
All the files are located in the same directory, so, I don't have a problem with the location path. Only with the name of the file.
In a read activity I don't have the Inbound Header...it is possible to do this using the OutboundHeader Type ?
Can someone help me ?What you need to do is a synchronous File read. You will need to create a file adaptor but with the write functionality and then change the produced wsdl file to make it a read activity. You can then use the invoke activity to call the adaptor. Once this is done you can then create the variable as RIko has specified an pass in your file name at run time.
The inboundheader type variable is only populated once you have read the file. So by changing a write adaptor to a read you will have both a inbound and outbound header variables.
See link below for a more detailed description:
http://docs.huihoo.com/oracle/docs/B14099_19/integrate.1012/b25307/adptr_file.htm
See the section on "Synchronous File Reading Capabilities" which details exactly what you need to change. -
Receiver file name should contain the same plant value as sender filename
Hi All,
I have a requirement in PI 7.0 and the scenario is synchronous which is as follows:
- XI will read a flat file which has the naming convention Plant_100.txt where 100 is the plant number , after reading the file XI will trigger standard BAPI call to ECC system.
- ECC system will return an response message back to XI , XI need to need write this message in to a log file and the file name should be Plant_100_logs.txt.
- Here plant value 100 is neither passed to ECC system nor this value will be returend back from ECC system . So , is there anyway where we can make sure that plant value can be added to the log file without using an BPM in between ??
Regards
Vinay P.Hi,
Using Dynamic configuration in Message mapping you can read the source file name and creta the target file name as same as source file.
For BAPI call in Mapping you can use RFC lookup.
So crete a scenario FILE to log FILE
In mapping using RFC lookup make a BAPI call.
And use dynamic configuration to set the file name.
Refer this
http://www.****************/Tips/XI/ASMA/Index.htm -
PI needs to obtain a zip file via FTP using the File adapter
I have a scenario where PI needs to obtain a zip file via FTP using the File adapter, this zip file contains a number of txt files that I need to process, and the content of one of them send it to an ECC, now I'm using the PayloadZipBean Module in the Sender FIle Adapter, and I have two things if I use the Message Protocol as File, I get a Payload for each txt file in the zip file, but this payload has no structure, and if I use the File Content Conversion I get an XML strcuture with only one field and a strange string in it, and somewhere in this string the names of the files I assume all the content of the zip file, can anyone help on how could I achieve what I need that is to pull the zip file via SAP PI, then unzip it, and with the content of one of the txt files send it to an ECC via ABAP Proxy, thanks in advance for your answers.
Regards,
Raul AlvaradoHello Raul,
you can do it in futher way ...
pickup zip file and simply extract and dump it in another temp folder (can use scripts on OS level).
@ then Use another sender communication channel to pickup all these text file .
for further clarification you can use these links also. -
Process txt files in zip file
Accessing File using FTP from Java Mapping
File Sender Adapter with FTP protocol
BR
Raj
Maybe you are looking for
-
How To Control Af:panelspliter At Runtime
I have a panel splitter layout component on my page and i want to enable/disable this splitter at run time from within a managed bean In my managed bean I made this method public class ManageUI { private String enableSplit; private String dis
-
Best practice for calling application module methods and plsql code
In my application I am experiencing problems with connection pooling, I seem to be using a lot of connections in my application when only a few users are using the system. As part of our application we need to call database procedures for business lo
-
Play Waveform Express vi: How to disable "Normalize waveform"?
I am an EE professor. My students are using LabView to develop simple music synthesizers. How can we disable the "Normalize Waveform" function within the "Play Waveform" express vi, so that we can control volume with amplitude?
-
Pass Work Order attachments to Workflow container
Hi experts, I have a question concerning passing attachments from Work Order to Workflow(or Task) container. There are several files attached to Work Order in TCode IW32. The files are attached directly and are saved on SAP server. Not via URL. I hav
-
ECC 6.0 Installation Error - urgent
Hi All. Im installing ECC 6.0, have passed the 41st phase of installation. The installation has aborted at the next stage. The error that i get is FKD-00049 XML parser error. When i start sapinst and continue the installation sapinst exits on its o