'Use Temporary File' in Receiver File channel

hi all,
I am facing a strange issue with receiver file channel which I am not sure if somene had already faced. I couldnt find any help from blogs..!
I have configured the Receiver File channel with Write mode as  'Use Temporary File'  with a temporary file name(say tmp.xml)  scheme and Empty-Message Handling set to 'Write Empty File'
When the scenario is executed, its so happening that the temporary file of 0 bytes(empty file) is being created as tmp<msgID>.xml before the actual file is being completely written. It is expected that once the Actual file is completely written, the tmp file should be deleted, but here is not the case.Thus causing both the files being present in the target location. This is not happening often though.
As the receiving application is processing all files from the target direcotry, the file is getting errored out in the target application.
I think the 'Write Empty File' has nothing to do with this as the option 'Write Empty File' is for empty payloads resulting from the message mapping.
Please correct me if am wrong and also provide me the inputs on my issue. Am on PI7.0
thanks in advance,

Hi Tilak,
this is real time interface
real time by using a file... that's a non-sens according to me. You should use a non physical solution (web service, JMS, JDBC, etc...) but a not a file. well... Anyway, you can image that the receiver application schedule the folder every 30s or every 1min, that's almost a real time. Real time is mainly a conceptual view (only synchronous exchange needs really real time). Morevoer, if you really wanted a real time, you should not add a tool like PI (or other) between your source and your target system, the more we have systems, the less it's efficient (in term of delay and response time!).
Even if we propose that the receiver application should have a condition to its script to avoid picking the tmp*.xml files, after a period of time there would be a chance that the *tmp files may increase in number..
No ! coz if my theory is good, if your receiver application does not pick-up tmp.xml, that means this file is not currently treated and so PI is authorized to delete it. So no increase of tmp.xml files in this folder.
Another solution: to create the target file without option "temporary", but to create it in another folder than this one scheduled by your receiver application, and use an OS command AFTER processing, in your receiver CC, which move the created file from the "temp" folder to the target folder.
[http://wiki.sdn.sap.com/wiki/display/XI/SAPXIFileAdapterOSCommandLine+Feature]
regards.
Mickael

Similar Messages

  • Dynamic construction of temporary filename for receiver file hcannel

    Hi,
    We are using a receiver file channel and we need to populate the temporary file name dynamically , in the message mapping (similar to main file name and folder).
    Please let me know as to how to achieve this in message mapping and what configuration needs to be done in the receiver file channel.
    Regards
    Ganesh

    Hi,
         A way to fetch File name Dynamically (from source File Adapter) in message mapping is through a UDF and then pass this Filename in XML payload of your message.
    Then this Dyanamic File name can be put into Receiver File Adapter by configuring Advanced Tab in Receiver File Adapter as explained in this Link:
    under Advanced Tab Page
    http://help.sap.com/saphelp_nw70/helpdata/en/ae/d03341771b4c0de10000000a1550b0/frameset.htm
    UDF is as Follows:
        DynamicConfiguration conf  = (DynamicConfiguration) container
      .getTransformationParameters()
      .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String valueOld = conf.get(key);
    return (valueOld);
    This code fetches File Name of the files picked up by Sender File Adapter.Give a suitable file name in Sender as  "*.txt" or anthing you wish.
    If you find the information helpful, rewards points.
    Thanks,
    Anurag Garg

  • O/P file in receiver communication channel.

    Consider a file to file scenario..
    and in the receiver Communication Channel,We have to specify the name of the output file right.but i want my output in a different way.....
    my output file names are different.....what shall io do now....
    Any ideas...

    Hi Reddy,
    your requirement is not clear...
    Try these
    Dynamic File Name Part 1
    /people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i
    Dynamic File Name Part 2
    /people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii
    XI: The same filename from a sender to a receiver file adapter - SP14
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Sachin

  • File conversion and append file in receiver file adapter

    Hi
    I have a batch IDoc -> XI(3.0) -> file scenario with file conversion to create a flat CSV-like file. The problem is that because of the amount of data sent from R/3 (~20000 employees), the idoc is split into several idocs. In my receiver file adapter I want to append all the idocs contained in this data transfer to one flat file, before transmitting to FTP server.
    For the next batch transfer (the next day) XI should start all over and create a new file and append all idocs contained in that transfer before transmitting the flat file to FTP server.
    Can this be done using the 'Use Temporary File' and 'Append' options in the FTP connection Parameters in the comm-channel?
    It is not an option to append the file in the FTP-server, because the files in the destination folder are moved immediately after arrival, so the file will be moved before file adapter can append all the files.
    Does anyone have any suggestions to how to solve this?
    Br
    Kenneth

    Hi Kenneth
    Did you ever get a solution to this problem?
    Regards
    Russel Irvine
    [email protected]

  • Mutiple sender files and receiver files with different file names

    Hi All,
    Following is my scenario: File (FTP) --> XI --> File (NFS actually SAP system)
    I have 5 source files like ABC<b>1</b>_DateTimeStamp, ABC<b>2</b>_DateTimeStamp, ABC<b>3</b>_DateTimeStamp, ABC<b>3</b>_DateTimeStamp and ABC<b>3</b>_DateTimeStamp.
    I can use single sender file FTP adapter with file name ABC* which picks up all 5 files, but can I use single receiver adapter to create 5 different files with the following file names: ABC1, ABC2, ABC3, ABC3 and ABC3 ?? And last 2 files (ABC3 and ABC3....same name) should be created after 30min and 60min of first ABC3 file. We have to do this because we have jobs scedule on SAP side with variants having file names.
    Is it possible to achieve using single sender/receiver file adapter??
    If not any suggestions how to do this scenario?? 
    Thx
    Navin

    Navin,
    I doesn't know whether its feasible for you or not. Please see the below option
    Create 3 Sender  comm.channels and 1 Receiver comm.channel. In Sender /Receiver file adapter check the Adapter Specific Message attributes.
    I'm suggesting the soln using BPM.
    In IR, Create 3 Outbound Interface (Abstract) and create 1 Inbound Interface(Abstract).
    First 2 comm.channel and 2 Oubtound interface refers to file 1 & file2 respectively.
    The 3rd comm.channel and 3 Outbound interfaces refers to file3 & file4& file 5 .
    Please see the BPM design.
    http://www.flickr.com/photo_zoom.gne?id=698877499&size=o
    Note : Navin the above suggestion is my thought, I think it will work. U can juz give a try.
    Best regards,
    raj.

  • How to create multiple files with Receiver File Adapter in SAP PI 7.31 Java Stack

    Dear Friends,
    I am using Sender JDBC Adapter and Receiver File Adapter in Integration Flow in SAP PI 7.3 EHP 1 SP08 Java Stack environment. The requirement is that we need to create multiple files based on the row count in jdbc resultset. If there are 5 rows in resultset, we need to create 5 XML files with one row elements in one file. Similarly if there are 10 rows, we need to create 10 XML files.
    So how can we create multiple files in this scenario. I tried placing a for loop in the Java Mapping as below in the transform method:
    DynamicConfiguration conf = arg0.getDynamicConfiguration();
    StringBuffer sbFileData = new StringBuffer();
    for (int i =0; i < record.size(); i++ {
         . // Create XML for each row and Marshal the object into to the String Buffer
         String strFileName = "DC_" + new SimpleDateFormat("ddMMyyyyHHmm").format(new java.util.Date())+"_"+i+".xml";
         conf.put(KEY_FILENAME, strFileName);
         arg1.getOutputPayload().getOutputStream().write(sbFileData.toString().getBytes("UTF-8"));
         arg1.getOutputPayload().getOutputStream().flush();
    So here I'm flushing the OutputStream for each record. But it's not creating the multiple file, instead it creates only one file will all record XMLs appended to each other.
    Please let me know if I missing something or need to do some thing else.
    Regards,
    Shreyansh Shah

    Hi
    You can easily achieve this using graphical mapping.  Create your target message type like below
    MT_Target
      Details  0 to 1
          Data  0 to 1
    Source sample structure
    <resultset>
    <row>
    <column-name>column-value</ column-name>
    </row>
    Then do the message mapping like below
    map <row> with  MT_Target
    contant ----> Deatils
    column-name ------>Data
    In the signature tab of message mapping, choose the occurrence of your target message type as
    0 to unbounded.
    This will generate multiple files from multiple rows.
    Let me know if you have any doubt.

  • File adapter:  Receiver File Content Conversion problem.. XML to CSV..!!

    Hi,
    I am facing some problem in FCC for Receiver adapter. It has to convert from XML to CSV File.
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:PaymentFull_Target xmlns:ns0="http://sdn.com/Payment">
    - <RECORDSET>
    - <Header>
      <LineItem>1</LineItem>
      <SaleNumber>102</SaleNumber>
      <TransNumber>105</TransNumber>
      <Store>1326</Store>
      <variant>Z6</variant>
      <TransType>NEW</TransType>
      <Adjustm_Type />
    </Header>
    - <Header>
      <LineItem>2</LineItem>
      <SaleNumber>102</SaleNumber>
      <TransNumber>105</TransNumber>
      <Store>1326</Store>
      <variant>Z6</variant>
      <TransType>NEW</TransType>
      <Adjustm_Type />
    </Header>
    - <Header>
      <LineItem>3</LineItem>
      <SaleNumber>102</SaleNumber>
      <TransNumber>105</TransNumber>
      <Store>1326</Store>
      <variant>Z6</variant>
      <TransType>NEW</TransType>
      <Adjustm_Type />
    </Header>
    </RECORDSET>
    </ns0:PaymentFull_Target>
    Output File is coming only with lineitem values , remaining fields are not coming.
    *1,2,3*
    FCC Used...
    RecordSet Structure -- Header
    Header.fieldNames -
    LineItem,SaleNumber,TransNumber,Store,variant,TransType,Adjustm_Type
    Header.fieldSeparator-----   ,
    Header.endSeparator-----    'nl'
    Did I miss anything.. any idea whats going wrong?
    Thanks
    Deepthi

    Hi Deepthi,
    Mention the occurrence of header in Recordset
    You specify like this:
    Recordset: Header, *
    Header.fieldSeparator : u2018Field Separatoru2019
    -->For FCC on Receiver side you donu2019t have to mention the field names.
    -->The u2018endSeparatoru2019 parameter needs to given for substructure only
    Check this links:
    http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
    /people/shabarish.vijayakumar/blog/2007/08/03/file-adapter-receiver--are-we-really-sure-about-the-concepts
    /people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
    Rgds,
    Akhila

  • Archive processed files at receiver file adapter

    Hi Experts,
    I need to archive(copy) processed messages from the target folder to another folder.
    I tried using the Run OS Command after processing and not sure with the exact command.
    Can anyone please provide the exact command (syntax) for copying file from the target file folder to another folder.
    Do we need any authorization from BASIS team to perform this command in run OS Commandline please.
    Note: the original file should not be deleted.
    Thanks in advance!
    Regards,
    Mahakrishnan T.

    hi Mahakrishnan Thangam,
                    I used the OS command feature  where FTP is not used and it worked in the way I already posted. When it comes to FTP in receiver file adapter you need a batch file and a script both on PI server. The script will function as follows
    1. Login to FTP server.
    2. change to target folder you specified in target directory in cc.
      command: cd foldername
    3.Read the file created by receiver file adapter in remote FTP location. File will be copied to local directory of PI server.
        command:  get filename
    4. Now again change remote directory to archive directory.
    5. Copy the file back to FTP server again from local directory to archive directory you want to copy to.
    Now from batch file call this script.
    Would suggest to read these links carefully
    http://wiki.sdn.sap.com/wiki/display/XI/SAPXIFileAdapterOSCommandLine+Feature
    http://www.cs.colostate.edu/helpdocs/ftp.html
    Alter algorithms to meet your requirement.
    Hope this solves your problem.
    Regards
    Anupam

  • Problem in Overwriting the file in Receiver File adapter

    Hi  all,
    I configured my scenario Proxy to File. Every day the back ground job runs in SAP and send all Employee Details to XI, XI then write it into File in XI server, in Receiver File adapter i enable overwrite existing file.
    But some times its over writing the file some times came up with error like "Access Denied".
    Can any one tell me what could be the problem.
    Kind Regards,
    Kiran

    > But some times its over writing the file some times
    > came up with error like "Access Denied".
    This can be a Authorization problem...may be at that time you are unable to write any file in that directory..or some other application is using it and it make a lock at that time.
    Thanks
    Farooq.

  • Generating HTML Files via RECEIVER File Adapter

    Hi All,
    I have the Following Scenario: 
    R/3 ( ABAP Proxy ) -
    >XI------>HTML Files ( File Adapter ).  
    Basically I would like to generate, HTML files out the RECEIVER File Adapter.   How can this be achieved?
    I  have invested some time in thinking about a adapter module, which can do this? Any Blogs would be Helpful here.
    Is there any alternative way? 
    Any Blogs or help Links would be appreciable.
    Thanks in advance,
    Best Regards,
    Abhishek Vinayaka

    Hi
    Look these thread for Create HTML file format
    if the reciever adapter is file i want in messages to be  in HTML format
    Re: idoc-xi-file scenario.  how to display file in html format

  • Regarding .trg file from receiver file adapter

    Hi,
    My scenario is IDOC to File.
    i am using file adapter at receiver side. My client want me to generate .trg file at the end once i create .dat file. After that one .net program will run and it will check for .trg file and will pick up the .dat file with the same name. They want me to do this because other applications also creating .trg file.
    They are saying that C#.net program should not pick the file before XI completes writing the file fully.
    ( .net we may have option to check whether any other aplication is locked the file, but they dont want to use that ).
    My question is, do we really need to create .trg file. What is the posibility of the .dat file being picked by C#.net program before XI completes writing the file fully if we dont use .trg file.
    Will the file visible for .net program before file fully wirten to the share folder. How file adapter works?
    Will it create a file and keep on appending the lines? OR it will write everyting at a shot?

    HI Ashok,
    You need to create two fiels .dat and .trg but should be in sequence.
    Either you can add the simple BPM i.e. Receiver step and two send steps in sequence then it will resolve the purpose.
    OR
    make the external control on communication channel to be activate in pre-defined sequence so 1st Dat file will be created and then .trg file.
    You can even schedule the communciation channels accordingly, this way you can add multiple receivers with scheduling
    Thanks
    swarup
    Edited by: Swarup Sawant on Jun 13, 2008 7:45 AM

  • Add header line to the text file in receiver file adapter

    Hello Experts,
    I have to add a new line to the text file generated at the receiver end.
    My structure is
    Record
       Item......0-unbounded
             field1
             field2
             field3
    I have defined below parameters in receiver FCC.
    RecordSet Structure : Record,Item
    Item.fieldSeparator : ;
    Record.fieldSeparator : nl
    Record.endSeparator : '0x0D''0x0A' ( this is to get a carriage return at the end of the file)
    Item.addHeaderLine : 1
    With the above configuration, i am getting the desired output with NO header line.
    Please help.
    Thanks,
    Swetha.

    Hi, it looks like that the headerline "specification is only permitted if exactly one structure is defined." Please check [SAP help under Define Parameters for Recordset Structures|http://help.sap.com/saphelp_nw73/helpdata/en/44/686e687f2a6d12e10000000a1553f6/frameset.htm].
    One solution would be to generate the header fields in the message payload. Generate an additional first line containing the header names, e.g.
    <Item>
    <field1>Header1
    <field2>Header2
    <field3>Header3

  • Receiver File Adapter error

    Hi all,
    I am trying to convert the XML to Plain file in receiver file adapter. I am using module - StrictXml2PlainBean
    My target structure is -
    <MT_Name>
        <records>
            <Header>
            </Header>
            <Item>
            </Item>
        </records>
    </MT_Name>
    <Header> and <Item> are at same level.
    When I use --
    1. Header.fieldSeparator = ,
    2. Item.fieldSeparator = ,
    3. recordTypes = Header,Item
    Then I get this error -
    Message processing failed. Cause: com.sap.aii.af.app.modules.conversion.xml2plain.ConversionException: Invalid structure name encountered during conversion: records at XML element MT_Name,records
    When I use --
    1. records.fieldSeparator = ,
    2. singleRecordType = records
    Then I get this error -
    Message processing failed. Cause: com.sap.aii.af.app.modules.conversion.xml2plain.ConversionException: The element nesting level for the structure MT_Name is too deep (reference: 3 levels, found: 4 levels) at XML element MT_Name,records,Header,Item
    To add more details to the scenario, multiple records can be generated but one record will have only one Header, with multiple Items.
    Any help in this regard will be highly appreciated.
    Thanks,
    Abhi

    Hi Abhi,
    Here you go....
    For your target structure as:
    <MT_Name>
    <records>
    <Header>
    </Header>
    <Item>
    </Item>
    </records>
    </MT_Name>
    Where I have assumed that <Header> and <Item> are at same level.
    DO NOT use any Module just simply configure the receiver channel as below:
    In the file Receiver Channel
    Recordset Structure = Header,Item
    Name                                                                    Value
    Header.fieldSeparator                                             ,
    Item.fieldSeparator                                                  ,
    I have tried this and it works.
    Let me know if you are facing any issues.
    Cheers
    Dhwani

  • FCC Parameters are required in the Receiver  File Adapter

    Hi ,
       Sorry for posting this  question again.. my  Structure is
    MT_CADVICE_STRING
    .     .  Batach -
    1:Unbounded (Node)
    .     .      .Header_String -
    1:1       
    .     .      .Line_Item       -
    1:Unbounded  (Node)
    .     .      .      .LineItem_String -
    1:1 
    for this structure  I'm geting data in the XML format.. .. my scenario is simple File to File scenario.. now i want to convert this XML to  a normal Text file  by using FCC in the Receiver file adapter..
    and in the Receiver side   i want the file in the bellow  format:  (each field i want to get in the separate line  but at presnt I'm getting the continution of all lines I'm not getting the data in a separate lines..)
    Header_string  
    LineItem_String
    LineItem_String
    Header_String
    LineItem_String
    so, any abody  can help on this...
    And in the Receiver Communication channel i keep the FCC parameters like  as bellow :
    RecordsetStructure : Batch,LineItem
    Batch.fieldSeparator:  'nl'
    LineItem.fieldSeparator: 'nl'
    Batch.endSeparator:  'nl'
    LineItem.endSeparator: 'nl'
    For more information.. My source file is like bellow
      <?xml version="1.0" encoding="utf-8" ?>
    - <nr1:MT_CADVICE_STRING xmlns:nr1="urn:Test.com:SD:CAdvice">
    - <Batch>
      <Header_String>1 B 1110300014200804108218 36892.80 03 10.000 10.000 0.00 0.00 008000021720080410558000.00 91958.40 649958.40 0.00 649958.40 2678.40 1000003461100000346110000034611000003461123456 18 18 0.00 $</Header_String>
    - <LineItem>
      <LineItem_String>2 B 1110300014 1 000000000001234567000000000001 5.000 0.00 45000.00 10800.00.00 16.00 279000.00 0.00 rcl/ML0080200804100000000357 200804100.00 01 02 000000002.00 860.13321.00 $</LineItem_String>
      </LineItem>
    - <LineItem>
      <LineItem_String>2 B 1110300014 2 000000000001234567000000000001 5.000 0.00 45000.00 10800.00.00 16.00 279000.00 0.00 rcl/ML0080200804100000000357 200804100.00 01 02 000000002.00 860.13321.00 $</LineItem_String>
      </LineItem>
      </Batch>
      </nr1:MT_CADVICE_STRING >
    Regards
    Jain

    Hi jain
    Provide as below definitely it will work,
    RecordSet Structure :  batch,Line_Item,LineItem_String
    batch.fieldSeparator        ---      'nl'
    Line_Item.fieldSeparator  -
         'nl'
    LineItem_String.fieldSeparator  ---   'nl'
    All your fields will come in a separate line.
    Regards,
    Sasi
    Edited by: sasitharan on Jul 28, 2008 11:36 AM

  • Receiver file adapter command line

    hi,
    i am just wondering how to use command line on receiver file adapter.
    i am not clear how to use this.
    please modify on the following command!
    anyway, i have to call java application after put some files by receiver file adapter.
    cmd.exe %Fjava ./javacalltest
    it did not work..
    please guide me.
    Command Line
    An operating system command specified here is executed before or after a file has been successfully processed. The default value is an empty character string (no command).
    When the operating system command is called, the file name currently being processed can be specified with the following placeholders:
    %f (file name)
    %F (absolute file name including path)

    Hi Ogawa and Laurence,
    Have look at :: /people/michal.krawczyk2/blog/2007/02/08/xipi-command-line-sample-functions
    1)Windows batch Commands::
    http://labmice.techtarget.com/articles/batchcmds.htm
    2)Linux:
    /people/michal.krawczyk2/blog/2005/08/17/xi-operation-system-command--error-catching
    Note:: First try using the comands on O.S if they work then only use them in Adapters.
    Hope it will help.
    regards
    Piyush
    Pl:reward some points if it is usefull.

Maybe you are looking for

  • Dropped the computer, charger doesn't fit right. Help?

    I recently dropped my MacBook :'( and I didn't think it would have any lasting effects. HOWEVER, now the charger doesn't fit into the socket. I examined it and I THINK that the socket has been distorted by the fall. Help? p.s. I'm actually a middle s

  • Burn iDVD Disc Using Target Disc Mode?

    I would like to use my PowerMac G4 (with 20x DVD burner) to quickly burn files from my iMac (with slow burner) using some method (was thinking target disc mode). Is there any way to easily do this? Thanks!

  • CM50 - Breakdown Hours display

    Hi, I have the following requirement at my client site. 1. In CM50 report, they want Notification No and Type. In std system, Layout has Maintenance Notification field. I have selected that filed in the report and the new coulumn displayed is "Messag

  • Query about VRM_SET_VALUES

    I am working with module pool program and am using function module VRM_SET_VALUES to populate a list box.  I am writing the logic in the PAI of the screen flow logic. Eg: process on value-request. field list_field MODULE populate_list. This populates

  • Formula for minutes per month

    Post Author: olesco CA Forum: Formula How do I get the total number of minutes per month? RcvdDt                                Month  CalendarDays  #OfDays(excl Hol, Sat,&Sun)  MinPerDay  TotalMin/Mo 8/13/2007   8:40:25AM            8/07      31