File Reciver adapter - Variable Substitution

Hi all,
i am creating a file with dynamic file name.
My structure looks like this:
Row - 0-unbound (all the data)
FileName - 1
I don't want the file name to appear in the file I just want it for the Variable Substitution.
so in the content conversion i use only the row.fieldFixedLengths
but in the file i get an extra empty line because of the file name.
Thanks,
Naama.

Hi,
Its better to go for Adapter specific attributes with dynamic configuration. That will avoid you from usage of Filename field in target structure.
Refer - Dynamic Configuration for file name
Dynamic  File Name for Receiver File Adapter
Dynamic File Name using XI 3.0 SP12 Part - I
Dynamic file name(XSLT Mapping with Java Enhancement) using XI 3.0 SP12 Part -II
Thanks
swarup

Similar Messages

  • Receiver File Adapter:Variable substitution :FATAL  ERROR

    HI all
    as per the previous thread :
    <b>Receiver File Name Variable Substitution :payload: Fatal Error
    in our idoc to file sceanrio, we are using simple <b>graphical mapping.</b>
    for dynamic file name , variable field is at <b>Target message type</b>,So  on using <b>Variable substitution</b>, again the error is same :
    SAXException while parsing XML payload: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) .
    <b>Our XI  Component version : 2004
    WAS 6.4 SP 15</b>
    Thanks
    AR

    Ashutosh,
       There is nothing to do with your mapping programs. Its the mistake in ur reciever file adapter configuration for variable substitution.I asked u whether u changed message mapping in order to implement the UDF!!
    Did u tried checking the audit log. Ok just to see where u are going wrong, instead of using Payload :... in Variable substitution use Message:..... and give some interface name so that to check whether the file is created with Interface name.
    Juz give a try!!!
    Best regards
    raj.

  • IDoc to File - IDoc number : Variable substitution in File Adapter

    Hi,
    I have an IDoc to File scenario. I want to use the IDoc Number as part of the target filename (using variable substitution) in the File Adapter. However, the target flat file does not have a field where I can store the IDOC number. I know the IDoc number is also stored in the message header ( under the IdocInbound tab), but is there any way I can access this in the variable substitution?
    Failing this, if I have the Idoc number in the target XML, is there any way I can skip it in the flat file generated?
    example...
    XML looks like this...
    <Root>
    <Record>
       <IdocNum>99999</IdocNum>
       <HeaderRecord>
       </HeaderRecord>
       <LineRecord>
       </LineRecord>
       <LineRecord>
       </LineRecord>
    </Record>
    </Root>
    But the flat file should be..
    HeaderRecord...
    LineRecord...
    LineRecord...
    Cheers
    Manish

    Hi Chandra,
    Thanks for this
    But this is standard stuff that is detailed in SAP help files (http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm)
    What I was looking for was in Sravya's blog (refer the earlier entry).
    Thanks anyway
    Cheers
    Manish

  • Blank Lines at end of file when using Variable Substitution in File Adapter

    Hi all,
    I'm using variable substitution in a File Adapter, it's refers an element of message, like:
    filename    payload:MESSAGE_INTERFACE,1,FILENAME,1
    The variable substitution is working right, but it's append a BLANK LINE at end of file.
    Anyone knows how to solve this problem ?
    Thanks in advance.

    Hi Regis,
    I suppose you're using content conversion?
    if so try adding
    <b>endSeparator</b> = '0'
    to your last element
    this will delete the default line break at the end
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions">XI FAQ - Frequently Asked Questions</a>

  • File-Adapter: Variable substitution form payload XML-attribute

    Hi experts,
    is possible to use XML-attribute-content for variable substitution in file-Adapter?
    extract from XML:
    <?xml version="1.0" encoding="utf-8" ?>
    - <all>
    - <transaction <b>file="filename"</b>>
    - <table name="BPAADDRESS" options="insertIfUpdateFails">
    - <record id="1">
      <hkeycol name="BPAMAINHKEY">0010500345</hkeycol>
      <hkeycol name="USAGE">Invoice</hkeycol>
      </transaction>
    I want to get the value "filename" = attribute file of transaction.
    Is this possible?
    Thanks a lot,
    Florian

    I have done this taking a field from the XML.
    You have to map the location of the field within the XML...
    Taken from:
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm
    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.
    &#9679;      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.
    &#9675;       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 ("_").
    &#9675;       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 (“Example Value”) 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>
    &#9679;      To disable the check the adapter performs for the element data, set the Disable Security Checks indicator.
    Otherwise, the adapter checks whether the element data contains characters that could lead to security risks in the file system environment. The check includes the characters “/“, “\“, and “..“.

  • File adapter - Variable Substitution

    Hi all,
    I’m trying to use Variable Substitution functionality in my receiver file adapter. The objective is: During process message XI read the payload of an xml message and picks the value of tag <ORIGEM> coming with the File Name and do the substitution of File Name Schema of receiver file adapter.
    This is what I have donned in the configuration of receiver file adapter:
    File Name Schema: <b>R3%var1%.xml</b> (file construction mode: Add Time Stamp)
    Variable Substitution: <b>Enable</b>
    Variable name: <b>var1</b>     
    Reference: <b>payload:nr1:IfContabilizacao_Source_Log,1,INFO_CONTROLO,1,ORIGEM,1</b>
    The XML Message:
    <?xml version="1.0" encoding="utf-8"?>
      <nr1:IfContabilizacao_Source_Log
    xmlns:nr1="http://xi/XI/InterfaceContabilistico">
        <INFO_CONTROLO>
          <ORIGEM>TESTE</ORIGEM>
          <DESTINO>This is a string 2</DESTINO>
          <IDENTIFICACAO>This is a string 3</IDENTIFICACAO>
          <DATA>1999-01-24</DATA>
          <VERSAO>This is a string 4</VERSAO>
        </INFO_CONTROLO>
        <INFO_DADOS>
          <HEADER_DOCUMENTO>
            <BLDAT>1999-01-24</BLDAT>
            <BLART>C</BLART>
            <BUKRS>C</BUKRS>
            <BUDAT>1999-01-24</BUDAT>
        </INFO_DADOS>
      </nr1:IfContabilizacao_Source_Log>
    When I execute the process both sxmb_moni flags are ok! But in the adapter monitoring I receive this error message:
    2005-12-20 10:51:25 WET: Message processing failed: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: var1
    Var1 is the name that I have defined in variable name! Is wrong? Anybody see something wrong in this configuration or something in reference payload of  tags hierarchy… I think that I have checked all…
    Thanks in advance,
    Ricardo.

    Renjith,
    Adapter monitoring continues with this error mesage: VariableDataSourceException: The following variable was not found in the message payload: var1
    This error means that the reference showed bellow have something wrong! But I can't see where is the error!!!
    payload:IfContabilizacao_Source_Log,1,INFO_CONTROLO,1,ORIGEM,1
    Anybody see where is the error of my reference, or any other idea?
    Thanks in advance,
    Ricardo.
    Message was edited by: Ricardo  Quintino

  • PI File Adapter variable substitution

    Hi everybody,
    I do have the following message:
    <?xml version="1.0" encoding="utf-8"?>
    <ns:MT_FileIn_Budget xmlns:ns="urn:rlp.de:test:budgeting">
         <BudgetRecord>
              <Monat>Pa</Monat>
              <Jahr>b_Lie</Jahr>
                                               ................. etc.
    I want to extract the "Monat"  variable in the Receiver File Adapter as a substitution variable in the "Advanced" Tab  in the
    Receiver File Adapter configuration.
    I have the following value in the Substitution table :
    var1     payload:BudgetRecord,1,Monat,1
    (and then use var1 in the filename)
    If I use Header Mapping instead , everythings works.
    Any ideas? something misspelled?
    cheers hs

    Hi Michael,
    maybe you can clarify a better solution for my problem:
    The reason why I am using variable substitution is, that I am not using graphical mapping here.
    I am using a XSLT style sheet translation (PI 7.11) as a mapping step. 
    I need to set the file name depending on the operation mapping.
    For every specific situation (about 10) , there is one OM. This OM (XSLT, no SAP Graphical Mapping) should set a specfic filename.  for every specific situation there is an integration scenario with the specific OM.
    The Business Component with one comm channel should only be there once (we don't want 10 communication channels)
    Do you have a recommendation ?
    thx
    hs

  • FILE CONTENT CONVERSION/ VARIABLE SUBSTITUTION

    Hi Experts,
    I have a reciver file which should have
    HEADER
    field 1
    field 2
    DETAIL
    field 1
    field 2
    TRAILER
    field 1
    field 2
    My reciever structure is
    HEADER
    field 1
    field 2
    DETAIL
    field 1
    field 2
    TRAILER
    field 1
    field 2
    TEMP
    field 1
    I am using TEMP field1 only for variable substitution and do not want
    it to be written to file. How can i use it in FCC.
    Pl. Help
    Akhil

    Hi,
    Plz do refer the folowing links:
    Sender -
    /people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
    Key value:
    /people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30
    /people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
    /people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter -
    TAB delimited
    /people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns
    /people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
    /people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
    NAB the TAB (File Adapter)
    /people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
    Receiver FCC no need of Endseparator
    /people/shabarish.vijayakumar/blog/2007/08/03/file-adapter-receiver--are-we-really-sure-about-the-concepts
    Regards,
    Vinod.

  • White lines generated in a txt File when using variable substitution

    Hello,
    I have a problem with a File generated by XI, my File Adapter is using variable substitution with reference to a field of my message type. I use content conversion as well and the generated file has a white line in top of file.
    How could I avoid this and make the white lines disappear? I was trying a lot of things but I don’t really know how to solve this issue, the following is the data type used:
    <FILE_NAME></FILE_NAME>
    <COMPANY>
         <COMPANY_CODE></COMPANY_CODE>
         <COMPANY_NAME></COMPANY_NAME>
         <ADRESS></ADRESS>
    </COMPANY>
    FILE_NAME is the field I use for variable substitution and COMPANY is declare as 0..unbounded.
    Thanks a lot in advanced,
    Luis

    Hi Jai,
    I have declare the following Content Conversion parameters:
    Recordset Structure: COMPANY
    FILE_NAME.fieldFixedLengths     0
    FILE_NAME.fixedLengthTooShortHandling     cut
    COMPANY.fieldFixedLengths     10,80,10,2,50,30,5,5,2,50,50
    COMPANY.addHeaderLine     0
    COMPANY.endSeparator     'nl'
    But it does not work, I have the same white line in the beginning of the file. Do you have any other suggestion??
    I couldnt find the blog written by Sravya either, could you post the link?
    Thanks a lot,
    Luis

  • File adaptor and variable substitution

    i have used variable substitution in the reciever comm channel to dynamically alter the folder ...Question is ..is there a way to do this from the sender comm channel..
    I know, i know we can write a custom module..etc..etc..
    I mean besides that ..is there a way sap provides out of the box...
    Michal..what do you think..?
    PS: your blog on var subst is very good !
    Regards
    Venkat

    Hi Venkat,
    For implementing variable substitution on the sender side. you can develop your own module as per your requirement.
    Only question is you can easily implement this on receiver side receives payload information coming after the mapping. While processing communication channel, it has payload to refer for variable substitution..
    While on the sender side communication channel do not have payload to implement variable substitution.
    Can you explain in detail about condition you want to apply in variable substitution.
    - Gaurav Jain

  • Command line in XI file reciver adapter

    Hello,
    I need to debug calling to command line in XI reciver adapter.
    I saw an artical telling how to write logs of error in the XI server.
    Please show me the link,
    Thanks in advance

    Dear Elad,
    This might help you
    Page- 36 onwards
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/ee5bc490-0201-0010-e9b5-a258cf083bca
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1eb928a1-0601-0010-f890-be9169f0d856
    Regards
    Agasthuri Doss

  • Bursting XML Control File - only one variable substitution works

    Hello, I have the following from my bursting xml. In my subject I would like to have more than one substitution as in my example. Problem is that when I have more than one, the second one alway is "null". On there own they work fine. Is this a bug/limitation?
    <xapi:message id="111" to="${ADMIN_EMAIL}" attachment="true" subject="Unigas Inv
    oice No: ${TRX_NUMBER} for ${PARTY_NAME}">

    Use this syntax in your burst file (note you will need the above patch applied).
    <xapi:document output="${VAR - or hard code name here}" output-type="pdf" delivery="xxx" >
    Alternate way (if you don't have the patch) is to use the bursting listener by implementing it and doing the following in the afterProcessDocument interface.
    public void afterProcessDocument(int requestIndex, int documentIndex, Vector documentOutputs) {
    String outFileName = (String)documentOutputs.get(0);
    File newFile;
    File oldFile = new File(outFileName);
    newFile = new File(oldFile.getParent() + File.separator + "file" + oldFile.getName());
    oldFile.renameTo(newFile);
    documentOutputs.remove(0);
    documentOutputs.add(0, newFile.getPath());
    }

  • File Reciver adapter - an empty line

    Hi all,
    I have a problem when creating a file with File adapter CC,
    every time i am getting an extra line in the end of the file,
    How I can prevent this?
    Thanks,
    Naama.

    Hi,
    Try with NameA.additionalLastFields = ignore
    Regards
    Seshagiri

  • Reciever File Adapter - Temp File Name Scheme using Variable Substitution

    How can I create a temporary file that uses variable substitution? 
    We are having a problem with files merging when we write files using the "Use Temporary File" setting on the FIle Adapter.  So two independent files are merging into a single file.  We are not using the "Append" setting.
    We would like to use a Temp File Name Scheme that would append the message id onto the temporary file name. 
    Using variable substitution we created a msgid variable.  When added to the temporary file name using %msgid% the temporary file name is created with %msgid% in the name instead of the actual message id.  We put the variable into the "File Name Scheme" as well and the end completed file used the message id in the name.
    Any Ideas?
    Thanks,
    Matt

    HI Matthew,
    Why are you adding the message id into the temporary file??
    I understand that you want the output of the filename to contain message id .. and hence you are using variable substitution for the same.
    Temporary file name will anyways get overwritten by the actual file name (here the actual filename will be using variable substituion).
    So i suggest to achieve your scenario you can add any name in the temporary file and maintain the desired filename you require as output in the variable subsititution.
    Temporary File Name option actually acts as a lock - unlock mechanism from PI side while the file is getting written to the file server so that while PI is writting the file no third party application batch program picks it up.
    I hope this helps.
    Cheers
    Dhwani

  • Variable substitution for Dynamic filename

    Hi All,
    my Scenario is Proxy to file. and the receiver file should be a zip file of extension .dat.gz.
    In mapping I tried as below. In signature I used one sender and two receiver messages.
    SENDER:                         RECEIVER:(2messages)
    MT_Product                       MT_Product
    -----Row                              ---------Row
    ---------field1                         -----------field1
    ---------field2                         -----------field2
    ---------field3                         -----------field3
                                             MT_Poduct_1
                                               --------field5  
    for field5 I mapped current date and I am trying to use it in Reciver file communication channel. will that be correct to use?
    In receiver communication channel the file name is Product_%field5%.zip I used
    and I used Module Configuration for content conversion and Zipping the file.
    In variable substitution I used field5 for dynamic date.
    field5-----------
    payload:Messages,1,Message2,1,MT_Product_1,1,field5,1
    Module Confuguration:
    Guys! am on right path????? will this be possible????

    Hello,
    Why you are using multimapping? Just for defining target file name using var substitution - BTW, that too is incorrect. You cannot use Messages/Message 1 nodes in variable substitution.
    Secondly, if I am not wrong the approach of defining dynamic zip file name using variable substitution won’t work because variable substitution will be executed once all the modules before standard call sap adapter gets executed. So during runtime, at var substitution step, ur file will actually be a text file instead of XML as a result u will get an exception.
    So, if there is no specific objective of using multimapping then simply use DC.
    Thanks
    Amit Srivastava

Maybe you are looking for

  • I have a brand new iPhone 4GS from Bell Carrier, I want to have it unlock for my Roger's carrier, is this possible?

    I have my step-son's iPhone 4GS from Bell Carrier, he upgraded his phone, I have a 4G, and I contacted Bell in order to have my phone unlocked so I can replace my phone with the 4GS with my present carrier of Roger's. Bell customer service informed m

  • Macbook Pro 13 inch stuck while turning ON and heat up

    Hi, My MBP 13 inch (Snow Leaopard 10.6.8) is stuck at start upp with grey apple logo (no spinning gear). I think this problem started after I tried to turn ON my MBP with an external dongle connected to USB port (I didnt notice it is connected). Whil

  • Why wont quicktime install?

    i try to install quicktime, but it always has an error. i have cleaned out my temp folder, deleted all of itunes and quicktime, and it still wont install.

  • How to recover database without archive files

    Hello, I've a test database without archive files and I need to know how to recover it without using archive files. What is SQL command to recover database wthout archives? Thanks in advance for your help. Regards, Carles

  • Non web-safe link colors possible?

    The non web-safe link colors I'm trying to use on my website won't show up in any browser, although the same colors work in other text on the site. I'm using CSS to create pages, and everything else works well. The links show up as they would if they