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>

Similar Messages

  • 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

  • White lines generateds in a File Adapter when using variable substitution.

    Hi all,
    I have been a problem in File generated by XI, my File Adapter is using variable substitution with reference to a field of my message type. Because it, the files generated has white lines in top of file.
    What can I do to not apears these lines ?
    Thanks

    Regis,
    Try to give a more detailed description of your problem otherwise I don't know who's gonna answer...
    Alexx

  • 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

  • FTPs connection error:When using Variable substitution for Directory path

    Hi
    I am transferring data from BI to xml file via PI: Here a Client proxy from BI sends the data to PI and the PI FTPs the XML file to a remote location. For FTP I am using FTPs SSL connection.
    It was working fine untill I used Variable susbstitution to determine Directory path dynamically. I am using this because different xml files are intended to goto the different locations.
    I did the variable substitution like this:
    Target Message Structure:
    ---> Target Directory: %var1%
    <?xml version="1.0" encoding="UTF-8" ?>
    <MT_BI_EXTRACT_FILE>
      <Header>
         <Directory>/Customer</Directory>
    </Header>
    <Detail>
    </Detail>
       </MT_BI_EXTRACT_FILE>
    And in the variable substitution I am doing it this way
    payload:MT_BI_EXTRACT_FILE,1,Header,1,Directory,1
    And the error I am getting is:
    Attempt to process file failed with Error when getting an FTP connection from connection pool: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: iaik.security.ssl.SSLException: Peer sent alert: Alert Fatal: handshake failure
    MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: Error when getting an FTP connection from connection pool: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: iaik.security.ssl.SSLException: Peer sent alert: Alert Fatal: handshake failure
    Exception caught by adapter framework: Error when getting an FTP connection from connection pool: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: iaik.security.ssl.SSLException: Peer sent alert: Alert Fatal: handshake failure
    Delivery of the message to the application using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Error when getting an FTP connection from connection pool: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: iaik.security.ssl.SSLException: Peer sent alert: Alert Fatal: handshake failure.
    Does anybody have some Idea of this ??
    Regards
    Naina

    Hi,
    I guess the problem is not with Variable Substitution..
    Error when getting an FTP connection from connection pool:
    So its a connection problem..
    Also check the option Disable Security check and try again...
    Try to check again if the interface is executing properly without Variable substitution and let us know..
    Babu
    Edited by: hlbabu123 on Jan 7, 2011 2:46 PM

  • Extra empty groupName in TDMS file when using DAQmx Start New File & stop DAQmx while waiting for trigger?

    I wrote a VI that listens to an external trigger coming from a PFI line and saves a user-defined number of pretrigger+posttrigger samples into disk, and then the DAQmx restarts to wait for the next trigger. I used the DAQmx Start New File.vi to change the filename of each of the next file. However, I found that for each of the resulting TDMS files, there is an additional group that is added in addition to the real data. For example, if the groupName is set to "task_voltage", then there is an additional groupName called "task_voltage #1".
    I suspect that this is because the program preallocate diskspace using the old filename for the pretriggered samples, but when the trigger happens and the samples are ready to be written into disk, an actual new file is opened and saved. The reason I think this might be the case is because, say each file would be 50kB and I already have 1 file triggered and saved, before the second trigger comes in, I can see that the file size of the first file is twice as much as it should be (100kB), but the file size will return to noraml (50kB) after the second trigger happens and a second file is created.
    Does anyone know if this is really the case? Is there a way to configure the task so that this doesn't happen?
    Another question I have is that the program currently set up so that the VI will wait until a trigger happens to return the values. However, this means that if a trigger doesn't happen, the VI waits indefintely, and the "stop" button in the while loop is useless. I have to use the "Abort Execustion" button on the tool bar to stop the VI. Is there a way to interrupt and stop the DAQmx task even if the trigger doesn't happen?
    Thanks in advance for any help!
    Attachments:
    pretrigger_loop_new_file.vi ‏29 KB

    I don't believe there is a way to programmatically change/delete the group name in a TDMS file. What you can do however, is convert between TDMS and TDM using the VIs found in the Data Storage palette and then perform whatever modifications you need using the TDM utilities.
    Applications/Systems/Test
    National Instruments | AWR Group

  • 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

  • Retrieve the message put in message header using variable substitution

    hi,
    i am using dynamic configuration to put some information in the message header.is it possible to retrieve the message using variable substitution and if it is possible then how it be done using variable substitution.
    regards,
    Meenakshi

    Variable Substitution does not allow you to read all the messaeg header elements only some of them can be read/ access....for more info on how to read the message header elements refer: /people/jin.shin/blog/2007/04/27/sap-netweaver-xi-variable-substitution-with-adapter-specific-message-attributes-via-dynamicconfigurationbean
    From the above blog:
    When using Variable Substitution, only certain standard message header attributes can be used/accessed (e.g. sender_party,
    sender_service, receiver_party, receiver_service, interface_name, interface_namespace, message_id)
    Better use Dynamic Configuration to read the parameters.
    I am wondering why you need to read the message header parameters when you are putting them using Dynamic Configuration.....cant you just get the details from the dynamic configuration UDF itself?
    Regards,
    Abhishek.
    Edited by: abhishek salvi on Dec 10, 2009 1:18 PM

  • File receiver : blank line at end of file

    Dear friends,
    we are using file receiver with file content conversion , tp : FTP
    The file has a flat structure & fixed length (no delimiters) :
    reordset parameters used- fieldFixedLengths
    each record is in a different line, but at the end of the records a blank line is inserted.
    (no endSeparator is used.)
    Can you pls advise hot to get rid of this extra blank line

    Hi Datta,
    I am not sure but you can try with follwing parameters...
    NameA.fixedLengthTooShortHandling Specify how you want the system to respond when column widths in the actual document exceed those defined in NameA.fieldFixedLengths. The following values are permitted: 
    ·        Error
    Error means that processing of the document is terminated.
    ·        Cut
    Cut means that a value is shortened to the maximum permitted length.
    ·        Ignore
    Ignore means that the system applies the value completely, regardless of it being too long. Subsequent columns are moved correspondingly.
    U can use ignore in your case.
    For more info. plz check
    http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/frameset.htm
    Regards
    Sachin

  • "Premature end of file" when reading in a GZIP file!

    Hello i'm trying to figure out what may be causing a "Premature end of file" when reading in a GZIP file!
    Basically, what i'm trying to do is read a GZIP file, create an XML file in GZIP format and then validate the GZIPed XML file using the SAX validator and this process works fine for LOW volume data, but for HIGH volume data it seems to have several problems. One problem i was getting was 'Corrupt GZIP trailer', which seems to be a known bug, used an override here and it's ok, and now i'm getting the 'Premature end of file error'.
    Here is the error report, see <<<<<<<<<!
    START: Wed Aug 03 12:03:41 EDT 2005
    Runparms :
    host: ....
    port: ....
    sid: ....
    usr: ....
    site: ....
    val_type: HVPEZ -- previously HVPEX, reason, reading zip file (.gz)
    dbo: NULL
    ddl: /home/......../HLPVAL/DAT/hlp_ddl_file
    table: ......
    db_name: NULL
    dat_file: /..../...../....../xxxxxxx1.dat.gz
    xsd: /home/....../....../XSD/xxxxxxx1.xsd
    sql: NULL
    debug: NULL
    sql query null
    pid: 11751
    xml: /home/.........../...../XML/xxxxxx1.dat_HVPEZ_xml.gz
    rep: /home/.........../...../XML/xxxxxx1.dat_HVPEZ.valrep
    fatalError:
    setValidity:
    Error number : 1
    Error starts on line number : 1302706816
    Error starts on column position: 8
    Error text is : org.xml.sax.SAXParseException: Premature end of file. <<<<<<<<<<<
    org.xml.sax.SAXParseException: Premature end of file.
    Here i'm reading in a GZIPed file, i then generate the XML and write out another GZIPed file, see <<<<<<<<<<:
           try {
            GZIPOutputStream     gz = new GZIPOutputStream(new FileOutputStream(xp.xml_file));  >>>>>>>> out GZIPed
            PrintWriter        outf = new PrintWriter (gz);
            GZIPInputStream      in = new GZIPInputStream(new FileInputStream(xp.dat_file),4096); <<<<<< in GZIPed
            byte[] buf = new byte[4096];int len=0; String[] sa = new String[NUM_COLS]; int bj=0; char[] ca=new char[1500];
            while ((len = in.read(buf)) > 0)
                String hrec = new String();
                for (int b=0;b<len;b++)
                     Byte byt=new Byte(buf); int bi=byt.intValue(); char c=(char)bi; ca[bj]=c;
    if (c == '\n')
    hrec=new String(ca); hrec=hrec.trim();
    for (int k=0;k<1500;k++) ca [k]=' ';
    int prevj=0; j=0;int fcnt=0;
    for (int w=0; w<hrec.length(); w++)
    if (hrec.charAt(w)=='|')
    sa[j]=hrec.substring(prevj,w);fcnt++;
    j++; prevj=w+1;
    sa[j]=hrec.substring(prevj,hrec.length());fcnt++; bj=-1;
    for (int i = 0; i < NUM_COLS; i++)
    if (i>(sa.length-1)) { sToken = new String(); } else { sToken = sa[i]; }
    if (sToken.indexOf('<')>-1 || sToken.indexOf('>')>-1 || sToken.indexOf('"')>-1 ||
    sToken.indexOf('&')>-1 )
    String sToken2 = new String();
    sToken2 = normalize(sToken);
    sToken = sToken2;
    outf.write(" <"+_columnNames[i]+">"+sToken+"</"+_columnNames[i]+">"+"\n");
    outf.write(" </"+FILE_NAME+">"+"\n");
    bj++;
    outf.write("</hlp_data>"+"\n");
    outf.flush(); <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< here if tried every combination of close command ect.
    outf.close();
    gz.finish();
    gz.close();
    in.close();
    Here i'm reading the GZIPed file from the previous program and this is where the 'Premature end of file' error is occurring. Notice that i'm using an extended class Called WorkingGZIPInputStream, this is to bypass the error message 'Corrupt GZIP trailer' message that seems to occur when processing high volume files, here's a previous link on issue:
    http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=1&t=011624
           HlpValSax1  sx = new HlpValSax1();
           SAXParser   sp = sx.getParser(xp.xsd_file);
           if (
                  xp.val_type.substring(0,5).equals("HVPEZ")
               || xp.val_type.substring(0,5).equals("HVPEX")
               || xp.val_type.substring(0,5).equals("HVOEX")
               WorkingGZIPInputStream is = new WorkingGZIPInputStream(new FileInputStream(xp.xml_file),4096); <<<<<<<<<<
               sp.parse(is,dh);
           else
              File file      = new File(xp.xml_file);
              InputStream is2 = new FileInputStream(file);
              sp.parse(is2,dh);
         catch (FileNotFoundException nf) {System.out.println(nf);}
         catch (SAXException sa)          {System.out.println(sa);}
         catch (IOException  io)          {System.out.println(io);}

    Turns out things were not exactly the same. When I had done it from disk I would always create a new InputStream when reading the resource, when doing it from the Jar I was reusing it.

  • Firefox 33 doesn't display a pdf file when using the response object

    Firefox 33.0.2 does not display pdf files when using the code below from an asp.net program, which works for previous versions of Firefox, and also works with IE. I'm using the built-in pdf viewer. All of my plugins are disabled.
    Dim strPDF As String
    strPDF = Session("filname") 'pdf filename
    Response.Clear()
    Response.ClearHeaders()
    Response.Buffer = True
    Response.ContentType = "application/pdf"
    Response.CacheControl = "Private"
    Response.AddHeader("Pragma", "no-cache")
    Response.AddHeader("Expires", "0")
    Response.AddHeader("Cache-Control", "no-store, no-cache, must-revalidate")
    Response.AddHeader("Content-Disposition", "inline; filename=" + strPDF)
    Response.WriteFile(strPDF)
    Response.Flush()
    Response.Close()
    Response.Clear()
    Response.End()
    Session("filname") = ""

    Thanks cor-el. You pointed me in the right direction. It appears to me that a reported Firefox 33 bug with the handling of compression (Transfer-Encoding: chunked) is the culprit (https://support.mozilla.org/en-US/questions/1026743). I was able to find a work-around by specifying the file size and buffering. Below is my code, with some code from http://www.codeproject.com/Questions/440054/How-to-Open-any-file-in-new-browser-tab-using-ASP.
    Dim strPDF As String
    strPDF = Session("filname") 'pdf filename
    Dim User As New WebClient()
    Dim FileBuffer As [Byte]() = User.DownloadData(strPDF)
    If Not (FileBuffer Is Nothing) Then
    Response.Clear()
    Response.ClearHeaders()
    Response.CacheControl = "Private"
    Response.AddHeader("Pragma", "no-cache")
    Response.AddHeader("Expires", "0")
    Response.AddHeader("Cache-Control", "no-store, no-cache, must-revalidate")
    Response.ContentType = "application/pdf"
    Response.AddHeader("content-length", FileBuffer.Length.ToString())
    Response.BinaryWrite(FileBuffer)
    Response.Flush()
    Response.Close()
    Response.Clear()
    Response.End()
    End If
    Session("filname") = ""

  • Is there a capability to save/export the time capsule settings file when using the iphone/ipad airport utility. the "file" button does not exist on the latest airport utility app.

    is there a capability to save/export the new airport 2TB time capsule settings file when using the iphone/ipad airport utility. set-up wasn't a problem but the "file" button does not exist on the latest airport utility app v6.3 to save the configuration file.

    the "file" button does not exist on the latest airport utility app v6.3 to save the configuration file.
    Sounds like you are a bit confused with version numbers.
    Latest AirPort Utility version for the iPhone / iPad is 1.3.3.  There is no option or capability to export/import settings on the iOS version(s) of AirPort Utility.....although you could take a series of screen shots and save them for future reference.
    AirPort Utility 6.3.x is found on a Mac.....not on iPhone / iPad. Export and Import options are found under the File menu in 6.3.x.

  • ERROR MESSAGE WHEN USING PACK COMMAND   Missing file ////presenter.css   Also:  "This course requires JavaScript to be enabled in your browser. Please enable JavaScript, then relaunch the course."  I have Java enabled in all browsers

    ERROR MESSAGE WHEN USING PACK COMMAND   Missing file ////presenter.css    Command then fails
    Also:  "This course requires JavaScript to be enabled in your browser. Please enable JavaScript, then relaunch the course."  I have Java enabled in all browsers
    Thoughts?  Using Presenter 10  Win 8.1  Intel I7  new HP with plenty of memory
                   Thanks

    I had saved one copy as an .asp but then resaved it to .xhtml 
    I'm assuming this is a static web site.  Rename (F2) all your pages with .html or .htm extension. 
    .xhtml is not a valid extension.
    Nancy O.

  • Adobe Premiere CC 2014.2: losing rendered files when using warp stabilizer

    Hi,
    I am constantly losing rendered files when using the warp stabilizer. So far I have tried about every hint I could find on the web such as cleaning the cache, rebuilding the rendered files, creating additional sequences etc etc.
    Honestly I am getting tired of using a product that isnt cheap in the first place to rent and where a bug like this apparently persists over several product versions without being fully fixed (I have had this problem throughout 2014 but according to forum postings others seem to have problems with much earlier versions as well).
    I would be really grateful if somebofy has any suggestion how this can be addressed.
    I am also happy to help testing fixes - if there are any fixes available.
    Thanks a lot and Happy New Year!
    Martin

    Hi Catherine,
    Welcome to the Adobe forums.
    Please try the steps mentioned below and check if it works for you.
    1. Launch Premiere Pro and create a Project, go to File menu>Project Settings>Renderer and change the Renderer to Software only mode, delete previews if you get a prompt and then try to import the clip.
    2. If step 1 fails or the Renderer is already on Software only mode, go to Start Menu and search for Device Manager, go into Display Adapters and Right click on the Graphics card to select Update driver software option, on the next screen choose "Browse my computer for driver software", then choose "Let me Pick from a list..." option and from the list select "Standard VGA Graphics adapters. You might need to change the screen resolution of your screen and once done restart the machine again.
    Launch Premiere Pro and import the clip to check.
    Regards,
    Vinay

  • What is a valid location for autorecovery files when using Word for MAC?

    What is a valid location for autorecovery files when using Word for MAC?

    Microsoft Word for Mac support forums is probably a better place to ask.

Maybe you are looking for