Data import XML and CSV

Hi,
I have customized incident form and added few fields as per our requirement.
All customized fields are in a separate class extension "ClassExtension_9cd2b3e6_25ea_4385_9a94_fc08e0cf6172"
Now we are planing to import incident data from our legacy ticketing tool (Manageengine Servicedesk).
Here is my XML code 
<CSVImportFormat>
<Projection Type="System.WorkItem.Incident.ProjectionType">
<Seed>
<Class Type="ClassExtension_9cd2b3e6_25ea_4385_9a94_fc08e0cf6172">
<Property ID="Id"/>
<Property ID="Source"/>
<Property ID="TierQueue"/>
<Property ID="Classification"/>
<Property ID="Title"/>
<Property ID="Urgency"/>
<Property ID="Impact"/>
<Property ID="Description"/>
<Property ID="Priority"/>
<Property ID="Status"/>
<Property ID="CreatedDate"/>
<Property ID="ActualEndDate"/>
<Property ID="ClosedDate"/>
<Property ID="ResolutionDescription"/>
<Property ID="Prod" />
<Property ID="ParentAccount" />
<Property ID="CustomerSupportAccount" />
<Property ID="Hardware" />
<Property ID="OperatingSystem" />
<Property ID="Browser" />
<Property ID="InternetConnection" />
<Property ID="ProblemAffectsOthers" />
<Property ID="SalesforceCase" />
<Property ID="TFS" />
<Property ID="CustomerSupportAgent" />
</Class>
</Seed>
<Component Alias="AffectedUser" Count="1">
<Seed>
<Class Type="System.Domain.User">
<Property ID="UserName" />
<Property ID="Domain" />
</Class>
</Seed>
</Component>
<Component Alias="AssignedUser" Count="1">
<Seed>
<Class Type="System.Domain.User">
<Property ID="UserName" />
<Property ID="Domain" />
</Class>
</Seed>
</Component>
</Projection>
</CSVImportFormat>
I am getting below error while importing CSV
Could not import the row on line 2 of CSV file C:\Users\administrator.TEST\Desktop\New folder (2)\New folder\Incident1.csv. It contains too few fields (number of fields expected 29 , found: 27).
Could not import the row on line 3 of CSV file C:\Users\administrator.TEST\Desktop\New folder (2)\New folder\Incident1.csv. It contains too few fields (number of fields expected 29 , found: 27).
Could not import the row on line 4 of CSV file C:\Users\administrator.TEST\Desktop\New folder (2)\New folder\Incident1.csv. It contains too few fields (number of fields expected 29 , found: 27).
Could not import the row on line 5 of CSV file C:\Users\administrator.TEST\Desktop\New folder (2)\New folder\Incident1.csv. It contains too few fields (number of fields expected 29 , found: 27).
Could not import the row on line 6 of CSV file C:\Users\administrator.TEST\Desktop\New folder (2)\New folder\Incident1.csv. It contains too few fields (number of fields expected 29 , found: 27).
Could not import the row on line 7 of CSV file C:\Users\administrator.TEST\Desktop\New folder (2)\New folder\Incident1.csv. It contains too few fields (number of fields expected 29 , found: 27).
Could not import the row on line 8 of CSV file C:\Users\administrator.TEST\Desktop\New folder (2)\New folder\Incident1.csv. It contains too few fields (number of fields expected 29 , found: 27).
Could not import the row on line 9 of CSV file C:\Users\administrator.TEST\Desktop\New folder (2)\New folder\Incident1.csv. It contains too few fields (number of fields expected 29 , found: 27).
Could not import the row on line 10 of CSV file C:\Users\administrator.TEST\Desktop\New folder (2)\New folder\Incident1.csv. It contains too few fields (number of fields expected 29 , found: 27).
Could not import the row on line 11 of CSV file C:\Users\administrator.TEST\Desktop\New folder (2)\New folder\Incident1.csv. It contains too few fields (number of fields expected 29 , found: 27).
Could not import the row on line 12 of CSV file C:\Users\administrator.TEST\Desktop\New folder (2)\New folder\Incident1.csv. It contains too few fields (number of fields expected 29 , found: 27).
Could not import the row on line 13 of CSV file C:\Users\administrator.TEST\Desktop\New folder (2)\New folder\Incident1.csv. It contains too few fields (number of fields expected 29 , found: 27).
CSV Import Summary Statistics for file C:\Users\administrator.TEST\Desktop\New folder (2)\New folder\Incident1.csv
Instances created in memory: 0
Instances failed in memory: 12
Instances committed to database: 0
Instances rejected by database: 0
Note:I have 27 Fields in my CSV file.
Regards, H@ri

