How to dump data in file from inetrnal table.

LOOP AT I_KEYROLEUSERS.
READ TABLE I_USERS WITH KEY UNAME = I_KEYROLEUSERS-UNAME INTO WA_USERS.
IF sy-datum > WA_USERS-DFROM and sy-datum < WA_USERS-DTO.
Concatenate 'SAPP40' '001305900' I_KEYROLEUSERS-UNAME 'GID'
             WA_USERS-LNAME WA_USERS-FNAME WA_USERS-EMAIL '1'
             WA_USERS-DFROM WA_USERS-DTO I_KEYROLEUSERS-KEYROLE '563H'
             INTO WA_STRING SEPARATED BY '!'.
ELSE.
Concatenate 'SAPP40' '001305900' I_KEYROLEUSERS-UNAME 'GID'
             WA_USERS-LNAME WA_USERS-FNAME WA_USERS-EMAIL '0'
             WA_USERS-DFROM WA_USERS-DTO I_KEYROLEUSERS-KEYROLE '563H'
             INTO WA_STRING SEPARATED BY '!'.
ENDIF.
APPEND WA_STRING TO I_STRING.
ENDLOOP.

if you would like to put the file in app server.. u can do it using Open dataset
it would be a nice option to do:
when executed in foreground put to local dirve using GUI_Download FM and when executed in back-ground (sy-batch = 'X') write to app file using open dataset.

