Dynamic file name in receive FTP file adapter

Hi, All,
I have a ABAP proxy -> FTP scenorio. The sender side MT is like this:
<Sender_MT>
  <FileName>abc.txt</FileName>
  <Record>
      <TEXT>.......</TEXT>
      <TEXT>.......</TEXT>
     <TEXT>  ......</TEXT>
</Record>
</Sender_MT>
I would like to output the data which are the values of the tags <TEXT> to a flat file with the file name of the value of <FileName>
I tried to use Variable Substitution in FTP CC. I set a val1 = payload:Sender_MT:1,FileName,1 .  But I got an error says "Unknown structure 'ns0:Sender_MT' found in document'. I looked at the message monitoring. It shows payload <n0:Sender_MT>. not <ns0:Sender_MT>. I think that is why I got the error. Then I tried to use XSLT mapping. I set
<Receiver_MT>
<Record>
     <xsl:value-of select="ns0:Sender_MT/Record"/>
</Record>
</Receiver_MT>
But I get an error says "XMLParser: No data allowed here: (hex) 32, 64, 66(:main:, row:1, col:3): ".
Could anybody help me out? Thanks!
Jack
Edited by: Jack  Mathew on Jun 4, 2009 6:22 PM

Dude this looks purely like a variable reference error. Have you mapped the the Filename field in the target too? UR XSLT mapping dosent seem to indicate that... run ur mapping test to check that..
Second ... if ur source structure is hierarchcially similar then var 1 should be -
payload:Receiver_MT:1,FileName,1
Regards,
Arvind R

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 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

  • Dynamic file name in receiver channal

    Hi, All,
    I would like to set dynamic file name in receiver channal. My xml payload will be like this:
    <file_name>file1.txt</file_name>
    <text_content>balabala......</text_content>
    I would like to output an text file which text content will be the value of <text_content>, file name will be the value of <file_name> in the xml payload.
    Is there anyone could help me?
    Helpful answer will be surely awarded. Thanks
    Yang

    Please look at the below description from help.sap.com. You can use the below steps to name the file from a value in the payload. You would have to use File Content Conversion to insert the value of the <text_content> in the file.
    Variable Substitution (Target Directory/File Name Scheme)
    If you set the Enable indicator, you can enter variables for the Target Directory and File Name Scheme. Enter the names of the variables and references in the table.
    ●      Enter each variable that you reference in the Target Directory and File Name Scheme fields without the surrounding percentage sign under Name of Variables in the table.
    The variables can refer to attributes of the message header or elements of the message payload.
    ○       If the variables are to refer to an attribute of the message header, add the prefix message: to the name of the variable under Reference. You can specify the following attributes of the message header:
    sender_party, sender_service, receiver_party, receiver_service, interface_name, interface_namespace,
    message_id (message ID with hyphens, for example 9fbe1ff1-9a0d-11d9-8665-cbf10a126331)
    message_id_hex (message ID in hexadecimal format, for example 9fbe1ff19a0d11d98665cbf10a126331)
    For example, if you want to specify the interface name from the message header in the target directory or in the file name scheme, enter message:interface_name as the reference.
    If one of the message attributes contains characters that are not permitted in a file name, for example \, /, :, *, ?, ", <, >, |, then these characters are replaced by an underscore ("_").
    ○       If the variable refers to an element in XML schema, add the prefix payload: to the information under Reference. The reference then comprises a pseudo path description in the form of a comma-separated list with the schema namea,na,nameb,nb,....
    namea,nameb,...corresponds to the element name and na,nb,... corresponds to the occurrence of the element name at the respective level in the document.
    The description begins at the root of the document and ends at the respective element.
    To reference the element that is in bold in the example, the following expression is used: payload:root,1,e1,1,e2,2
    The parser searches for the first occurrence of the root element at the first level. It then searches for the first occurrence of e1 at the second level and for the second occurrence of e2 at the third level. The content of the last element (u201CExample Valueu201D) is set as the value for a specified variable.
    <?xml version="1.0" encoding="UTF-8" ?>
    <root>
      <dummy>
         <e1>
            <e2>Data_1</e2>
            <f/>
            <g attr="abc">text</g>
            <e2>Data_2</e2>
         </e1>
      </dummy>
      <e1>
         <e2>illegal/value</e2>
         <f/>
         <g attr="abc">text</g>
         <e2 attr="fghij">Example Value</e2>
      </e1>
    </root>
    Thanks
    Praveen M

  • EOIO service on Receiver FTP/File Adapter

    Hi,
    I have a scenario where I would like the sender adapter to be quality of service, EO (Exactly Once), and the receiver ftp/file adapter to be of quality of service, EOIO (Exactly Once in Order).  Is there a way to change the quality of service on the receiver adapter only so that it differs from the sender adapter?
    Thanks in advance.
    Best Regards,
    Duke

    Hi,
    Unfortunately changing the QoS in the adapter module does not solve the issue.  The message appears to be put into the queue prior to the module being called.  Below is the audit log.
    2007-10-26 09:58:30 Success Using connection AFW. Trying to put the message into the receive queue.
    2007-10-26 09:58:30 Success Message successfully put into the queue.
    2007-10-26 09:58:30 Success The message was successfully retrieved from the receive queue.
    2007-10-26 09:58:30 Success The message status set to DLNG.
    2007-10-26 09:58:30 Success Delivering to channel: XXXXXXX
    2007-10-26 09:58:30 Success ChangeQoS: Module called
    2007-10-26 09:58:30 Success File adapter receiver: processing started; QoS required: ExactlyOnceInOrder
    As you can see the QoS has been changed to EOIO from the adapter module, but the message is still in Qos EO.
    Am I missing something or is there another way this can be achieved?  Can we do this in the mapping somehow before it ever gets to the AFW?
    Thanks in advance.
    Best Regards,
    Duke

  • When someone other than myself downloads an image from my web album, a dynamically generated file name replaces the original file name.  How I can prevent the original file name being replaced during the downloading process?

    When someone other than myself downloads an image from my web album, a dynamically generated file name replaces the original file name.  How I can prevent the file name being changed during this downloading process?

    Hi Glenyse,
    Here are my steps.
    1.  I upload multiple image (jpg) files onto my photo album.
    2.  I select the "sharing" by email option for this album.
    3.  I enter the recipient's email address.
    4.  The recipient receives my message and clicks on the link.
    5.  The recipient accesses my photo album and clicks on one of the images.
    6.  The image opens up to its own screen.
    7.  The recipient selects the "download" and then save file option.
    Here is the part I do not understand.  For some reason, during this "download" process, the original name which I have given to the file is replaced by different name.  So I was hoping that someone knows how to prevent the file name from being changed during the "download and save" process.
    Much appreciated if you can help me find a solution to this problem.
    Mary  

  • 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:
    user531689

    Just overwrite the filename in the WSDL file that was generated

  • Send port with same file name as receive

    I have a filename "abc.docx". I need to create a send port where I should set the file name in a such a way that I should have the same file name as received.
    I have set the filename in the send port as "%SourceFileName%" but it does not seem to be working.
    How to set the send port to have the same file name as received by the receive port? Send location should hold the same file name

    could you please also mention what is happening when you set
    %SourceFileName% .  what kind of output filename are you getting then when used %SourceFileName%
    ?  incase if you are not getting any file at all in the output, then its not the issue with %SourceFileName%
     macro.
    Please mark the post as answer if this answers your question. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • 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%n

    yes 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.

  • How write the Outbound file name in the Inbound file

    Friends,
    I have a scenario like this.
    Outbout filename - sample.txt
    In sample.txt, i have having data like 20
    Inbound filename - vivek.txt
    i need data the like sample, 20
    (NOTE: sample is the outbound file)
    How to get this scenario.
    Thanks in advance.
    regards,
    Vivek.

    Hi Vivek,
      If your PI is of SP14 and more you have an option called Adapter Specific Message Attributes.(ASMA) in communicatoin channel configurtaion, Which will help you in capturing the Sender file name during runtime.
    So you will have to enable that option (ASMA) in Commchannel and capture file name  in UDF using Java Code with the help of sap related API and map it to the target field which u would like to get populated.
    follow the thread it has the discussion about acessing the Source file name.
       Re: Getting file directory using dynamic configuration:Code needed
    Thanks,
    Ram.

  • Different log file name in the Control file of SQL Loader

    Dear all,
    I get every day 3 log files with ftp from a Solaris Server to a Windows 2000 Server machine. In this Windows machine, we have an Oracle Database 9.2. These log files are in the following format: in<date>.log i.e. in20070429.log.
    I would like to load this log file's data to an Oracle table every day and I would like to use SQL Loader for this job.
    The problem is that the log file name is different every day.
    How can I give this variable log file name in the Control file, which is used for the SQL Loader?
    file.ctl
    LOAD DATA
    INFILE 'D:\gbal\in<date>.log'
    APPEND INTO TABLE CHAT_SL
    FIELDS TERMINATED BY WHITESPACE
    TRAILING NULLCOLS
    (SL1 DATE "Mon DD, YYYY HH:MI:SS FF3AM",
    SL2 char,
    SL3 DATE "Mon DD, YYYY HH:MI:SS FF3AM",
    SL4 char,
    SL5 char,
    SL6 char,
    SL7 char,
    SL8 char,
    SL9 char,
    SL10 char,
    SL11 char,
    SL12 char,
    SL13 char,
    SL14 char,
    SL15 char)
    Do you have any better idea about this issue?
    I thought of renaming the log file to an instant name, such as in.log, but how can I distinguish the desired log file, from the other two?
    Thank you very much in advance.
    Giorgos Baliotis

    I don't have a direct solution for your problem.
    However if you invoke the SQL loader from an Oracle stored procedure, it is possible to dynamically set control\log file.
    # Grant previleges to the user to execute command prompt statements
    BEGIN
    dbms_java.grant_permission('bc4186ol','java.io.FilePermission','C:\windows\system32\cmd.exe','execute');
    END;
    * Procedure to execute Operating system commands using PL\SQL(Oracle script making use of Java packages
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "Host" AS
    import java.io.*;
    public class Host {
    public static void executeCommand(String command) {
    try {
    String[] finalCommand;
    finalCommand = new String[4];
    finalCommand[0] = "C:\\windows\\system32\\cmd.exe";
    finalCommand[1] = "/y";
    finalCommand[2] = "/c";
    finalCommand[3] = command;
    final Process pr = Runtime.getRuntime().exec(finalCommand);
    new Thread(new Runnable() {
    public void run() {
    try {
    BufferedReader br_in = new BufferedReader(new InputStreamReader(pr.getInputStream()));
    String buff = null;
    while ((buff = br_in.readLine()) != null) {
    System.out.println("Process out :" + buff);
    try {Thread.sleep(100); } catch(Exception e) {}
    catch (IOException ioe) {
    System.out.println("Exception caught printing process output.");
    ioe.printStackTrace();
    }).start();
    new Thread(new Runnable() {
    public void run() {
    try {
    BufferedReader br_err = new BufferedReader(new InputStreamReader(pr.getErrorStream()));
    String buff = null;
    while ((buff = br_err.readLine()) != null) {
    System.out.println("Process err :" + buff);
    try {Thread.sleep(100); } catch(Exception e) {}
    catch (IOException ioe) {
    System.out.println("Exception caught printing process error.");
    ioe.printStackTrace();
    }).start();
    catch (Exception ex) {
    System.out.println(ex.getLocalizedMessage());
    public static boolean isWindows() {
    if (System.getProperty("os.name").toLowerCase().indexOf("windows") != -1)
    return true;
    else
    return false;
    * Oracle wrapper to call the above procedure
    CREATE OR REPLACE PROCEDURE Host_Command (p_command IN VARCHAR2)
    AS LANGUAGE JAVA
    NAME 'Host.executeCommand (java.lang.String)';
    * Now invoke the procedure with an operating system command(Execyte SQL-loader)
    * The execution of script would ensure the Prod mapping data file is loaded to PROD_5005_710_MAP table
    * Change the control\log\discard\bad files as apropriate
    BEGIN
    Host_Command (p_command => 'sqlldr system/tiburon@orcl control=C:\anupama\emp_join'||1||'.ctl log=C:\anupama\ond_lists.log');
    END;Does that help you?
    Regards,
    Bhagat

  • Get File name of the inbound file during mapping

    Scenario: to read the file name of the inbound file (which has date required for the mapping) during runtime.
    The requirement is to read the date of the inbound file (passed to the XI pipline by the file adapter) and populate the same in the outbound mapping structure.
    Any idea about how to do this?
    (I went through few options of using java.util.map. not successful yet)

    Hi Anand,
    I posted the same question a time ago, without any help....
    Can I find out the full filename of input file in message mapping?
    Posted: Nov 23, 2004 1:00 PM
    I have in XI 2.0 the following scenario :
    In the inbound fileadapter I read my input file. The filename of the input file is part fixed, part variable (Like INDATA01.txt, INDATA03.txt, etc).
    So in my Adapterconfiguration, I specify the filename with a wildcard (INDATA*.txt).
    What I now want to do, is in my Message Mapping use the full filename , so I can do something different for every filenumber. Is there a way where I can get the full filename available in my message mapping (I did not find the filename in the XML in the message trace).

  • Assign Logical file name for the physical file path through Program

    Hi all,
    I am having a physical file which is getting generated dynamically. It is having the date and time stamp in its name which is added at runtime.
    Now I need to assign a logical file name for the physical file path through the program.
    Is there any FM or any other method to assign the same.
    Gaurav

    I think it is not possible. becuase the date & time added at runtime. so if you check the table  PATH you can find filename and their definitions

  • Error Occurred While Converting the file"name of song" The file name.......

    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...

  • Flat file connection: The file name "\server\share\path\file.txt" specified in the connection was not valid

    I'm trying to execute a SSIS package via SQL agent with a flat file source - however it fails with Code: 0xC001401E The file name "\server\share\path\file.txt" specified in the connection was not valid.
    It appears that the problem is with the rights of the user that's running the package (it's a proxy account). If I use a higher-privelege account (domain admin) to run the package it completes successfully. But this is not a long-term solution, and I can't
    see a reason why the user doesn't have rights to the file. The effective permissions of the file and parent folder both give the user full control. The user has full control over the share as well. The user can access the file (copy, etc) outside the SSIS
    package.
    Running the package manually via DTExec gives me the same error - I've tried 32 and 64bit versions with the same result. But running as a domain admin works correctly every time.
    I feel like I've been beating my head against a brick wall on this one... Is there some sort of magic permissions, file or otherwise, that are required to use a flat file target in an SSIS package?

    Hi Rossco150,
    I have tried to reproduce the issue in my test environment (Windows Server 2012 R2 + SQL Server 2008 R2), however, everything goes well with the permission settings as you mentioned. In my test, the permissions of the folders are set as follows:
    \\ServerName\Temp  --- Read
    \\ServerName\Temp\Source  --- No access
    \\ServerName\Temp\Source\Flat Files --- Full control
    I suspect that your permission settings on the folders are not absolutely as you said above. Could you double check the permission settings on each level of the folder hierarchy? In addition, check the “Execute as user” information from job history to make
    sure the job was running in the proxy security context indeed. Which version of SSIS are you using? If possible, I suggest that you install the latest Service Pack for you SQL Server or even install the latest CU patch. 
    Regards,
    Mike Yin
    If you have any feedback on our support, please click
    here
    Mike Yin
    TechNet Community Support

Maybe you are looking for

  • WRVS4400N : DHCP not assigning IP addresses if WAN link is down

    Hello, With the latest firmware installed (the one suporting fixed IP based on MAC), I have one problem: the DHCP server is not assigning addresses when the WAN link is down. When it is up, it generally assign IP based on the configuration binding (M

  • Urgent - After Insert Trigger is not working

    CREATE OR REPLACE TRIGGER TD_ADD_SHIPPING_COST AFTER INSERT ON wlcs_order REFERENCING NEW AS new_order FOR EACH ROW BEGIN IF (:new_order.order_id IS NOT NULL) THEN -- call update_wlcs_order procedure from shipping_cost package SHIPPING_COST.update_wl

  • Link to file doesnt work

    I want to download  active directory migration tool 3.2 from site, and i got link for that file  http://go.microsoft.com/fwlink/?LinkId=186197 You can see that link here : http://technet.microsoft.com/en-us/library/active-directory-migration-tool-ver

  • When I export a video in Premiere, the colors flash purple and green. Why?

    I bought the software just recently but I have exported files before and they worked fine.  I have a few speculations but I wanted to get an opinion.  I dont know what to do if my speculations are right either. 1. I used a small digital camera so the

  • Oracle services for MTS (Oracle 9i2)

    I follow up all steps to make service to work. But it seems to be not working properly. How can i configure this service? How can i make sure that the service are correctly installed? Is necesary the old snap-in configuration in 9i version?