Adding fields to database table and copying data from other fields

Hi All,
I am having a database table where in I am having a column 'FIELD1'.
My requirement is that I want to add two more fields in the table 'FIELD2' and 'FIELD3'.
I then want to copy all the data in field1 to field2 and field3. then I want to delete the original field1.
for Ex.
lets say FIELD1 = 100.
now I want to add FIELD2 and FIELD3 in the table and make FIELD2 = 100 AND FIELD3 = 100. The FIELD1 will be deleted from table.
Please suggest the methods to do so.
It is urgent.

Hi Gaurav,
do this way ...
data : begin of it_ztab occurs 0 with header line,
          fld1 like ztab-fld1,
          fld2 like ztab-fld2,
          fld3 like ztab-fld3,
        end of it_ztab.
data : wa_ztab like it_ztab.
it_ztab-fld1 = '100'.
append it_ztab.
clear    it_ztab.
loop at it_ztab.
  wa_ztab-fld2 = it_ztab-fld1.
  wa_ztab-fld3 = it_ztab-fld1.
  wa_ztab-fld1 = ' '.
* Make sure that the structure of internal table/ workarea and database table shoud be same
  modify ztab from wa_ztab.
endloop.

Similar Messages

  • ADF 11g can not select and copy data from cell of readonly table in IE

    hi,
    In ADF 11g, when render view object as readonly table with Single RowsSelection, using IE browser can not select and copy data from the cell, but it work in firefox.
    is it a bug?
    Edited by: kent2066 on 2009-5-18 上午8:46

    Hi Timo,
    Sorry forgot to mention versions.
    We are using 11.1.1.7 and IE 9.
    I tried in Google but could not get the solution.
    Kindly let me know solution for this.
    PavanKumar

  • Hi friends, I have a doubt in inserting a field to database table and inserting the same values in two different tables

    I have a mpp screen for a cd library management system (we are practicing on it).
    We have a main screen where a user should enter the enteries and while clicking a add button it should be inserted in a table, Here the problem rises the table name are ztransaction and zstatus.The fields in mpp are cdid,customerid,transaction id,date of issue and duedate.Now after entering all the values on clicking add button it should be inserted to database table ztransaction and the field cdid alone should be inserted both in ztransaction and zstatus.
    Thank you

    Hi Raghuram R G,
    Check for Primary key and foreign key in the Database table??? Because of this it was not inserting...check and confirm??
    Regds,
    Vijay SR

  • Copying data from other database

    I'm trying to create Job Schedule, which involve 2 diff database (Oracle & Visual Foxpro). But when i create database link, and try VF connection i got this error ORA-06401: NETCMN : invalid driver designator.
    PS: I already create connection VF thru ODBC, its work fine if im using SQLPlus and connect directly. only error if using database link, any suggestion?

    Susmita,
    I gave
    [copy]
    COPY from scott/tiger@ora52 to scott/tiger@ora87 insert emp using (select * from emp);
    [copy]
    The following error has occured..
    [copy]
    SQL* plus command ignored.
    invalid sql command...
    [copy]
    Thank you
    Edited by: user636482 on Apr 29, 2009 5:17 AM

  • EH&S: To import specification, phrase and releated data from other system

    Hi All,
    In our project there are two separate R/3 systems. On one product safety module of EH&S (version 4.6C) is present and on other SAP R/3 (version4.7) is present). Now we want to consolidate the data on 4.7 R/3 instance.
    For this activity, one idea is to replicate all the customizing form the EH&S system to R/3 system and transfer the master data like specification master, phrases and reports to R/3.
    Now, as the volume of specifications, phrases and all is huge wanted to know if some one has any idea on how it can be transferred.
    Can it be done like – sending the data form EH&S system using IDOCS (for example message type SUBMAS for specifications) and then posting this specification data in R/3 using inbound IDOC.
    Please validate / correct the approach which I am thinking of. If approach is good, want to know how to send the data from the EH&S system.
    Request your guidance on this.
    Thanks,
    Vithalprasad

    Hi Ofer,
    I read you need to do this import every day. With the DTW you have to do this manually(?).
    Another (however expensive) option is to use iBOLT from <a href="http://www.magicsoftware.com">Magic Software</a>.
    We also have a customer wich get's every day a few .csv files by email. iBOLT does get the .csv from the mailbox, does some preperation and imports the data into SBO. No user interaction required.
    Kind regards,
    Rowdy

  • Add a field in selection screen and enter data in that field .......

    Hi,
    I want to add a field in the seletion screen and when the user enters data , it should store in the data base table, the data base table is MKPF-BKTXT, please can any one let me know how to do this... very urgent...

    Hi
    Try to use EXIT_SAPMM07M_001, it's to update the item (not header) text, but you can try to use it:
    FIELD-SYMBOLS: <BKTXT> TYPE MKPF-BKTXT.
    ASSIGN ('(SAPMM07M)MKPF-BKTXT') TO <BKTXT>.
    IF SY-SUBRC = 0.
      <BKTXT> = <.....>.
    ENDIF.
    Max

  • Copying data from one field to another on a form

    Hi
    I have created a form called application which contains the following fields:
    Name
    Address1
    Address2
    Address3
    Address4
    Location1
    Location2
    Location3
    Location4
    When the user has entered his name and address I would like the data to then prefill into the location lines.
    I think you can do this sort of thing in java event handlers but I have no experience of this.
    Any one got any ideas how I can do this.
    Thanks
    Jayne

    hi Jayne,
    The following is an example of something just like what you want.
    In this form, get_add1Vals(); is called in the js-event handler for the field NEWFNAME1 which gets populated by the value selected or entered into FNAME1. The following code goes in the additional plsql code region (Before displaying the page).
    hope that certainly helps! please update it with your results.
    AMN
    BEGIN
    HTP.PRINT('<SCRIPT LANGUAGE="JavaScript1.1">
             function get_add1Vals{
                var  v_fname;
                for (i=0; i<document.forms[0].elements.length; i++)
                  if (document.forms[0].elements.name=="FORM_TBL_TEST_FORM_3.DEFAULT.FNAME.01")
    v_fname = document.forms[0].elements[i].value;
    break;
    if (document.forms[0].elements[i].name=="FORM_TBL_TEST_FORM_3.DEFAULT.NEWFNAME1.01")
    document.forms[0].elements[i].value = v_fname;
    break;
    void("");
    return true;
    </SCRIPT>');
    EXCEPTION
    When Others THEN
    null;
    END;

  • Seeking Pdf form help - javascript formula to auto-populate fields based on data from other fields.

    Hi there, I am new to PDF form work, and am wondering if someone could help me with a javascript formula.
    I want to auto-populate the EXPIRYDATE field, as the same date as the entered AUTHORIZATIONDATE field, but 4 years later.
    So, I want to be able to enter 11/14/2014 in the AUTHORIZATIONDATE date, and have 11/14/2018 auto populate in the EXPIRYDATE field.
    Seems simple I know, but I've messed around quite a bit and can't seem to make it work. Is this possible??
    Any help would be very much appreciated!!

    And what have you done?
    This can only be done with custom JavaScript programing.
    The value of date type fields are text field and not numeric data. The first task is to convert the dates to a number on some type of number sequence that is a mapping to dates.
    Have you looked at the Acrobat JavaScript API Reference, the MDN JavaScript reference?
    I would use the Acrobat JavaScript util.scand to covert the date string to the number of milliseconds from January 1, 1970 midnight. and then use the getFullYear method of the date object for the year value and add 4 years to that value and then use the setFullYear method to set the year for the date object. Now you can use the util.printd method to format the date object as a date string with a specific format.
    // get the date value, format of date string and years to add;
    var cDate = "11/14/2014"; // date value;
    var cFormat = "mm/dd/yyyy"; // date format;
    var nYears = 4; // years to add;
    // convert date string to date object;
    var oDate = util.scand(cFormat, cDate);
    if(oDate == null) {
    app.alert("Error converting " + cDate + " using format " + cFormat, 0, 1);
    // add years to date object;
    oDate.setFullYear(oDate.getFullYear() + nYears);
    // display result;
    var cExpireyDate = util.printd(cFormat, oDate);
    app.alert("Authorization Date: " + cDate + "." +
    "\nExpire Date: " + cExpireyDate, 3, 0);

  • Check automatic period overlap in database table and limit previous record.

    Hi,
    I'm creating a database table with records containing also two period filelds, BEGDA and ENDDA (begin and end of period).
    There's some setting that permit a new record to limit the previous end period? I prefer not to do that in the modulpool of the table view.
    Obviously I'm talking of 2 records having the same key fields.
    Thanks for answers.

    Yes you can do it in your maintenance dialog.
    But as far as I know, ENDDA must be a key field of your table (and also the last key field), but BEGDA should not.
    Then in your maintenance dialog include this code
        MODULE consistency.                             "VCX-19950103-183710
       ENDCHAIN.
       CHAIN.                                           "VCX-19950103-183710
        FIELD v_t511k-begda.                            "VCX-19950103-183710
        FIELD v_t511k-endda.                            "VCX-19950103-183710
        MODULE temp_delimitation ON CHAIN-REQUEST.      "VCX-19950103-183710
       ENDCHAIN.                                        "VCX-19950103-183710
       FIELD vim_marked MODULE liste_mark_checkbox.
       CHAIN.
        FIELD v_t511k-endda.
        FIELD v_t511k-konst.
        MODULE liste_update_liste.
    The relevant code is this:
       CHAIN.                                           "VCX-19950103-183710
        FIELD v_t511k-begda.                            "VCX-19950103-183710
        FIELD v_t511k-endda.                            "VCX-19950103-183710
        MODULE temp_delimitation ON CHAIN-REQUEST.      "VCX-19950103-183710
       ENDCHAIN.                                        "VCX-19950103-183710
    Then you'll have the DELIMIT button in the maintenance view, to delimit your records
    You can take the standard table T511K (and its maintenance view V_T511K) as an example.
    Edited by: Jose Maria Otero on Aug 31, 2011 1:18 PM

  • How to retrieve data from other websites?

    Hi all,
    Don't know if anyone can point me in the right direction.
    How can I retrieve or fetch data from other website&rsquo;s (*Database*) ?
    I&rsquo;m trying to build a web application that would retrieve and fetch data from other website&rsquo;s (Database) like the www.comparethemarket.com.
    The data I&rsquo;m trying to fetch it is in database, in my opinion I think I have to make a http web request then send parameters, then get the result. I could not find any tutorials
    on the web,
    Thank you.

    Fahad_24 wrote:
    Hi all,
    Don't know if anyone can point me in the right direction.
    How can I retrieve or fetch data from other website&rsquo;s (*Database*) ?
    I&rsquo;m trying to build a web application that would retrieve and fetch data from other website&rsquo;s (Database) like the www.comparethemarket.com.
    The data I&rsquo;m trying to fetch it is in database, in my opinion I think I have to make a http web request then send parameters, then get the result. I could not find any tutorials
    on the web,
    Thank you.Unless the website provides an interface to their data, you are most likely not even allowed to do this. There is only one way to find out: contact them and ask about it or look around their website if their is a manual that describes how to do it. If there is such an interface, it will usually be some kind of web service (such as a SOAP interface).

  • Copying data from excel(more than one row) and pasting into table control

    I have a requirement to copy data from excel and have it pasted it into the corresponding fields table control when the user clicks on an icon.For the first part I used a class to copy it from the clip board.By the previous process,I get the data inside an internal table, but even after  trying to split the data using 'split at cl_abap_char_utilities=>horizontal_tab into table itab.' it's not working.The table and the excel file are of the same structure.
    Does anyone know any cause as to why it might not work?Is there any other way to achieve my objective?
    Bon

    Hi,
    try to get data into internal table as below
    TYPES :     BEGIN     OF             ty_data          ,
                zbukr     TYPE           payr-zbukr       ,
                hbkid     TYPE           payr-hbkid       ,
                hktid     TYPE           payr-hktid       ,
                rzawe     TYPE           payr-rzawe       ,
                chect     TYPE           payr-chect       ,
                laufd     TYPE           reguh-laufd      ,
                laufi     TYPE           reguh-laufi      ,
                lifnr     TYPE           reguh-lifnr      ,
                vblnr     TYPE           reguh-vblnr      ,
                rwbtr     TYPE           reguh-rwbtr      ,    "uncommented
                unique_no TYPE           char13           ,   " Added SAP Doc. No. and current year concate in NEFT,RTGS and Fund Transfer cases
                END       OF             ty_data          .
    DATA :      wa_file   LIKE LINE OF   it_file          ,
                wa_data   TYPE           ty_data          .
    DATA:      it_data1 TYPE              kcde_intern WITH HEADER LINE,
               wa_data1 LIKE LINE OF      it_data1.
    start-of-selection.
    CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
          EXPORTING
            filename                = lv_file1
            i_begin_col             = '1'
            i_begin_row             = '4'
            i_end_col               = '11'
            i_end_row               = '60000'
          TABLES
            intern                  = it_data1
          EXCEPTIONS
            inconsistent_parameters = 1
            upload_ole              = 2
            OTHERS                  = 3.
        IF sy-subrc = 0.
          PERFORM format_data.
        ENDIF.
    FORM format_data.
      DATA : ld_index TYPE i.
      FIELD-SYMBOLS : <fs>.
      DATA it_tab LIKE wa_data OCCURS 0 WITH HEADER LINE.
          LOOP AT it_data1.
            MOVE it_data1-col TO ld_index.
            ASSIGN COMPONENT ld_index OF STRUCTURE
            it_tab TO <fs>.
            MOVE : it_data1-value TO <fs>.
        MOVE it_data1-value TO p_table.
            AT END OF row.
              APPEND it_tab.
              CLEAR it_tab.
            ENDAT.
          ENDLOOP.
           it_data[] = it_tab[] .
        ENDIF.
    endform.                    "format_data

  • Copying data from KeyFigures to database table in APO

    Hi Experts,
    Is there any way to copy the key figure values to APO database table?
    Can we use any macro function to satisfy this requirement?
    Is there any function module/BAPI which might be helpful to copy the KF data to DB table within APO?
    Thanks for looking into it..
    Rgds/
    Jay

    In the standard macro environment, there is a simple database table where you can store and retrieve data from, table /SAPAPO/ADV_SERI, with four keys and almost as many numbers as you want (combining some predefined column space and an iteration field). It only works for numbers.
    You can use TS_SET to save data and TS_GET to store, please check the macro online help for the complete syntax.
    Hope this helps,
    Pablo

  • I need to copy data from a table in one database (db1) to another table in

    Hi
    I need to copy data from a table in one database (db1) to another table in another database (db2).
    I am not sure if the table exists in db2,,,if it doesnot it needs to be created as well data also needs to be inserted...
    How am I supposed to this using sql statements..?
    I shall be happy if it is explained SQL also...
    Thanking in advance

    How many rows does the table contains? There are manyway you can achieve this.
    1. export and import.
    2. create a dblink between two databases and use create table as select, if structure doesnot exists in other database, if structure exists, use, insert into table select command.
    example:
    create a dblink in db2 database for db1 database.
    create table table1 as select * from table1@db1 -- when there is no structure present
    -- you need to add constraints manually, if any exists.
    insert into table1 select * from table1@db1 -- when there is structure present.
    If the table contains large volume of data, I would suggest you to use export and import.
    Jaffar

  • Help with writing and retrieving data from a table field with type "LCHR"

    Hi Experts,
    I need help with writing and reading data from a database table field which has a type of "LCHR". I have given an example of the original code but don't know what to change it to in order to fix it and still read in the original data that's stored in the LCHR field.
    Basically we have two Function modules, one that saves list data to a database table and one that reads in this data. Both Function modules have an identicle table which has an array of fields from type INT4, CHAR, and type P. The INT4 field is the first one.
    Incidentally this worked in the 4.7 non-unicode system but is now dumping in the new ECC6 Unicode system.
    Thanks in advance,
    C
    SAVING THE LIST DATA TO DB
    DATA: L_WA(800).
    LOOP AT T_TAB into L_WA.
    ZDBTAB-DATALEN = STRLEN( L_WA ).
    MOVE: L_WA to ZDBTAB-RAWDATA.
    ZDBTAB-LINENUM = SY-TABIX.
    INSERT ZDBTAB.
    READING THE DATA FROM DB
    DATA: BEGIN OF T_DATA,
                 SEQNR type ZDBTAB-LINENUM,
                 DATA type ZDBTAB-RAWDATA,
               END OF T_TAB.
    Select the data.
    SELECT linenum rawdata from ZDBTAB into table T_DATA
         WHERE repid = w_repname
         AND rundate = w_rundate
         ORDER BY linenum.
    Populate calling Internal Table.
    LOOP AT T-DATA.
    APPEND T_DATA to T_TAB.
    ENDLOOP.

    Hi Anuj,
    The unicode flag is active.
    When I run our report and then to try and save the list data a dump is happening at the following point
    LOOP AT T_TAB into L_WA.
    As I say, T_TAB consists of different fields and field types whereas L_WA is CHAR 800. The dump mentions UC_OBJECTS_NOT_CONVERTIBLE
    When I try to load a saved list the dump is happening at the following point
    APPEND T_DATA-RAWDATA to T_TAB.
    T_DATA-RAWDATA is type LCHR and T_TAB consists of different fields and field types.
    In both examples the dumps mention UC_OBJECTS_NOT_CONVERTIBLE
    Regards
    C

  • 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

  • Creative cloud download error please contact customer support

    I have installed and uninstalled creative cloud app multiple times. Each time I get the same error. "download error Please contact customer support. I have checked to see that the aamdetect plugin is installed. I have restarted safari. I have read ev

  • Impact of COMAPTIBLE parameter on database

    My database version is 10.2.0.4.0 and COMPATIBLE parameter value is 9.2.0.1, When run one select query its shows error ORA-01652: unable to extend temp segment by 64 in tablespace TEMPTBS2. But while try to run the same query on database version 10.2

  • Crash iTunes when moving files in downloads list?

    Twice in a row now I've been able to crash iTunes when moving files in the Downloads list (trying to change the priority). This happened twice when I tried to drag a file up above the list to get the list to scroll. iTunes would thrash the disk for a

  • I'm doing a vector, however the pen and Elipse tools don't work as they should.

    As I said, I'm working on a vector, but now whenever I use the pen or elipse tool, the shape doesn't fill in, even at 100% opacity. Changing to other tools I get a message that always ends with "Because the pixels in a group cannot be edited without

  • IDT: Relational Database Drivers

    Hello, When I try to create a new relational database connection in information-design-tool, the list of available drivers is completely empty. This is the case for local projects and for connections in the repository as well. I made sure that all re