Similar Messages

  • How to convert data when transferring from one table to another

    I have two tables and these are the structure of the tables
    create table E1(
    ID NUMBER
    ,NAME VARCHAR2(30)
    , DESIGNATION VARCHAR2(30)
    ,GENDER VARCHAR2(10));
    create table E2(
    ID NUMBER
    ,NAME VARCHAR2(30)
    , DESIGNATION VARCHAR2(3)
    ,GENDER NUMBER); Now I want to transfer records from one table to another using a master tables where data are compared because the datatypes in tables are different
    The first one is a gender table to match the gender and convert
    create table Gender(
    E1 varchar2(10),
    E2 number);The second is for the designation
    create table Designation(
    E1 varchar2(30),
    E2 varchar2(3);How to match and convert the data so that it can be transfered.

    Peeyush wrote:
    Can we do it with the help of a cursor.
    All SQL executed by the database are parsed as cursors and executed as cursors.
    I mean I have to insert data in bulk and I want to use cursor for it.The read and write (select and insert) are done by the SQL engine. The read part reads data and passes it to the write part that inserts the data.
    Now why would using PL/SQL and bulk processing make this faster? It will reside in-between the read part and the write part being done by the SQL engine.
    So the SQL engine reads the data. This then travels all the way to the PL/SQL engine as a bulk collect. PL./SQL then issues an insert (the write part to be done by the SQL engine). And now this very same data travels all the way from the PL/SQL engine to the SQL engine for insertion.
    So just how is this approach, where you add extra travel time to data, faster?
    and i want to commit the transaction after every 50 recordsWhy? What makes you think this is better? What makes you think you have a problem with not committing every 50 rows?

  • How to download a clob file from a table to my local drive?

    Hii Everyone,
    I'm havig a table of this structure
    Create table r_dummy
    c_clob_file clob
    How to download this file into my local drive?Please give me some hints.Can this be done using dbms_lob??
    Regards
    Raghu.

    You need to share a directory on your local drive and give permissions for the database server to write a file on your local drive. Or you may create the file on your database server and copy the same to your local drive.
    conn / as sysdba
    create or replace directory ext_tab_dir as 'C:\ExtTab_Dir';
    /* you may need to give a network path in place of C:\ExtTab_Dir if you want to create the file on your local drive. The directory should be created manually by you on the file system*/
    grant read, write on directory ext_tab_dir to scott;
    conn scott/tiger
    declare
            clb clob;
            l_output utl_file.file_type;
            len integer(6);
            vstart integer(6):=1;
            bytelen integer(6):=32000;
            my_vr varchar2(32000);
            x integer(6);
    begin
             l_output := utl_file.fopen('EXT_TAB_DIR','Clob_File.txt','w',32767);
            select c_clob_file into clb
             from r_dummy;
             len:=dbms_lob.getlength(clb);
             x:=len;
            while vstart < len and bytelen > 0
            loop
                dbms_lob.read(clb,bytelen,vstart,my_vr);
                utl_file.put(l_output,my_vr);
                utl_file.fflush(l_output);
                vstart:=vstart+bytelen;
                x:=x-bytelen;
                if x< 32000 then
                   bytelen := x;
                end if;
            end loop;
            utl_file.fclose(l_output);
    exception when others then
            utl_file.fclose(l_output);
            raise;
    end;
    /Edited by: Preta on Sep 29, 2010 10:53 AM

  • How to delete an .xml file from xmltype table?

    Hi expert,
    I am in I am in Oracle Enterprise Manager 11g 11.2.0.1.0.
    SQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 22 11:40:23 2011
    I have inserted 3 .xml files into an xmltype table: DOCUMENT
    SQL> SELECT OBJECT_VALUE FROM document;
    OBJECT_VALUE
    <?xml version="1.0" encoding="WINDOWS-1252"?>
    <?xml-stylesheet href="http://www.accessdata.fda.gov/spl/stylesheet/spl.xsl" type="text/xsl"?>
    <document xmlns="urn:hl7-org:v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLoc
    ation="urn:hl7-org:v3 http://localhost:8080/home/DEV/xsd/spl.xsd" classCode="DOC">
    <id root="5ca4e3cb-7298-4948-8cc2-58e71ad32694"/>
    <code code="51725-0" c
    <?xml version="1.0" encoding="WINDOWS-1252"?>
    <?xml-stylesheet href="http://www.accessdata.fda.gov/spl/stylesheet/spl.xsl" type="text/xsl"?>
    <document xmlns="urn:hl7-org:v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLoc
    ation="urn:hl7-org:v3 http://localhost:8080/home/DEV/xsd/spl.xsd" classCode="DOC">
    <id root="03d6a2cd-fdda-4fe1-865d-da0db9212f34"/>
    <code code="51725-0" c
    <?xml version="1.0" encoding="WINDOWS-1252"?>
    <?xml-stylesheet href="http://www.accessdata.fda.gov/spl/stylesheet/spl.xsl" type="text/xsl"?>
    <document xmlns="urn:hl7-org:v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLoc
    ation="urn:hl7-org:v3 http://localhost:8080/home/DEV/xsd/spl.xsd" classCode="DOC">
    <id root="09ff06d6-8b85-43dd-b5cc-e22d00f02bd0"/>
    <code code="51725-0" c
    I tried to delete one xml file which with id root="03d6a2cd-fdda-4fe1-865d-da0db9212f34'
    delete from DOCUMENT
    where xmlexists('$p/document/id[@root="03d6a2cd-fdda-4fe1-865d-da0db9212f34"]'PASSING OBJECT_VALUE AS "p");
    but failed.
    Is there any expert can help?
    Thanks a lot!
    Cow
    Edited by: Cow on Mar 11, 2011 7:02 PM

    Hi,
    Namespace issue.
    You have to declare it in the XQuery prolog :
    DELETE FROM document
    WHERE XMLExists( 'declare default element namespace "urn:hl7-org:v3"; (::)
                      $p/document/id[@root=$root_value]'
                     passing object_value as "p",
                             '03d6a2cd-fdda-4fe1-865d-da0db9212f34' as "root_value" )
    ;

  • How to Create a excel file from a table.

    i want to excel output from a oracle table.

    Please use below one:
    DECLARE
    CURSOR C1
    IS
    SELECT DISTINCT JVH_LCM_LCTN_CODE FROM F_JV_HDR;
    CURSOR C2 (V_LOC VARCHAR2)
    IS
    SELECT *
    FROM
    (SELECT *
    FROM F_JV_HDR
    WHERE JVH_JV_DATE <= '31-OCT-2011'
    AND JVH_DSM_DCMNT_TYPE = 'SJV'
    AND JVH_LCM_LCTN_CODE = V_LOC
    ORDER BY JVH_JV_DATE DESC
    WHERE ROWNUM <= 10
    UNION ALL
    SELECT *
    FROM
    (SELECT *
    FROM F_JV_HDR
    WHERE JVH_JV_DATE > '31-OCT-2011'
    AND JVH_DSM_DCMNT_TYPE = 'SJV'
    AND JVH_LCM_LCTN_CODE = V_LOC
    ORDER BY JVH_JV_DATE
    WHERE ROWNUM <= 10;
    v_file utl_file.file_type;
    linebuf VARCHAR2(32767);
    BEGIN
    v_file := utl_file.FOPEN('MAIL_OUTPUT','F_JV_HDR-SJV.csv','w') ;      --Change the CSV file name
    LINEBUF := 'JVH_LCM_LCTN_CODE,JVH_DSM_DCMNT_TYPE,JVH_JV_TMPRY_NMBR,JVH_JV_TMPRY_DATE,JVH_SRCE_INDCTR,JVH_CRTD_DATE,JVH_CRTD_BY,JVH_ATHRSTN_STS,JVH_DSM_TRM_TR_CODE,JVH_DSM_DCMNT_SRS,JVH_LCM_LCTN_CODE_BOOK,JVH_ATHRSTN_RQRD_INDCTR,JVH_FNCL_CLSRE_INDCTR,JVH_TRNSCTN_WITH_INDCTR,JVH_TRNSCTNR_CODE,JVH_JV_NMBR,JVH_JV_DATE,JVH_RMRKS,JVH_JV_RVRSD_NMBR,JVH_CHQE_DUE_DATE,JVH_ATHRSD_DATE,JVH_ATHRSD_BY,JVH_TR_CODE_RVRSD,JVH_DCMNT_TYPE_RVRSD,JVH_JV_RVRSD_INDCTR,JVH_NJV_TAG,JVH_TYPE,JVH_AUTO_RVSL_INDCTR,JVH_AUTO_RVSL_DATE,JVH_BUS_BKS_UPLOAD';                --Chage the headings
    utl_file.put_line(v_file,linebuf);
    FOR I1 IN C1
    LOOP
    FOR I2 IN C2(I1.JVH_LCM_LCTN_CODE)                    --Change the cursor parameter
    LOOP
    LINEBUF := I2.JVH_LCM_LCTN_CODE||','||I2.JVH_DSM_DCMNT_TYPE||','||I2.JVH_JV_TMPRY_NMBR||','||I2.JVH_JV_TMPRY_DATE||','||I2.JVH_SRCE_INDCTR||','||I2.JVH_CRTD_DATE||','||I2.JVH_CRTD_BY||','||I2.JVH_ATHRSTN_STS||','||I2.JVH_DSM_TRM_TR_CODE||','||I2.JVH_DSM_DCMNT_SRS||','||I2.JVH_LCM_LCTN_CODE_BOOK||','||I2.JVH_ATHRSTN_RQRD_INDCTR||','||I2.JVH_FNCL_CLSRE_INDCTR||','||I2.JVH_TRNSCTN_WITH_INDCTR||','||I2.JVH_TRNSCTNR_CODE||','||I2.JVH_JV_NMBR||','||I2.JVH_JV_DATE||','||I2.JVH_RMRKS||','||I2.JVH_JV_RVRSD_NMBR||','||I2.JVH_CHQE_DUE_DATE||','||I2.JVH_ATHRSD_DATE||','||I2.JVH_ATHRSD_BY||','||I2.JVH_TR_CODE_RVRSD||','||I2.JVH_DCMNT_TYPE_RVRSD||','||I2.JVH_JV_RVRSD_INDCTR||','||I2.JVH_NJV_TAG||','||I2.JVH_TYPE||','||I2.JVH_AUTO_RVSL_INDCTR||','||I2.JVH_AUTO_RVSL_DATE||','||I2.JVH_BUS_BKS_UPLOAD; --Change the cursor values
    utl_file.put_line(v_file,linebuf);
    END LOOP;
    END LOOP;
    UTL_FILE.FCLOSE(V_FILE);
    END;
    /

  • Can any one tell me How to load data in matrix from user table

    Hi,
    we need to load data to matrix when page loads. After loading data we should add row to that matrix and update the values in database without effecting previous data. It should have functionality like UDO Default Form. Can any help me out in this issue.
    Regards,

    Hi Souji,
    try this,
        SAPbouiCOM.Form oForm;
        SAPbouiCOM.DataTable DBTable;
        SAPbouiCOM.DBDataSource dbDatasource;
         string strqry;
         oForm = SBO_Application.Forms.Item("FormUID");
          int i;
          SAPbouiCOM.Item oitem;
           oitem = oForm.Items.Item("ItemUID");
           objMatrix = (SAPbouiCOM.Matrix)oitem.Specific;
           objMatrix.AddRow(1, objMatrix.RowCount + 1);
       dbDatasource = (SAPbouiCOM.DBDataSourceoForm.DataSources.DBDataSources.Item("TableName");
       DBTable= oForm.DataSources.DataTables.Add("UniqueName");
        strqry = "paste Query that you want to fetch";
        DBTableActivity.ExecuteQuery(strqry);
         for (i = 0; i <= DBTable.Rows.Count - 1; i++)
                objMatrix.FlushToDataSource();
                dbDatasource.SetValue("column1(name)", i, System.Convert.ToString(DBTable.GetValue(0, i)));
                dbDatasource.SetValue("column2(name)", i, System.Convert.ToString(DBTable.GetValue(1, i)));
                dbDatasource.SetValue("column3(name)", i, System.Convert.ToString(DBTable.GetValue(2, i)));
                dbDatasource.InsertRecord(i + 1);
                objMatrix.LoadFromDataSource();
    If it helps you, give me the reward points.
    Thanks
    Sravan Kumar Pothu

  • How to view data in Xcelsius from an external Excel file

    Hi Everyone,
    i wonder if you know How to view data in Xcelsius from external Excel file and not depend only on the emebded excel sheet.

    Hi,
    As per my understanding, excel has to be imported in Xcelsius to draw up the dashboard. Your aggregated data sits in the xlf file. Using an external excel file will not be possible (I guess).
    One of the ways to connect to an external excel, is the use XML Maps but then your data has to be in the form of XML which will be pulled into excel first and then needs to be brought in Xcelsius using Data Manager.
    You can explore XML Maps in xcelsius in SDN.
    Regards
    Nikhil

  • How can I get data in flat file from Pool table and cluster table ?

    Hi,
    I am working in one Achiving project. My requirement is to get data into flat file from Cluster table and pool table.
    Is there any tool avilable to download data into flat file from pool table and cluster table ?
    if table name given in the selection screen then data will be downloaded into flat file.
    waiting for quick response.
    Best Regards,
    Bansidhar

    Data cannot be retrived directly form the cluster table
    as the Cluster results are stored in Cluster Key say for example PCLkey
    and form that Key we need to fetch the data
    these clustes are not the part of PNP or PNPCE tables
    for ur info kindly check

  • Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the rows? Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the records?
    Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    The Oracle documentation has a good overview of the options available
    Generating XML Data from the Database
    Without knowing your version, I just picked 11.2, so you made need to look for that chapter in the documentation for your version to find applicable information.
    You can also find some information in XML DB FAQ

  • How to upload a text file from a shared folder and provide an o/p

    how to upload a text file from a shared folder and provide an o/p  containing the details in each order in the text file

    Hi,
    Use <b>GUI_UPLOAD</b> to upload a text file from a shared folder.
    Use <b>GUI_DOWNLOAD</b> to download data in a file on the presentation server or use <b>OPEN DATASET, TRANSFER</b> and <b>CLOSE DATASET</b> statements to download data to the application server.
    Now, I hope the code for data fetching, if required, is already present in the report.
    Reward points if the answer is helpful.
    Regards,
    Mukul

  • How can i print my files from mi iphone 5 throught the airport express?

    How can i print my files from mi iphone 5 throught the airport express?? i have the last iOS version installed and also the last firmware version of the printer. the printer is already connected to the USB airport express and when i look for printers in airprinter there is no printer found. i have an HP LASERJET P1606dn(i think that is supported by the airprinter).

    In order to function with AirPrint, a printer must connect to the network wirelessly.
    Even if you have an AirPrint compatible printer, iOS devices will not be able to print to the printer when it is connected via USB.
    So, you have two options:
    1) Reconfigure the printer to connect to the network using wireless only and the iOS devices should be able to print that way....assuming that you have up to date drivers for the printer installed.
    2) Leave the printer connected via USB and then use a third party App like Printopia installed on your Mac as a "workaround" to (hopefully) allow the iOS to device to be able to print.  If you want to give this a try, there is a free trial for Printopia, so you will know if it will work before you buy. You must have a Mac running on the network in order for Printopia to function correctly.
    Printopia - AirPrint to Any Printer - Print from iPad - Print from iPhone ...

  • How can I delete PDF files from my iMac desktop?

    How can I delete PDF files from my iMac desktop?

    Not on my system,When I try to dump if off in the trash it will not go. I get a message that says this file cannot be removed. I also tried going to File and clicking on Move to Trash. No dice.

  • How can i recover deleted files from my mac book

    how can i recover deleted files from my mac book

    Check out software like Data Rescue 3 (and you need an external drive to recover to)

  • I want a new Imac Core 2 Duo how do I move my files from my PowerPC G3?

    I want to get a new Imac Core 2 Duo but I can't figure out how to move my old files from my very old PowerPC G3 to a new Imac when I get it -- which I hope is very soon. The G3 has a CD drive but it is not a CD burner, has a Zip Drive, does not have firewire ports or USB ports -- how on earth can I move my stuff over to the new computer? It does have a 10baseT port [I think that's what it is] -- maybe that's the key? I hope someone can help.
    PowerPC G3 Mac OS 9.1.x

    2sockeye, yes, you can use the new mac's Migration Assistant Program to help you move files etc to your new mac via a firewire connection.
    Before you do that, search more on "migration" etc on this Discussion; Move only your data files (music, photos) as much as possible but do not move applications and especially system files, preferences that may or will override what's in your new Intel mac, it will cause corruption or an unstable system.
    Download and install all the applications from ground up, especially 3rd party utilities etc - look for the Universal versions (either stated, or with a blue "ying yang" logo)
    Cheers
    NEW
    No, when you go through the beginning of setting up your new Mac, a page with the Migration Program would appear, and ask you questions on how and what kind of migration you want to perform, it will also ask you (with given instructions) connect the 2 macs up with a firewire cable - this cable goes into your firewire ports
    If you don't have a firewire port on your old computer, then search again in this Discussion and under the Support tab, whether on how to transfer data on macs without FW ports

  • How do I move music files from the startup disc to iTunes in the other internal hard disk os 10.5.8?

    How do I move music files from the startup disc to iTunes in the other internal hard disk os 10.5.8?
    The music I want to move was in iTunes but is now just files. I had to reinstall a new iTunes and lost all my old music.
    Thank you!

    That article is about using your iPod as an external hard drive, to move files from one computer to another computer.  It is not related to your question.
    You can't use iTunes to move song files from iPod to computer, except for songs you purchased from the iTunes Store (and you can also re-download purchases).  However, there are third-party methods and utilities that can move song files from iPod to computer.  If you do a Google search on something like "ipod transfer," you should get some links.
    Once the song files are on your current computer, add them to that computer's iTunes library by dragging the files (or folder containing the files) to the iTunes window.  After confirming everything is there (and fixing the data issue you mentioned) you can sync the iPod.  You may want to do a Restore on the iPod, if it might have a data corruption issue, which will erase the iPod's hard drive, re-install the latest software, and set it to defautl settings.

Maybe you are looking for

  • SSO to web application

    Hello all, Okay, I'm trying to accomplish SSO between EP5.0 and an existing web application and am having little luck.  Basically, the web app will be called in the portal and I need to somehow pass the web app the userid/pswd that is stored in a use

  • Problem with p45d3 and sapphire hd4870 1gb

    Hi to all I have a big problem the mother card and video card. Do you know if there is some problem among the p45d3 platinum and the sapphire hd4870 1 gb ram? I have assembled a new pc: -MAIN BOARD: P45D3 platinum bios 1.6 - CPU: core 2 quads q9550 -

  • MacBook Pro to Sony Bravia ... Flickering blue screen

    Hello everyone, I've just bought a E-kom MiniDisplay to HDMI adapter as well as a full HD HDMI cable, to plug my MBP on my Sony Bravia TV, and I've got an image, but a blue screen keeps on coming and going every few seconds. Does anybody knows why an

  • IFrame in WDJ application to call another WDJ iview based on users country

    Hi All, I have a requirement wherein I have to display an iview based on the logged in user's country. This iview will be displayed within a WPC ivew. So the idea is to create just one WPC iview and put this WDJ iview in it, hence if a user from US l

  • Safari not loading some pages

    I'm having trouble loading some web pages, e.g. can't log into these discussions except via Windows XP in VMware Fusion, and its the same on different macs on the home network and when using Firefox and Camino browsers. The problem is causing me some