Thanks Andreas,
I have made changes as suggested by you.But i am getting below error while importing the data.
============
Creating new CSVImporter 
Data Filename: C:\Users\administrator.TEST\Desktop\New folder (2)\New folder\Incident1.csv
Format Filename: C:\Users\administrator.TEST\Desktop\Incident1.xml
Validating against XSD schema...
Validation completed.
Warning: possible error in row on line 1 of CSV file C:\Users\administrator.TEST\Desktop\New folder (2)\New folder\Incident1.csv. The following message was logged:
--> Could not find cached enumeration value Source for property Source, class System.WorkItem.Incident in enumeration cache. You must specify either the Name or Guid of an enumeration of type IncidentSourceEnum.
Error: Could not import the row on line 1 of CSV file C:\Users\administrator.TEST\Desktop\New folder (2)\New folder\Incident1.csv. Object creation failed with the following error:
--> Exception of type 'Microsoft.EnterpriseManagement.CSVImport.CSVInstanceException' was thrown.
Warning: possible error in row on line 2 of CSV file C:\Users\administrator.TEST\Desktop\New folder (2)\New folder\Incident1.csv. The following message was logged:
--> Matched enum value E-Mail for property Source of class System.WorkItem.Incident in data file with enum display name: E-Mail. Display names may not be unique. Consider using actual property name IncidentSourceEnum.Email.
Warning: possible error in row on line 2 of CSV file C:\Users\administrator.TEST\Desktop\New folder (2)\New folder\Incident1.csv. The following message was logged:
--> Matched enum value SaaS IT NOC for property TierQueue of class System.WorkItem.Incident in data file with enum display name: SaaS IT NOC. Display names may not be unique. Consider using actual property name Enum.e5d90c8dd3074cf2a241968f3d676cde.
Warning: possible error in row on line 2 of CSV file C:\Users\administrator.TEST\Desktop\New folder (2)\New folder\Incident1.csv. The following message was logged:
--> Matched enum value EMR for property Classification of class System.WorkItem.Incident in data file with enum display name: EMR. Display names may not be unique. Consider using actual property name Enum.f9c3dc992c584534b420b0fff7d3d426.
Warning: possible error in row on line 2 of CSV file C:\Users\administrator.TEST\Desktop\New folder (2)\New folder\Incident1.csv. The following message was logged:
--> Matched enum value Medium for property Urgency of class System.WorkItem.TroubleTicket in data file with enum display name: Medium. Display names may not be unique. Consider using actual property name System.WorkItem.TroubleTicket.UrgencyEnum.Medium.
Warning: possible error in row on line 2 of CSV file C:\Users\administrator.TEST\Desktop\New folder (2)\New folder\Incident1.csv. The following message was logged:
--> Matched enum value Medium for property Impact of class System.WorkItem.TroubleTicket in data file with enum display name: Medium. Display names may not be unique. Consider using actual property name System.WorkItem.TroubleTicket.ImpactEnum.Medium.
Warning: possible error in row on line 2 of CSV file C:\Users\administrator.TEST\Desktop\New folder (2)\New folder\Incident1.csv. The following message was logged:
--> Matched enum value Closed for property Status of class System.WorkItem.Incident in data file with enum display name: Closed. Display names may not be unique. Consider using actual property name IncidentStatusEnum.Closed.
Warning: possible error in row on line 2 of CSV file C:\Users\administrator.TEST\Desktop\New folder (2)\New folder\Incident1.csv. The following message was logged:
--> Could not find cached enumeration value Prod1 for property Prod, class ClassExtension_9cd2b3e6_25ea_4385_9a94_fc08e0cf6172 in enumeration cache. You must specify either the Name or Guid of an enumeration of type Prod.
Error: Could not import the row on line 2 of CSV file C:\Users\administrator.TEST\Desktop\New folder (2)\New folder\Incident1.csv. Object creation failed with the following error:
--> Exception of type 'Microsoft.EnterpriseManagement.CSVImport.CSVInstanceException' was thrown.
=======================
Regards, H@ri

