Test an empty file

Hi,
I have to load data from file into oracle table, but if this file is empty, my scenario fails because of table constraints.
Can I evaluate if the file is empty in ODI before start loading?
thanks
Fabrizio

Cezar,
I am using ODI 10.1.3.2.0. and, tried to implement the solution you provided to check file size.
The solution works if the file size is 0 thru 250 but, I observed one pecular error: if the file size is greater than the size of column VAR_V in table SNP_VAR_DATA, it fails.
12899 : 72000 : java.sql.SQLException: ORA-12899: value too large for column "NAETLRW"."SNP_VAR_DATA"."VAR_V" (actual: 306, maximum: 250)
java.sql.SQLException: ORA-12899: value too large for column "NAETLRW"."SNP_VAR_DATA"."VAR_V" (actual: 306, maximum: 250)
     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
     at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
     at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
     at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639)
     at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:185)
     at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:633)
     at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1086)
     at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2984)
     at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3057)
     at com.sunopsis.sql.SnpsQuery.executeUpdate(SnpsQuery.java)
     at com.sunopsis.dwg.dbobj.generated.GeneratedSnpVarData.insertAction(GeneratedSnpVarData.java)
     at com.sunopsis.dwg.DwgObject.insert(DwgObject.java)
     at com.sunopsis.dwg.DwgObject.insert(DwgObject.java)
     at com.sunopsis.dwg.dbobj.SnpVarSess.treatAction(SnpVarSess.java)
     at com.sunopsis.dwg.dbobj.SnpSessTaskSqlV.execStdOrders(SnpSessTaskSqlV.java)
     at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
     at com.sunopsis.dwg.dbobj.SnpSessTaskSqlV.treatTaskTrt(SnpSessTaskSqlV.java)
     at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
     at com.sunopsis.dwg.dbobj.SnpSessTaskSqlV.treatTask(SnpSessTaskSqlV.java)
     at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
     at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
     at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
     at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
     at com.sunopsis.dwg.cmd.e.i(e.java)
     at com.sunopsis.dwg.cmd.h.y(h.java)
     at com.sunopsis.dwg.cmd.e.run(e.java)
     at java.lang.Thread.run(Thread.java:534)

