Dynamic file names in outbound file adapter

I have to configure a flow in XI system wich takes an input file from one machine and after mapping process leaves the output file in target machine with the same name of input file.
Name of input file won't be always the same (*.dat) so i cannot hardcode this name in outbound file adapter.
Does anyone know how to transfer input filename from inbound file adapter to XI message and then to outbound file adapter?
I know there is an option to create dynamic file names in file adapter but i think it isn't enought to solve my problem.

I have to configure a flow in XI system wich takes an input file from one machine and after mapping process leaves the output file in target machine with the same name of input file.
Name of input file won't be always the same (*.dat) so i cannot hardcode this name in outbound file adapter.
Does anyone know how to transfer input filename from inbound file adapter to XI message and then to outbound file adapter?
I know there is an option to create dynamic file names in file adapter but i think it isn't enought to solve my problem.

Similar Messages

  • Error dynamic File Name in Receiver File Adapter

    Hi all,
    Dynamic file name for Receiver file Adapter Problem
    my multi mapping look like this in design mode
    messages
         message1
              SD01_E
                   FileName
                   row
         message2
              SD02_E
                   FileName
                   row
    by processing the xml look like this:
    <ns2:SD01_E xmlns:ns2="urn:lsv.de/SAP/XXX">
    <FileName>L40SA939.xiConstant</FileName>
    - <row>
    or
    <ns2:SD02_E xmlns:ns2="urn:lsv.de/SAP/XXX">
    <FileName>L40SA939.xiConstant</FileName>
    - <row>
    in file receivere adapter  i have try this but it dos not work
    payload:SD01_E,1,FileName,1
    Error:com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 0(:main:, row:1, col:0)
    is there any way to have access to Filename  in different root elements??
    regards
    Ralf

    Hi Ralf,
    i think, you need for each XML msg (each different root element) a new adapter -> a new IF determination, new rec agreement and a new channel.
    Regards,
    Udo

  • How to apply input file name to output file in file adapter

    Hi Friends
    In my file to file scenario,i want to use input file name to output file by using adapter specific attributes,for this i have java code.Please suggest me how can i use this java code in mesg mapping and to which field i need to mapping this.
    Thanks
    pullarao

    Hi Pullarao,
    I have two questions ...
    1. Are u want the static file name in the target file?
    if yes...then follow the Bhavesh instruction.
    2.If u want a dynamic file name in the target file using UDF....then your UDF should mapped to the <b>root element</b> of target structure.
    /**********UDF********/
    Imports: com.sap.aii.mapping.api.*;
    Parameter: String filename
    String filename;
    filename = fileName + ".DAT";
    DynamicConfiguration conf = (DynamicConfiguration) container
           .getTransformationParameters()
           .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "FileName");
    conf.put(key, filename);
    return filename;
    /*******END UDF*******/

  • How to find the File name using the FTP Adapter

    hi all,
    how to find the File name using the FTP Adapter with BPEL.
    Regards

    Found the solution for this.
    First In the mediator's routing rule use assign property $in.property.jca.file.FileName to $out.property.jca.file.FileName
    In the BPEL's receive activity go to the properties tab and get the property to a BPEL variable. That should do it.
    Thanks for the posts

  • How can transfer the read file name via own developed adapter module

    Hello experts,
    I want to know how I can handle the following issue:
    I developed a J2EE adapter module for the file adapter "sender" with the aim to read the file name of incoming files. Thereto I implement the following code like this:
    public ModuleData process(ModuleContext mc, ModuleData md) throws
    ModuleException
    Hashtable mp = (Hashtable)
    md.getSupplementalData("module.parameters");
    String fileName = null;
    if (mp != null)
    fileName = (String) mp.get("FileName");
    Now I get the filename which includes a order nr.  I need this order number to call a RFC Adapter via mapping. So my question is how can transfer this order nr to the RFC adapter?
    Kind regards,
    Fatih

    Hi,
    >> to read the file name of incoming files
    Use file adapter with Adapter specific identifiers selected.
    >>Thereto I implement the following code like this:
    use udf in message mapping and avoid module
    >>Now I get the filename which includes a order nr. I need this order number to call a RFC Adapter via mapping. So my question is how can transfer this order nr to the RFC adapter?
    use RFC Look up function in message mapping...
    Is module so necessary in this case???
    Regards
    Suraj

  • To retain the same file name in target(File) that coming from source system(AS2).

    Hi All,
    I have a requirement to send the two file from the third party system(GXS) to SAP ECC via SAP PI(version - 7.4). We are using AS2 adapter at the sender side to pick the file and using File Adapter to place the file in ECC.
    Its a pass through scenarion(No ESR part is used).
    Requirement:
    We are going to get 2 files ->Example:  one from Axis and another one from ICICI -> each bank file will have a file name ->
    We have to post the file at the target system with the same name as source file name, the source file name could come dynamically(with diff time stamp).
    Please let me know, Is it possible to achieve the above requirement(we have to retain the file name in target that coming from source system) with Sender AS2 adapter, If yes then please suggest the best approach.
    Regards,
    Pradeep Bawlia

    Hi Guys,
    The above requirement is solved now.
    Solution - I used java mapping for extracting the same source file name and assignning the same to the target system.
    Code:
    public class ExtractFileName_ASMA extends AbstractTransformation{
    public void transform(TransformationInput in, TransformationOutput out) throws StreamTransformationException  
    DynamicConfiguration conf=in.getDynamicConfiguration();
    DynamicConfigurationKey key_AS2FileNmae = DynamicConfigurationKey.create("http://sap.com/xi/XI/AS2/AS2", "AS2Filename");
    DynamicConfigurationKey key_FileNmae = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File", "FileName");
    String As2FileName=conf.get(key_AS2FileNmae);
    conf.put(key_FileNmae, As2FileName);
    try{
    byte b[]=new byte[in.getInputPayload().getInputStream().available()];
    in.getInputPayload().getInputStream().read(b);
    out.getOutputPayload().getOutputStream().write(b);
    catch(Exception e)
    2. Another solution we can use the graphical mapping and need to use the dynamic config UDF at mapping level to acheive this requirement but here is one drawback - we need to do content conversion is this case.
    In case of Java mapping, no need to play with source file.
    WITHOUT USING ESR, WE CAN NOT ACHEIVE THIS REQUIREMENT.
    Regards,
    Pradeep Bawlia

  • Configure receiver file name as Sender file name

    Hi All,
        In PI7.1.  We have scenario(file to file). Here the sender system send multiple files and In the receiver system we need to populate the same filenames as Sender file Names.
    Could you please let me know is there a configuration to have Receiver file schem name As like sender file names.
    Thanks in Advance,
    Naga.

    Hi Naga,
    This can be achieved using either variable substitution or Dynamic Configuration by enabling Adapter Specific Message Attributes in sender and receiver file channels.
    If the sender file name and receiver file name needs to be exactly same then just check Adapter Specific Message Attributes in advanced tab of both sender and receiver channels. Check on File Name under that.
    Lot of help over this is already available in sdn, kindly serach and you will get lot of helpful blogs and wikis
    Regards,
    Gautam Purohit
    Edited by: Gautam Purohit on Apr 16, 2010 11:26 AM

  • I can not transfer date from one hard drive to another, I keep getting an error because I have two of the same file names and one file name is in caps and I cant change the file name

    can not transfer date from one hard drive to another, I keep getting an error because I have two of the same file names and one file name is in caps and I cant change the file name. My original external has an error and needs to be reformatted but I dont want to lose this informations its my entire Itunes library.

    Sounds like the source drive is formatted as case sensitive and the destination drive is not. The preferred format for OS X is case insensitive unless there is a compelling reason to go case sensitive.
    Why can't you change the filename? Is it because the source drive is having problems?  If so is this happening with only one or two or a few files? If so the best thing would be to copy those over individually and then rename them on the destination drive.
    If it is more then you can do manually and you can't change the name on the source you will have to reformat the destination as case sensitive.
    Btw this group is for discussion of the Support Communities itself, you;d do better posting to Lion group. I'll see if a host will move it.

  • Information about file Id, Logical file name and Physical file name

    Hi All,
    I am testing one program. Selection screen has 3 parameters, File Id, Logical File Name and Physical file name. In Physical File name, i am giving complete file name with path. But it is giving error. Please tell me, what is File id and what all information i need to enter for logical file name and physical file name.
    Thanks
    Puneet Aggarwal

    hi,
    try using this for filename.
    parameters : p_file like rlgrap-filename.
    Thanks,
    Gaurav

  • Logical file names and Physical file names

    Hi Guys...
         Can you let me know what is the difference between Logical file names and Physical file names?
    Regards,
    Rohit

    Using Logical Files in ABAP Programs http://help.sap.com/saphelp_nw04/helpdata/en/9f/db95e635c111d1829f0000e829fbfe/content.htm
    Creating and Defining Logical Filenames
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3df8358411d1829f0000e829fbfe/content.htm

  • How to put the file name in notepad file

    dear frank,
    how to put the file name in notepad file via power shell. I mean i want to put the file name in that notepad file
    for example,
    my file name is ABL and in this file data is
    02/06/2015,180.00,182.00,176.01,180.50,1575500
    02/06/2015,4.20,4.20,4.20,4.20,500
    02/06/2015,113.50,113.70,112.91,113.09,157800
    02/06/2015,682.01,695.90,682.00,683.19,4250
    02/06/2015,213.98,215.00,213.00,214.87,326200
    02/06/2015,21.52,21.65,21.52,21.60,4000
    02/06/2015,111.00,111.25,108.25,108.91,17100
    02/06/2015,52.00,52.00,52.00,52.00,500
    and i want to data in this form
    ABL,02/06/2015,180.00,182.00,176.01,180.50,1575500
    ABL,02/06/2015,4.20,4.20,4.20,4.20,500
    ABL,02/06/2015,113.50,113.70,112.91,113.09,157800
    ABL,02/06/2015,682.01,695.90,682.00,683.19,4250
    ABL,02/06/2015,213.98,215.00,213.00,214.87,326200
    ABL,02/06/2015,21.52,21.65,21.52,21.60,4000
    ABL,02/06/2015,111.00,111.25,108.25,108.91,17100
    ABL,02/06/2015,52.00,52.00,52.00,52.00,500
    There are many file like this that i want to be edit
    plese tell me how can i do it, i think it is possible via windows power shell.
    thanks in advance.

    Hi
    Just for completeness, what version of VB.NET are you using?
    Here is a complete project to copy all the files with the added "ABL," at the start of each line.  You need to start a new Project with a BLANK default Form1, and replace all of Form1 code with the code below. When you run this project, you
    need to use the 2 buttons to set up the ORIGINAL file folder and a folder to place the copies. You need to check if the file EXTENSION is correct (I assumed txt), and check the text to add to each line is correct.  Once all is set up you should have a
    big red button to start the operation.
    NOTE: it is important that you try this out on a copy of some of the files to verify accuracy BEFORE trying on original files. Make sure you have a good back up of the original files before doing anything else.
    ' new project with default BLANK Form1
    ' replace all Form1 code with this code
    ' WARNING: make sure you have a backup of
    ' any files you use this application to
    ' operate on.
    Option Strict On
    Option Infer Off
    Option Explicit On
    Public Class Form1
    Dim OrigFileFolderPath As String = Nothing
    Dim CopyToFolderPath As String = Nothing
    Dim lab1, lab2, lab3 As New Label
    Dim tb1, tb2, tb3 As New TextBox
    Dim b1, b2, b3, b4 As New Button
    Dim fb As New FolderBrowserDialog
    Dim bgw As New System.ComponentModel.BackgroundWorker
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
    Me.Size = New Size(731, 300)
    With lab1
    .Text = "Original Files Folder Path"
    .Location = New Point(15, 5)
    End With
    With tb1
    .Width = 560
    .Location = New Point(10, 30)
    .BackColor = Color.Khaki
    .ForeColor = Color.Maroon
    .Font = New Font(Me.Font.FontFamily, 12)
    .BorderStyle = BorderStyle.FixedSingle
    .Anchor = AnchorStyles.Top Or AnchorStyles.Left Or AnchorStyles.Right
    End With
    With lab2
    .Text = "Copy Files to Folder Path"
    .Location = New Point(15, 125)
    End With
    With tb2
    .Width = 665
    .Location = New Point(10, 150)
    .BackColor = Color.Khaki
    .ForeColor = Color.Maroon
    .Font = New Font(Me.Font.FontFamily, 12)
    .BorderStyle = BorderStyle.FixedSingle
    .Anchor = AnchorStyles.Top Or AnchorStyles.Left Or AnchorStyles.Right
    End With
    With lab3
    .Text = "File Ext"
    .Location = New Point(600, 5)
    .Anchor = AnchorStyles.Top Or AnchorStyles.Right
    End With
    With tb3
    .Text = ".txt"
    .Width = 80
    .Location = New Point(590, 30)
    .BackColor = Color.Khaki
    .ForeColor = Color.Maroon
    .TextAlign = HorizontalAlignment.Center
    .Font = New Font(Me.Font.FontFamily, 12)
    .BorderStyle = BorderStyle.FixedSingle
    .Anchor = AnchorStyles.Top Or AnchorStyles.Right
    End With
    With b1
    .Text = "Choose Original Files Folder Path"
    .AutoSize = True
    .Location = New Point(10, 65)
    End With
    With b2
    .Text = "Choose Copy Files to Folder Path"
    .AutoSize = True
    .Location = New Point(10, 185)
    End With
    With b3
    .Text = "DO THE COPY"
    .AutoSize = False
    .Size = New Size(240, 50)
    .BackColor = Color.Red
    .ForeColor = Color.White
    .Font = New Font(Me.Font.FontFamily, 20, FontStyle.Bold)
    .Location = New Point(420, 80)
    .Anchor = AnchorStyles.Top Or AnchorStyles.Right
    .Visible = False
    End With
    With b4
    .Text = "CANCEL JOB"
    .AutoSize = False
    .Size = New Size(240, 50)
    .BackColor = Color.Red
    .ForeColor = Color.White
    .Font = New Font(Me.Font.FontFamily, 20, FontStyle.Bold)
    .Location = New Point(420, 80)
    .Anchor = AnchorStyles.Top Or AnchorStyles.Right
    .Visible = False
    End With
    Me.Controls.AddRange({lab1, lab2, lab3, tb1, tb2, tb3, b1, b2, b3, b4})
    With bgw
    .WorkerReportsProgress = True
    .WorkerSupportsCancellation = True
    End With
    AddHandler bgw.DoWork, AddressOf bgw_DoWork
    AddHandler bgw.RunWorkerCompleted, AddressOf bgw_Completed
    AddHandler b1.Click, AddressOf b1_Click
    AddHandler b2.Click, AddressOf b2_Click
    AddHandler b3.Click, AddressOf b3_Click
    AddHandler b4.Click, AddressOf b4_Click
    End Sub
    Private Sub b1_Click(sender As Object, e As EventArgs)
    fb.SelectedPath = My.Computer.FileSystem.SpecialDirectories.MyDocuments
    fb.ShowNewFolderButton = False
    Dim r As DialogResult = fb.ShowDialog
    If r = Windows.Forms.DialogResult.OK Then
    tb1.Text = fb.SelectedPath
    If IO.Directory.Exists(tb1.Text) AndAlso IO.Directory.Exists(tb2.Text) AndAlso Not (tb1.Text = tb2.Text) Then
    If tb3.Text = Nothing Then
    redo: tb3.Text = InputBox("Enter the file extension that you want to copy/change", "FILE EXTENSION")
    If tb3.Text = Nothing Then GoTo redo
    End If
    b3.Visible = True
    Else
    b3.Visible = False
    End If
    End If
    End Sub
    Private Sub b2_Click(sender As Object, e As EventArgs)
    fb.SelectedPath = My.Computer.FileSystem.SpecialDirectories.MyDocuments
    fb.ShowNewFolderButton = True
    Dim r As DialogResult = fb.ShowDialog
    If r = Windows.Forms.DialogResult.OK Then
    tb2.Text = fb.SelectedPath
    If IO.Directory.Exists(tb1.Text) AndAlso IO.Directory.Exists(tb2.Text) AndAlso Not (tb1.Text = tb2.Text) Then
    If tb3.Text = Nothing Then
    redo: tb3.Text = InputBox("Enter the file extension that you want to copy/change", "FILE EXTENSION")
    If tb3.Text = Nothing Then GoTo redo
    End If
    b3.Visible = True
    Else
    b3.Visible = False
    End If
    End If
    End Sub
    Private Sub b3_Click(sender As Object, e As EventArgs)
    b3.Visible = False
    b4.Visible = True
    If Not tb3.Text.StartsWith(".") Then tb3.Text = "." & tb3.Text
    bgw.RunWorkerAsync()
    End Sub
    Private Sub b4_Click(sender As Object, e As EventArgs)
    bgw.CancelAsync()
    End Sub
    Private Sub ReadPWFile(fn As String)
    Dim filename As String = My.Computer.FileSystem.GetName(fn)
    Dim barename As String = IO.Path.GetFileNameWithoutExtension(fn)
    Dim copyto As String = tb2.Text & "\" & filename
    Dim line As String = Nothing
    Dim lines As New List(Of String)
    Using sr As IO.StreamReader = New IO.StreamReader(fn)
    Do
    line = sr.ReadLine()
    If Not line = Nothing Then
    lines.Add(barename & "," & line)
    End If
    Loop Until line = Nothing
    End Using
    Using sw As IO.StreamWriter = New IO.StreamWriter(copyto)
    For Each s As String In lines
    sw.WriteLine(s)
    Next
    End Using
    End Sub
    Private Sub bgw_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs)
    Dim ftc As Collections.ObjectModel.ReadOnlyCollection(Of String) = My.Computer.FileSystem.GetFiles(tb1.Text)
    For Each f As String In ftc
    If bgw.CancellationPending Then
    e.Cancel = True
    Exit For
    End If
    Dim ex As String = My.Computer.FileSystem.GetFileInfo(f).Extension.ToLower
    If My.Computer.FileSystem.GetFileInfo(f).Extension.ToLower = tb3.Text.ToLower Then
    ReadPWFile(f)
    End If
    Next
    End Sub
    Public Sub bgw_Completed(sender As Object, e As System.ComponentModel.RunWorkerCompletedEventArgs)
    tb1.Text = Nothing
    tb2.Text = Nothing
    b3.Visible = False
    b4.Visible = False
    MessageBox.Show("Finished copying files", "Job Completed")
    End Sub
    End Class
    Regards Les, Livingston, Scotland

  • Need help adding a default file name in a file chooser of save dialog type

    I need to create a file chooser with save dialog type, how can I add a highlighted default file name into the File Name textfield? As in Microsoft Word, when you want to save a document, a default file name Doc1.doc will appear in the File name text field of the file chooser even when you change to other directories.

    For JRE 1.4.0 you can use this fix:
    public class FileChooserFix implements PropertyChangeListener {
      private String fileName;
       * @see PropertyChangeListener
      public void propertyChange(PropertyChangeEvent ev) {
        JFileChooser chooser = (JFileChooser)ev.getSource();
        if (JFileChooser.FILES_ONLY == chooser.getFileSelectionMode()) {
          if (JFileChooser.SELECTED_FILE_CHANGED_PROPERTY.equals(ev.getPropertyName())) {
            File selectedFile = (File)ev.getNewValue();
            if (selectedFile != null) {
              // remember fileName of selected file
              fileName = selectedFile.getName();
          if (fileName != null &&
              JFileChooser.DIRECTORY_CHANGED_PROPERTY.equals(ev.getPropertyName())) {
            // reset selected file
            File directory = (File)ev.getNewValue();
            chooser.setSelectedFile(new File(directory, fileName));
       * Convenience method to create a fixed file chooser.
       * @return      fixed file chooser
      public static JFileChooser create() {
        JFileChooser chooser = new JFileChooser();
        chooser.addPropertyChangeListener(new FileChooserFix());
        return chooser;

  • Change File Name In The "File Download" Dialog Box For Web Reports

    Hi All ,
    I followed the below note to change the "File Download" name.
    How To Change The File Name In The "File Download" Dialog Box For Web Reports? Doc ID: Note:418366.1
    However its not working. Has anyone tried this and works fine ?
    Basically I wanted to change the name "rwservlet" when a report is run in an
    excel format.
    Rajesh Alex
    Rajesh Alex

    Hello,
    Have you checked if a HTTP header "Content-disposition" is returned ?
    You can use ieHTTPHEaders for IE
    http://www.blunck.se/iehttpheaders/iehttpheaders.html
    and
    Live HTTP Headers for FireFox
    https://addons.mozilla.org/en-US/firefox/addon/3829
    Regards

  • Logical File name of Transaction File

    Hi All,
    I am using FILE_NAME_GET function module to get the Physical file name based on logical file name.
    But here i am not getting total file name, i maintained Physical File name as ZDM\INTB18\<PARAM_1>.
    Transaction File is stored in application server and it's name is ZDM\INTB18\RMCB18_DATETIME.
    Could you please anybody suggest how to get total file name.
    Thanks,
    Rami Reddy.

    Hi Rami,
    Have you utilised the Parameter WITH_FILE_EXTENSION in the function ... e.g.
    Example
    logical file name: MONTHLY_SALES_FILE
    physical file name: VALUES<PARAM_1>
    logical path: SALES_DATA_PATH
      physical path (Windows): C:\SALES\<FILENAME>
    Get file name for WINDOWS platform, with file name extension
    CALL                                                                                FUNCTION                                                                                'FILE_GET_NAME'
       EXPORTING
          LOGICAL_FILENAME = 'MONTHLY_SALES_FILE'
          WITH_FILE_EXTENSION = 'X'
       IMPORTING
          FILE_NAME = FILE
          FILE_FORMAT = FORMAT.
    Result:
    FILE = C:\SALES\VALUES.WK1
    FORMAT = WK1
    Rgds, Derrick

  • Could not save as (file name) because the file could not be found

    When i try saving sothing it comes up with could not save as (file name) because the file could not be found and need to save this file. i could save stuff before but not anymore if anyone could help i would be grateful
    im using photoshop cs5.1
    Thanks keiron

    We cannot know. These kinds of things are operating system errors with stuff getting blocked due to insufficient permissions, security tools interfering, network errors or whatever. Since you mentioned none of that, it's an "Ask your mom..." thing at this point, but if you provide more details, someone might be able to figure it out.
    Mylenium

Maybe you are looking for