Similar Messages

  • How to extract data from xml and insert into Oracle table

    Hi,
    I have a large xml file. which will have hundreds of the following transaction tags having column names and there values.
    There is a table one of the schema with coulums "actualCostRate","billRate"....etc.
    I need to extract the values of these columns and insert into the table
    <Transaction actualCostRate="0" billRate="0" chargeable="1" clientID="NikuUK" chargeCode="LCOCD1" externalID="L-RESCODE_UK1-PROJ_UK_CNT_GBP-37289-8" importStatus="N" projectID="TESTPROJ" resourceID="admin" transactionDate="2002-02-12" transactionType="L" units="11" taskID="5017601" inputTypeCode="SALES" groupId="123" voucherNumber="ABCVDD" transactionClass="ABCD"/>
    <Transaction actualCostRate="0" billRate="0" chargeable="1" clientID="NikuEU" chargeCode="LCOCD1" externalID="L-RESCODE_US1-PROJ_EU_STD2-37291-4" importStatus="N" projectID="TESTPROJ" resourceID="admin" transactionDate="2002-02-04" transactionType="L" units="4" taskID="5017601" inputTypeCode="SALES" groupId="124" voucherNumber="EEE222" transactionClass="DEFG"/>

    Re: Insert from XML to relational table
    http://www.google.ae/search?hl=ar&q=extract+data+from+xml+and+insert+into+Oracle+table+&btnG=%D8%A8%D8%AD%D8%AB+Google&meta=

  • Saving mouse drawing data in xml and reterive it for edit in as3 flash

    i am wroking in action script 3 with flash i need to save mouse drawing data in xml and retrive it later for edit purpose i have found a good technique -http://memo.tv/drawing_and_exporting_svg_from_flash_as3
    here but not able to make sure how to store in xml and how to retrive it
    thanks for your help in advance

    Hello avneet,
    As you have to use the xml which you store so you have to decide which is the best xml reading logic and same way you have write xml and store it.

  • How to fetch data from XML and store it in internal table

    Hi All,
    Can anyone help me out, in fetching data from xml and store it in an internal table. Is there any standard function module is there?
    Regards,
    Karthick

    to do this you can either develop a XSLT program and use it with CALL TRNSFORMATION key word to tranform the XML into itab .
    (search the ABAP General forum, i have posted few samples)
    or simply use the following FM which converts your XML into a itab of name value pair (name would holw the element name and value would hold the value of the element) which you can then loop and read it to your itb.
    data:             xmldata type xstring .
    data: result_xml type standard table of smum_xmltb .
    data: return type standard table of bapiret2 .
    CALL FUNCTION 'SMUM_XML_PARSE'
      EXPORTING
        xml_input       = xmldata
      TABLES
        xml_table       = result_xml
        return          = return .
    Regards
    Raja

  • How to Convert internal table data into xml and xml data into internal tab

    Hi Guys,
          I have a requirement  that  i have to convert the internal table data into xml format and viceversa . for my requirement  i came to know that i have to use Transformations concept.  i done the converting the data from internal table into xml data by using standard Tranformations. My Question is 
    1) Can i use same Transformation to convert the xml data into abap internal table. if it is possible then how ???
    2) Is it possible using the standard Transformation  or I have to go for XSLT approach
    Please help me out from this guys,
    Thanks and Regards
    Koti

    Hi Koti,
    This is possible. There is a link. With the help of this link you can convert ABAP data to XML and vice versa.
    Link: http://www.heidoc.net/joomla/index.php?option=com_content&view=article&id=15:sapxslt&catid=22:sap-xslt&Itemid=31

  • How can I add links to open xml and csv files stored in another location? Please advice how to place links in my frame maker document?

    Hi,
    I would like to know as to how can I add links to open xml and csv files stored in another location? Please advice how to place links in my frame maker document?
    Kindly advice.
    Thanks
    Priya

    Special > Hypertext > Command "open document" will do its best to open the target document inside FrameMaker, which may not be much help; Special > Hypertext > Command "message …" will use the application you specify. The user guide for 7.0 says this about absolute links, and I don't think anything has changed since:
    For example, to start PaintBrush and open the Ship.pcx file on drive C you would use the command message system pbrush.exe C:/Ship.pcx
    I've not often used a relative link, and not recently: the same source says
    folder levels are separated by a slash / even in Windows and Mac
    [relative links] FrameMaker searches for a relative pathname beginning in the folder that contains the current document
    [absolute links] FrameMaker searches for an absolute pathname beginning at the top of the file system. In Windows, the absolute pathname begins with the drive specifier, a colon and a slash.

  • Problem with embedded data-sources.xml and custom UserManager

    Hi all,
    Our application uses a custom UserManager, which is basically extended from the JDBC UserManager, declared as follows in orion-application.xml:
         <user-manager class="com.infocorpnow.a2g.security.oracle.A2GUserManager">
              <property name="table" value="pos.users" />
              <property name="userNameField" value="username" />
              <property name="passwordFiled" value="password" />
              <property name="dataSource" value="jdbc/A2GDS" />
              <property name="groupMemberShipTableName" value="pos.user_roles" />
              <property name="groupMemberShipGroupFieldName" value="role_name" />
              <property name="groupMemberShipUserNameFieldName" value="login_id" />
         </user-manager>
    Since we want to be able to deploy the application several times on the application server, and therefore have each deployment of the ear point to its own datasource (i.e. its own local "A2GDS"), we've found out how to embed data-sources.xml inside the EAR file we're deploying, and modify the orion-application.xml as follows:
         <data-sources path="./data-sources.xml" />
    And then place data-sources.xml in the same meta-inf folder as the orion-application.xml.
    This has worked fine when deploying to the standalone OC4J.
    Now when I try to deploy the exact same EAR file in Oracle 9iAS, and I get to the User Manager screen, the Custom User Manager does not show up correctly. It did show up prior to me embedding the data-sources.xml. Please help? This is fairly urgent.
    Thanks
    Jason

    I should also mention I'm using the Java Edition of 9iAS R2 (9.0.3 container) on Solaris.

  • I am Furious. I updated to 12.1 and went from 1400 songs to 28. I have tried everything I can from online including moving previous libray and renaming, uninstall/reinstall/repair, importing xml and nothing.  Any suggestions?

    I am Furious. I updated to 12.1 and went from 1400 songs to 28. I have tried everything I can from online including moving previous libray and renaming, uninstall/reinstall/repair, importing xml and nothing. Any suggestions?

    See Empty/corrupt iTunes library after upgrade/crash.
    tt2

  • Import  xml and query

    Hi,
    Thanks in advance for reading this.
    I am new to this XML and import into database.
    I have the xml file, i need to import this into database and search on the database.
    I have around 2.2 million records in the database.
    Please explain me what is best method of storing in database, like store the file in clob column and search on the clob column.How the search is going to be on 2.2 million records.
    Please send me any if any sample code you have to [email protected]

    The answer on this question also depends on the version of the database you are using.
    With 9i/10g i would probably use structured storage of XML (based on the XMLschema).
    But the answer also depends on another question: does the XML document contains "2.2 million records" or will you be storing 2.2 million XML documents?

  • Retrieve XML,store as a file, update data in XML and insert back. Possible?

    Hello,
    I have XML records stored in the DB. Now I want to retrieve XML as a file to my local system, edit the data values for some element nodes, child nodes and re-insert that xml in its earlier place..
    Is this possible?
    If yes, can u pls tell me how to do it.
    I tried using WebDAV, but I guess it’s not working in my machine.
    Also, I don’t want to update the xml record directly using UPDATE command. I want to retrieve as a file, store in a local system, and then update that entry in the DB.
    Thanks in advance, and your help is appreciated.
    Regards,
    Athar

    Which database version are you using
    What is the output of lsnrctl status
    The easiest way to do this will be use WebDAV or FTP. However if not getting the data out as a file will require some coding work. Getting it back is fairly easy, use a bfile

  • Extract Data from XML and Load into table using SQL*Loader

    Hi All,
    We have a XML file (sample.xml) which contains credit card transaction information. We have a standard SQL*Loader control file which loads the data from a flat file and the control file code is written as position based method. Our requirement is to use this control file as per our requirement(i.e) load the data into the table from our XML file), But we need help in converting the XML to a flat file or Extract the data from the XML tags and pass the information to the control file and in turn it loads the table.
    Your suggestion is highly appreciated.
    Thanks in advance

    Hi,
    First of all go to PSA maintanance ( Where you will see PSA records ).
    Goto list---> Save-> File---> Spreadsheet (Choose Radio Button)
    > Give the proper file name where you want to download and then-----> Generate.
    You will get ur PSA data in Excel Format.
    Thanks
    Mayank

  • How do I use an XML Data Feed or a CSV Data Feed?

    I am trying to build a website for a business I started. My drop shipper has a "data feed" that has all of the info for the products (over 100k products). The data feed is available in bot XML and CSV format. I have searched what seems like forever, and cannot find any info on how to actually make it work.  Can anyone point me in the direction of how to actually do this? I have both dreamweaver and muse.do everything?
    Do I need to create different pages and things like that? Or does the data feed
    Also, The data feed is updated every  12 minutes after the hour, every 8 hours from the dropshipper, so will inputting the data feed automatically change on the website, or will I need to re add the data feed code every day?
    This is what the dropshippers website says ...
    Files on this page can be used to populate drop ship websites. We recommend that you update the inventory on your site as often as possible, both to make sure you have all the items we carry, and to avoid placing orders with us for items that are out of stock or discontinued.
    The Bronze feeds, (i.e., ELD-B01.csv, MC-B01.csv, ELD-B01.xml, and MC-B01.xml) start the update process 12 minutes after the hour, every 8 hours at 08:12, 16:12, 00:12 CST. Be advised it takes awhile to complete the update process because of the many different feeds and the amount of data.. The OutofStock.csv, Discontinued.csv and InStock.csv feeds are updated every 15 minutes.
    Thanks in advance!

    You would need to parse the XML feed into your site with PHP or JavaScript. 
    http://www.w3schools.com/php/php_xml_simplexml.asp
    Nancy O.

  • I am not getting required output after importing xml file having HTML tags, MathML and Latex code

    I created well formatted xml having html tags, MathML code and Latex code inside
    XML with sample latex
    <question>
        <p> 8. In this problem, <Image  style="vertical-align: -9pt" title="5a\frac{7b}{3}" alt="5a\frac{7b}{3}" href="http://www.snapwiz.com/cgi-bin/mathtex.cgi?%205a%5Cfrac%7B7b%7D%7B3%7D%0A"></Image> and <Image href="http://www.snapwiz.com/cgi-bin/mathtex.cgi?%207b%5Cfrac%7B5a%7D%7B3%7D" style="vertical-align: -9pt" title="7b\frac{5a}{3}" alt="7b\frac{5a}{3}"> </Image>are both mixed numbers, like <Image src="http://www.snapwiz.com/cgi-bin/mathtex.cgi?%203%20%5Cfrac%7B1%7D%7B2%7D%20=%203.5" style="vertical-align: -9pt" title="3 \frac{1}{2} = 3.5" alt="3 \frac{1}{2} = 3.5"></Image>. The expression <Image style="vertical-align: -9pt" title="5a \frac{7b}{3} \ \times 7b \frac{5a}{3}" alt="5a \frac{7b}{3} \ \times 7b \frac{5a}{3}" href="http://www.snapwiz.com/cgi-bin/mathtex.cgi?%205a%20%5Cfrac%7B7b%7D%7B3%7D%20%5C%20%5Ctimes %207b%20%5Cfrac%7B5a%7D%7B3%7D"> </Image>is equal to which of the following choices? </p>
    </question>
    XML with sample html tags
    <p>4. Examine the expression 3<i>k</i><sup>2</sup> + 6<i>k</i> - 5 + 6<i>k</i><sup>2</sup> + 2.</p><p>When it is simplified, which of the following is the equivalent expression?</p>
    XML with sample MathML tags
    <p>5. Find the vertex of the parabola associated with the quadratic function <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>y</mi><mo> </mo><mo>=</mo><mo> </mo><mo>-</mo><msup><mi>x</mi><mn>2</mn></msup><mo> </mo><mo>+</mo><mo> </mo><mn>10</mn><mi>x</mi><mo> </mo><mo>+</mo><mo> </mo><mn>4</mn></math></p>
        <math xmlns="http://www.w3.org/1998/Math/MathML"><mfenced><mrow><mo>-</mo><mn>5</mn><mo>,</mo><mo> </mo><mn>69</mn></mrow></mfenced></math><br>
        <math xmlns="http://www.w3.org/1998/Math/MathML"><mfenced><mrow><mn>5</mn><mo>,</mo><mo> </mo><mn>29</mn></mrow></mfenced></math><br>
        <math xmlns="http://www.w3.org/1998/Math/MathML"><mfenced><mrow><mn>5</mn><mo>,</mo><mo> </mo><mn>69</mn></mrow></mfenced></math><br>
        <math xmlns="http://www.w3.org/1998/Math/MathML"><mfenced><mrow><mo>-</mo><mn>5</mn><mo>,</mo><mo> </mo><mn>29</mn></mrow></mfenced></math>
    None of the above works fine after importing xml to Indesign document/templete, it is not renderting equivalent out instead it is showing the same text inside tags in the Indesign document.
    I have lot of content in our database, I will export to XML, import to Indesign, Indesign should render required output like what we see in the browser and export the output to printed format.
    Import formated XML to indesign --> Export to Quality Print Format
    Can any one guide me and let me know whether it is posible to do with Indesign, if so let me know in case if I am missing anything in importing xml and get required output.
    Thanks in advance. Waiting for reply ASAP.

    Possibly your expectations are too high. ... Scratch that "possibly".
    XML, in general, cannot be "rendered". It's just an abstract data format. Compare it to common markup such as *asterisks* to indicate emphasized words -- e-mail clients will show this text in bold, but InDesign, and the vast majority of other software, does not.
    To "render" XML, HTML, MathML, or LaTeX -- you seem to freely mix these *very* different markup formats, unaware of the fact that they are vastly different from each other! -- in the format you "expect", you need to apply the appropriate software to each of  the original data files. None of these markup languages are supported natively by InDesign.

  • How Can I Import Contacts from Excel (XLSX/XLS) and CSV file to VCF File?

    Hi Friends,
    I have stored my all official and personal contacts list in the Excel (XLSX/XLS) spreadsheet and CSV file from long time. But now, I want to move my all contacts in an MS outlook 2013 and also Samsung S4 Contacts directory. But for this process, I require to import all Excel and CSV file contacts into VCF file format. So that, I could export vCard (VCF) file in the outlook and Samsung S4 contacts book. But I don't know about this process that how to import Excel and CSV file contacts into vCard format. If anyone has best solution to import and export excel or CSV file contacts into VCF file, so please share with me that information.
    Thanks & Best Regards
    Jackson T.
    <Edited By Host>

    https://itunes.apple.com/gb/app/csv-to-vcard/id713295900?mt=12

  • Extract data from database tables and download in pdf and csv

    extract data from database tables and download in pdf and csv
    hi how can i re-write my old form procedure in adf java. the procedure used to extract data from diffirent table and dowload the data in pdf and csv.am not downloading image, i what to extract data from diffirent tables in my database and download that data in pdf and csv. i would like to write this in java adf.i just what direction am not asking anyone to do my work this is my learning curve
    the form code is
    function merge_header3 return varchar2 is
    begin
         return '~FACILITY DESCRIPTION~ACCOUNT NO~BRANCH CODE~BANK REF NO.~P/P/ AMOUNT~Postal Address 1~Postal Address 2~Box Postal Code~Dep. Date~Month~BANK NAME~BRANCH NAME~ACCOUNT TYPE~DESCRIPTION~OBJECTIVE DESCRIPTION';
    end;
    procedure download_file (i_pbat integer) is
      dir varchar2(80);
      file_name1 varchar2(80);
      file_name2 varchar2(80);
      appl_code varchar2(80);
      fil1 client_text_io.file_type;
      fil2 client_text_io.file_type;
      dat varchar2(1000);
      DATA VARCHAR2(1000);
      bvspro varchar2(100);
      ssch   varchar2(100);
      bvspro_total number(20,2);
      ssch_total   number(20,2);
      grand_total  number(20,2);
      cnt    integer;
      cursor pbat is
           select *
           from sms_payment_batches
           where id = i_pbat
      cursor pay  (pb_id integer) is
           select *
           from sms_payment_vw
           where pbat_id = pb_id
           order by subsidy ASC,programme,beneficiary_name
      cursor cgref (low varchar2) is
           select *
           from cg_ref_codes
           where rv_domain ='SMS'
           and rv_low_value = low
      success boolean;     
      begin  
           set_application_property(cursor_style,'busy');
           appl_code := sms_global.ref_code('SMS','APP_CODE','SMS',0);
        dir       := sms_global.ref_code('SMS','PAY_DIR','c:\sms\batch_payments',0);
             success := webutil_file.create_directory(dir);
         if webutil_file.file_is_directory(dir) then
             null;
    --         message ('directory exists');
        else
    --                  message ('create directory ');
             success := webutil_file.create_directory(dir);
    --         if success then        message ('directory exists');    end if;
        end if;     
        for c_pbat in pbat loop
             file_name1 := dir ||'\' || appl_code||c_pbat.batch_number||'-'||to_char(c_pbat.batch_dt,'yyyymmdd')||'pay.txt';
             file_name2 := dir ||'\' || appl_code||c_pbat.batch_number||'-'||to_char(c_pbat.batch_dt,'yyyymmdd')||'merge.txt';
    --message('create files ');
    --         fil1  := client_text_io.fopen (file_name1,'W');
    --         fil2  := client_text_io.fopen (file_name2,'W');
        fil1  := client_text_io.fopen (file_name1,'W','');
        fil2  := client_text_io.fopen (file_name2,'W','');
                   dat :=                       'FROM ACCOUNT NUMBER'
                                                                ||'~'||'FROM ACCOUNT DESCRIPTION'
                                                                ||'~'||'MY STATEMENT DESCRIPTION'
                                                                ||'~'||'BENEFICIARY ACCOUNT NUMBER'
                                                                ||'~'||'BENEFICIARY SUB ACCOUNT NUMBER'        
                                                                ||'~'||'BENEFICIARY BRANCH CODE'
                                                                ||'~'||'BENEFICIARY NAME'
                                                                ||'~'||'BENEFICIARY STATEMENT DESCRIPTION'
                                                                ||'~'||'AMOUNT';
             --     client_text_io.put_line(fil1,dat);
             bvspro:= null;
             ssch  := null;
             cnt := 0;     
             dat := '~'||lpad('~',16,'~');
             for c_pay in pay(c_pbat.id) loop
    --message('cpay loop ' || cnt);              
               if bvspro is null then
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(1,c_pay.programme,dat,'~');     
               client_text_io.put_line(fil2,dat);
               dat := utility.put_field(1,c_pay.subsidy,dat,'~');
               client_text_io.put_line(fil2,dat);
               dat := merge_header3;
                     client_text_io.put_line(fil2,dat);
                     bvspro := c_pay.programme;
                     ssch := c_pay.subsidy;
                     grand_total := 0;
                     bvspro_total := 0;
                     ssch_total := 0;
               end if;
               if bvspro <> c_pay.programme then
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(5,ssch_total,dat,'~');
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(5,bvspro_total,dat,'~');
               dat := utility.put_field(1,'Total:' || bvspro,dat,'~');
                     client_text_io.put_line(fil2,dat);
                     dat := lpad('~',16,'~');
               client_text_io.put_line(fil2,dat);
                     dat := utility.put_field(1,c_pay.programme,dat,'~');     
               client_text_io.put_line(fil2,dat);
                     bvspro := c_pay.programme;
               dat := utility.put_field(1,c_pay.subsidy,dat,'~');
               client_text_io.put_line(fil2,dat);
               dat := merge_header3;
                     client_text_io.put_line(fil2,dat);
                     bvspro := c_pay.programme;
                     ssch := c_pay.subsidy;
                     bvspro_total := 0;
                     ssch_total := 0;
                     cnt :=0;
             end if;                           
               if ssch <> c_pay.subsidy then
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(5,ssch_total,dat,'~');
                     dat := lpad('~',16,'~');
               client_text_io.put_line(fil2,dat);
               dat := utility.put_field(1,c_pay.subsidy,dat,'~');
               client_text_io.put_line(fil2,dat);
               dat := merge_header3;
                     client_text_io.put_line(fil2,dat);
                     ssch := c_pay.subsidy;
                     ssch_total := 0;
                     cnt :=0;
             end if;                           
            bvspro_total := bvspro_total + c_pay.amount;
            ssch_total   := ssch_total   + c_pay.amount;              
                  grand_total  := grand_total  + c_pay.amount;              
            cnt := cnt +1;
    --message('bfore write file 2 ' );              
            client_text_io.put_line(fil2
                                   ,cnt
                            ||'~'|| c_pay.beneficiary_name
                                                                ||'~'||c_pay.BENEFICIARY_ACCOUNT_NUMBER ||''            
                                                                ||'~'||c_pay.BRANCH_CODE             ||''           
                                                                ||'~'|| c_pay.BENEFICIARY_STATEMENT_DESC            
                                                                ||'~'|| c_pay.AMOUNT                                
                            ||'~'|| c_pay.address_line1
                            ||'~'|| c_pay.address_line2
                                                    ||'~'|| c_pay.postal_code
                                                    ||'~'|| TO_CHAR(c_pay.deposit_date,'DD-Mon-YYYY')
                                                    ||'~'|| c_pay.month
                                                    ||'~'|| c_pay.bank
                                                    ||'~'|| c_pay.bank_branch
                                                    ||'~'|| c_pay.account_type
                                                    ||'~'|| c_pay.subsidy
                                                    ||'~'|| c_pay.programme)
                  DATA :=                                  c_pay.FROM_ACCOUNT_NUMBER                   
                                                                ||'~'||c_pay.FROM_ACCOUNT_DESCR                    
                                                                ||'~'||c_pay.MY_STATEMENT_DESCR                    
                                                                ||'~'||c_pay.BENEFICIARY_ACCOUNT_NUMBER
                                                                ||'~'
                                                                ||'~'||c_pay.BRANCH_CODE            
                                                                ||'~'||c_pay.BENEFICIARY_NAME                      
                                                                ||'~'||c_pay.BENEFICIARY_STATEMENT_DESC            
                                                                ||'~'||c_pay.AMOUNT;                                
            DATA := REPLACE(DATA, ',' , ' ' );
            DATA := REPLACE(DATA, '~' , ',' );
    --message (cnt ||' ' || data);       
    --message('bfore write file 1 ' );              
                  client_text_io.put_line(fil1, data);
             end loop;
    --message ('end of write');         
                 dat := lpad('~',16,'~');
                 dat := utility.put_field(6,ssch_total,dat,'~');
                 dat := lpad('~',16,'~');
           dat := utility.put_field(1,'Total:' || bvspro,dat,'~');
                 dat := utility.put_field(5,bvspro_total,dat,'~');
              client_text_io.put_line(fil2,dat);
              dat := lpad('~',16,'~');
           client_text_io.put_line(fil2,dat);
           dat := utility.put_field(1,'Grand Total:' ,dat,'~');
                 dat := utility.put_field(5,grand_total,dat,'~');
              client_text_io.put_line(fil2,dat);
             -- close file
    for i in 1..50 loop  
           if substr(i,-1) = 0 then
                 message ('flush ' || i);
           end if;                 
                  client_text_io.put_line(fil1, lpad(' ',2000));
                  client_text_io.put_line(fil2, lpad(' ',2000));
                  client_text_io.put_line(fil1, lpad(' ',2000));
                  client_text_io.put_line(fil2, lpad(' ',2000));
    end loop;
             client_text_io.fclose(fil1);
             client_text_io.fclose(fil2);
        end loop;
       set_application_property(cursor_style,'default');
        exception
             when others then
                  message(sqlcode ||' ' ||sqlerrm);
       end download_file;    i try this but this code onlydownload image not data from database tables
        public void downloadImage(FacesContext facesContext, OutputStream outputStream)
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
            // get an ADF attributevalue from the ADF page definitions
            AttributeBinding attr = (AttributeBinding) bindings.getControlBinding("DocumentImage");
            if (attr == null)
                return;
            // the value is a BlobDomain data type
            BlobDomain blob = (BlobDomain) attr.getInputValue();
            try
            {   // copy the data from the BlobDomain to the output stream
                IOUtils.copy(blob.getInputStream(), outputStream);
                // cloase the blob to release the recources
                blob.closeInputStream();
                // flush the output stream
                outputStream.flush();
            catch (IOException e)
                // handle errors
                e.printStackTrace();
                FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, e.getMessage(), "");
                FacesContext.getCurrentInstance().addMessage(null, msg);
            }

    You should ask your forum in the ADF-forum.

Maybe you are looking for