Similar Messages

  • Empty file receiver - file adapter

    Hello,
    Scenario: File->XI->File.
    In my scenerio, I am using Java mapping to name the target filename and creating text file that is later sent to FTP, in that way I don't have to use content conversation, to save performance...
    I am on PI7.1 version so I have checked the options (Processing Parameters) for empty file handling in Sender/Receiver file communication channels.
    Issue:- Though the target file is created but it always contain 1 byte(NULL character). Any ideas??
    Thanks
    Anshul

    > In my scenerio, I am using Java mapping to name the target filename and creating text file that is later sent to FTP, in that way I don't have to use content conversation, to save performance...
    >
    The java mapping is genarating output as text file,right??have you tested your java mapping in NWDS or eclipse,because when you test in Operation mapping you will get error for text file,because it is not well formed.
    if your java mapping genarating text files perfectly then file content conversion not required at all,just give file name in Communication channel.
    > I am on PI7.1 version so I have checked the options (Processing Parameters) for empty file handling in Sender/Receiver file communication channels.
    >
    Why you have selected  empty file handling??it is not required.
    > Issue:- Though the target file is created but it always contain 1 byte(NULL character). Any ideas??
    >
    >
    unselct empty file handling test your interface with real data.
    let me know your issue.
    Regards,
    Raj

  • Empty file getting generated

    Hi Experts,
    We are testing a newly migrated scenario from XI 3.0 to PI 7.1.
    The Interface mapping consists of Message mapping followed by a ABAP Mapping.This scenario works fine in XI 3.0
    whereas when i try to test the same scenario in 7.1 it creates an empty file.
    I have tried to test the scenario using the first with message mapping alone and then with  abap mapping alone.
    Both work fine generating the expected results.But when i try to run them together it creates an empty file.
    I have maintained the values in exchange profile
    IntegrationBuilder ->IntegrationBuilder.Repository -> com.sap.aii.repository.mapping.additionaltypes
    R3_ABAP|Abap-class;R3_XSLT|XSL (ABAP Engine)
    We are testing an apap mapping for the first time in 7.1.Please let me know if i am missing any specific setting.
    Thanks,
    Sudhansu

    Hi,
    I assume that the abap mapping does not gets called from the ABAP Stack. 
    Try entering the abap mapping name again and save and activate.  Sometimes this might work.
    Check the class in abap stack and try to regenerate it.
    In the worst case scenario, modify something in the abap mapping and regenerate it.
    Regards
    Krish

  • Empty file to process in customer J2EE adapter module

    Hi All,
    if i give an empty text file to a sender communication channel, then no message is generated by XI.
    i want to generate a dummy XML if empty file is given.
    so is it possible to make a customer-specific J2EE adapter module - then deploy it - then if in sender comm channel this adapter module is written before SAPAdapter module, then should XI generate a dummy XML for this empty file.
    i am asking this because i developed a J2EE adapter module, then deployed it, then tried to invoke it  from sender comm channel but this J2EE adapter module is not getting invoked - this i can tell because i have written the following lines only in Java class process method:
    <i>Message msg_audit = (Message)inputModuleData.getPrincipalData();
    AuditMessageKey amk = new AuditMessageKey(msg_audit.getMessageId(),AuditDirection.OUTBOUND);
    Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS,"FileCheck: Module called");
                                                 return inputModuleData;</i>
    but still in the audit log only 3 messages of entire file content converted to XML format, empty doc so no sending of message and deleting of empty file are coming.
    <b>Can anybody suggest whether is it possible to process an empty text file to generate a dummy XML in sender communication channel in XI.</b>
    Thanks,
    Rajeev Gupta

    Hi All,
    When i write this code:
    try
                                                                obj = inputModuleData.getPrincipalData();                                                  
                                                                msg_audit = (Message)obj;
                                                                amk = new AuditMessageKey(msg_audit.getMessageId(),AuditDirection.OUTBOUND);
                                                                Audit.addAuditLogEntry(amk,AuditLogStatus.SUCCESS,"FileCheck: Module called");
                                       <i>File f = new File("/components/XITEMP/sample/PWC/check.txt");                                                            
                                                                          if (f.canWrite())
                                                                                         PrintStream ps;
                                                                                         FileOutputStream fos =new FileOutputStream(f);
                                                                                         File f1 = new File("/components/XITEMP/sample/PWC/check1.txt");
                                                                                         ps = new PrintStream(fos);
                                                                                         if (f1.exists()==false)
                                                                                              f1.createNewFile();                                                                    
                                                                                         ps.println("Testing");
                                                                                         ps.close();
                                                                                         fos.close();                                                            
                                                                               else
                                                                                    File f2 = new File("/components/XITEMP/sample/PWC/check2.txt");          
                                                                                    if (f2.exists()==false)
                                                                                              f2.createNewFile();                                                                    
                                                                               }               </i>                                        
    it works fine......it creates the file check1.txt
    but when i place the italiced code in this format:
         try
                                                                obj = inputModuleData.getPrincipalData();                                                  
                                                                msg_audit = (Message)obj;
                                                                amk = new AuditMessageKey(msg_audit.getMessageId(),AuditDirection.OUTBOUND);
                                                                Audit.addAuditLogEntry(amk,AuditLogStatus.SUCCESS,"FileCheck: Module called");
                                                           catch (Exception e)
                                                                     try
                                                                          File f = new File("/components/XITEMP/sample/PWC/check.txt");                                                            
                                                                          if (f.canWrite())
                                                                                         PrintStream ps;
                                                                                         FileOutputStream fos =new FileOutputStream(f);
                                                                                         File f1 = new File("/components/XITEMP/sample/PWC/check1.txt");
                                                                                         ps = new PrintStream(fos);
                                                                                         if (f1.exists()==false)
                                                                                              f1.createNewFile();                                                                    
                                                                                         ps.println("Testing");
                                                                                         ps.close();
                                                                                         fos.close();                                                            
                                                                               else
                                                                                    File f2 = new File("/components/XITEMP/sample/PWC/check2.txt");          
                                                                                    if (f2.exists()==false)
                                                                                              f2.createNewFile();                                                                    
                                                                     catch(Exception ex)
    it doesnot create the file check1.txt......
    Can anybody suggest why in the exception block this italiced code is not working........means it is working in try block of try{}catch{} block.......but it is not working in catch block of try{}catch{try{}catch{}}
    Thanks,
    Rajeev Gupta

  • File Content Conversion: Empty File

    Dear Experts,
    I'm doing a file to file scenario with FCC. My file gets picked up from the source folder but the communication channel doesn't send the file for processing ahead. This is the error I get in Communication channel monitoring:
    Channel Send_Acceptance_File: Entire file content converted to XML format
    2008-10-10 12:09:38| Warning |Channel Send_Acceptance_File: Empty document found. Proceed without sending message
    2008-10-10 12:09:38| Success |Confirmation mode test found. File will be resent next time
    I don't see any entry in sxmb_moni.
    What could be the possible reason for this.
    Thanks and Regards,
    Merrilly

    Hi Merrily
    Problem is with your FCC.
    Are you using Key field in FCC with and keyFieldInStructure      as ignore?
    This problem arises due to incorrect keys or Data type mis match for the record structure in FCC.
    Thanks
    Gaurav

  • File adapter with empty files!

    Hi guys,
    My scenario is: File -> XI (BPM) -> JDBC
    Under BPM I have a fork with two parallel receivers correlated and two sender file adapters for that. Those senders also have file conversion (.seq file to XML).
    My problem is: in case of files coming empty, is it possible that senders file adapter generates error during file conversion? And/or generates errors during correlations?
    If so, "I wouldn’t like", because after receive these two files I have a switch to check if the file(s) coming empty and a control step to terminate the process in case of true. But this only works if no errors have occurred on the earlier steps!
    At this moment I can’t test it, so I’m asking If anyone has faced an issue like this one?
    Thanks in advance,
    Ricardo.

    Hi,
    Which SP are you on?
    Before Sp19 on XI 3.0 and SP10 on Pi, Empty Files are ignored by XI. The file adapter picks the file and if it is a empty file ( a zero byets file ) the file does not create a message at all for the file.
    From Sp19, the file adapter has options that allow you to decide how to process the empty file. You can create an error message etc.
    Regards
    Bhavesh

  • Empty File at Target Directory

    Hi Experts,
    I am dealing with file to file scenario, where file is being posted to the target directory depending upon the condition, which is mentioned in Java Mapping. The Java Mapping is tested and is successfull. But, the problem is PI is generating file with 1KB (only one space) ain the alternate folder(where it shouldn't go depending upon the condition).
    The folder is having no space constraint and the file size is just 2KB.
    Empty file handling mode has been set to ignore. still its being generated
    Please suggest.
    Thanks & Regards,
    Sushama

    Hi Suraj,
    Here  it goes::
    for(int b=0;b<itemLineList.getLength();b++){
                             Node itemLineDetails = itemLineList.item(b);
                             NodeList itemLineDetailList = itemLineDetails.getChildNodes();
                             for(int c=0;c<itemLineDetailList.getLength();c++){
                                  Node ItemDetailsNode = itemLineDetailList.item(c);
                                  if(ItemDetailsNode.getNodeName().equalsIgnoreCase("MetaData")){
                                            NodeList ItemDetailsList = ItemDetailsNode.getChildNodes();
                                            status = checkIteminMDM(ItemDetailsList.item(1).getTextContent());
                                            if (status){
                                                 getTrace().addInfo("in update");
                                                 populateCreateorUpdateHashMap(ItemDetailsNode,"update");
                                            else{
                                                 getTrace().addInfo("in create");
                                                 populateCreateorUpdateHashMap(ItemDetailsNode,"create");

  • File content conversion scenario-empty file

    Hi all,
    I am doing file content conversion for my sender flat file. And I want to generate XML file in my receiver location.When I check with test tab in my message map in IR , no structure gets generated in RESULT.Overalls cenario is working fine and message is processed successfully but empty file is getting generated in target directory.When I check the payload in message content in RWB communication channel monitoring,it's picking data correctly from the file.I am not getting what might have gone wrong with my message mapping in IR. It's not showing any syntax error.Even it's not generating target message structure in Results window of test Messsage mapping.Could you suggest what mistake might be there in message mapping.

    Hi all,
       I am getting this message in message monitor(SXMB_MONI).
    com.sap.aii.utilxi.misc.api.BaseRuntimeException
    thrown during application mapping
    com/sap/xi/tf/_MM_Flat_content_conv_:
    RuntimeException in Message-Mapping transformatio~
    I am able to see the output structure in test window of message mapping in IR and communication channel monitoring is also showing successful message.
    fcc parameters used are:
    Header.fieldNames KEY,EMPID,NAME,COMPANY,PHONE
    Header.fieldFixedLengths 1,4,20,15,12
    Header.processConfiguration FromConfiguratiion
    Header.keyFieldValue H
    Detail.fieldNames KEY,COMPANY,LOCATION
    Detail.fieldFixedLengths 1,15,10
    Detail.processConfiguration FromConfiguratiion
    Detail.keyFieldValue D
    Please suggest the mistake in mapping
    Edited by: Jaya on Mar 3, 2010 12:45 PM
    Edited by: Jaya on Mar 3, 2010 12:47 PM

  • Dummy XML not getting generated from empty file by J2EE adapter module

    Hi All,
    i know when XI gets an empty input text file, it does not generate a send message for it in sender communication channel.
    in my scenario, if i get a file with data, i have to generate an XML message for it using file content conversion - this i have done...........
    but if i get an empty text file, then i have to generate a dummy XML send message for it for my BPM.......
    So i made a J2EE adapter module to generate dummy xml for empty file.....<b>when i give a file with data in it, then my adapter module is called..... but when i give an empty file, then my adapter module is not called</b>.........
    <b><i>Can anybody suggest why the module processor is not invoking my customer-adapter module when an empty file is given.............but the module processor is invoking my customer-adapter module when a file with data is given</i>.</b>
    Thanks,
    Rajeev Gupta

    Hi Amit,
    Below is the code of process method which i used:
    <i>public ModuleData process(ModuleContext moduleContext,
      ModuleData inputModuleData)
        throws ModuleException
    Object obj;
    Message msg_audit;
    AuditMessageKey amk;
    try
    File f = new File("/components/XITEMP/sample/PWC/check.txt");
    PrintStream ps;
    if (f.canWrite())
    FileOutputStream fos =new FileOutputStream(f);
    ps = new PrintStream(fos);  
    ps.println("Testing");
    ps.close();
    fos.close(); 
    else
      f = new File("/components/XITEMP/sample/PWC/check4.txt");
      if (f.exists() ==false)
      f.createNewFile();
    obj = inputModuleData.getPrincipalData();
    if (obj!=null)
    msg_audit = (Message)obj;
    amk = new AuditMessageKey(msg_audit.getMessageId(),AuditDirection.OUTBOUND);
    Audit.addAuditLogEntry(amk,AuditLogStatus.SUCCESS,"FileCheck: Module called");
    else
      String str = new String();
    String str1 = new String();     
                  str1="<?xml version=\"1.0\" encoding=\"utf-8\" ?>";
                 str1+="<ns:MT_PWC_RECORD xmlns:ns=\"urn://PWC_SR3_01/PWC/Customer\">";
             str1+="<RECORD_SET>";     
                 str1+="<RECORD>";
             str1+="<RECORD_DATA>BLANK_FILE</RECORD_DATA>";
             str1+="</RECORD>";
             str1+="</RECORD_SET>";
             str1+="</ns:MT_PWC_RECORD>";     
    str=str1; 
    inputModuleData.setPrincipalData(str);
    catch(Exception e)
    try
    File f = new File("/components/XITEMP/sample/PWC/check.txt");
    PrintStream ps;
    if (f.canWrite())
      FileOutputStream fos =new FileOutputStream(f);
      ps = new PrintStream(fos);  
      ps.println(e.toString());
      ps.close();
      fos.close(); 
    catch(Exception ex)
    return inputModuleData;
       }</i>
    in the above methood, i  used file operations at start just to see whether the module is getting invoked or not...so when i give a data file, then the file operations are performed and messages are written in audit log.........but when i give an empty file, then the file operations are not performed - meaning the module is not getting invoked........
    Thanks,
    Rajeev Gupta

  • Sender FCC with unbounded RecordSet Structure produces Empty File

    Hi Experts,
    My scenario is File (FTP) to IDoc, using FCC on the sender.
    The source file is a flat file representation of the IDoc e.g. with the segment names preceeding each record row.
    FCC parameters are as follows:
    RecordSet Name: Z1RECORDSETNAME
    RecordSet Structure: EDI_DC,1,E1TPDLH,1,Z1TPI2H,1,E1TPACC,E1TPTRM,,E1EDT13,,E1TPDIH,1,Z1TPI2HD,1,E1TPNOT,*
    RecordSet Sequence: Variable OR Ascending
    .fieldFixedLengths
    .fieldNames
    .keyFieldValue
    .endSeparator
    .keyFieldInStructure
    above parameters are used in all segments, except in E1TPNOT where ignoreRecordsetName is added
    My issue is when the test file contains more than 1 value for the unbounded segments E1TPTRM, E1EDT13 (e.g.  3 row values for E1TPTRM and 2 row values for E1EDT13) the Content Conversion succesfully finishes but produces an Empty File (size = 0)
    Does anyone know how to fix this issue?  Am i missing something in the parameters to be able to support the current file structure?
    Kindly share your ideas/solution
    I've tried to edit the test file to have only 1 record value for the unbounded segments and it is succesfull and does not produce an empty file.

    Try giving
    EDI_DC,1,E1TPDLH,1,Z1TPI2H,1,E1TPACC,E1TPTRM, * ,E1EDT13, * ,E1TPDIH,1,Z1TPI2HD,1,E1TPNOT,*
    I got it, i guess even you have given the astrix after E1TPTRM and E1EDT13 and it changed to bold.
    Ok ignore my answer.

  • Failed Receiver Determination on empty file

    I have seen suggestions matching the solution I have tried, but it is not working in my scenario.
    The scenario is an empty CSV file inbound to 3 receivers.  In the standard receiver determination,  I created a context condition for the 'SAP system' receiver, which uses RFC adapter.  The condition is:  'Sourcefilesize not equal 0'.  For an empty file, the 'SAP system' receiver should not be selected because it has mapping to the RFC structure.   The other 2 receivers are SFTP and file, and the client requires they receive the empty input file.
    I see the file size is captured in the dynamic configuration in the MONI:
    namespace:  XI/System/File.....name="Sourcefilesize">0<SAP:record...
    The error is: Problem while determining receivers using interface mapping:  Error while determining root tag of XML: BOM / charset detection failed.
    The system is PI 7.1, the sender comm channel is Advantco with namespace override and content conversion.  I have tried using file type 'binary' and type 'text', with UTF-8 encoding - results in the same error either way.  
    The file is coming from an external vendor - I do not believe they will make any changes to it, so hopefully this can be resolved in PI. 
    All suggestions are appreciated.  Thank you.

    Hareesh and Osman, thank you for your replies.
    I should have pasted the entire message.  When testing in the IB, it fails in receiver determination..
    ""Error when determining the receiver: Problem while determining receivers using interface mapping: Error while determining root tag of XML: BOM / charset detection failed Error while parsing an XML stream: &#39;BOM / charset detection failed&#39""
    Only the SAP system RFC receiver has message mapping - the SFTP and file receivers do not.  (I have changed only namespace and system names in screen below)
    Receiver determination -
    Interface Determination XXXX_D
    Interface Determination Archive_D
    Interface Determination SAP system

  • Receiver-File-Adatper creates empty files on FTP-Server

    Hi experts,
    I have a problem with my IDOC-to-File-scenario. My Mapping converts IDOCs to XML-files. Then the xml-files should be send to a ftp-server in New York. but only the filename is created on the ftp-server in New York. but without any content.
    At first I tested the scenario with a ftp-server in our company. and it works. the files and the right content were created. so the scenario and the mapping are working correctly.
    Have you any idea what the problem is?
    Thanks and best regrads
    Christopher

    Dont use anonymous login. Please provide user name and password.
    Also go to adapter engine queue. There see the details description of your message. There it will specify which file got created, on which FTP server, in which folder and also how many bytes XI has transferred. If possible let me know these details.
    Also try uploading any other file to FTP.
    For this got to Command prompt.
    1. open (o) IP ADDRESS
    2. User name
    3. Password
    4. go to specified folder
    5. Use PUT command to save the file on FTP server.
    If after all these empty files is getting created then contact your system administrator and tell him to check firewall settings. Because there are few parameters which allows data transfer.
    Because if firewall problem is there then u wont be able to put a file manually on that FTP server.
    Let me know the output.
    Warm Regards,
    Gouri

  • How to generate Empty file

    Hi all,
    I need to generate a empty file via XI when then there is no file in the sender directory during the particular time.
    we can't go with adapter module solution to do these.
    Please provide with the possible solutions.
    Thnz
    Faheem

    Hi,
    "I need to generate a empty file via XI when then there is no file in the sender directory during the particular time"
    your requirement looks a good example of BAM (Business Activity monitoring)....
    1) you can implement it using a BPM. Implement a condition in BPM for the first Receive step....
    2) this condition should check for how long it should wait to receive a file (have this time duration confirmed..)this will tell you that there is no file in the server to pick...
    3) develop a dummy structure (DT)....when your condition in step 3 is satisfied you can use this structure.
    4) before using this structure create a mapping with target as this dummy structure...change the occurence of the root node to 0..1
    5) In this mapping disable all the target fields. this will create an empty output.
    6) send this output to the desired location and you have created your empty file.
    I have not tested or implemented this scenario....this is only what I would have tried doing in the first attempt.
    If you succeed using this method then dont forget to post the final solution.
    Regards,
    Abhishek.

  • Solaris 10 creates empty files on one partition

    When I use following on this partition
    echo "This is a text" > /vaults/active/.status/TEST
    the system creates a empty file
    cat /vaults/active/.status/TEST # returns nothing
    The file will be created with 0 bytes.
    When I use another partition all is correct
    echo "This is a text" > /tmp/TEST
    cat /tmp/TEST # returns: This is a text
    What can be the reason for this behaviour? There are no quotas specified for the system.

    Is the /vaults/active/.status/ containing filesystem full? Can you create a directory? Ifso, can you create content in the newly created directory?

  • Edits in iPhoto create empty files

    iPhoto '08 imports photos correctly, but creates empty files (0kb) once I edit. The original is retained correctly, and I can always "revert to original" to get the files back, but about a quarter of my edited photos show up as empty files when I try to view them.  How can I fix it?  Why does it happen to some, but not others?

    Have these been shot with a Nikon? I've seen occasional reports on here of this happening with Nikons.
    As a Test:
    Hold down the option (or alt) key and launch iPhoto. From the resulting menu select 'Create Library'
    Import a few pics into this new, blank library. Is the Problem repeated there?

Maybe you are looking for