Extract statement and insert statement

can anyone explain me the use of this insert statement and extract statement.
INSERT lfa1-name1 INTO fg01
extract fg01.
thanks
phyrose

Hi,
       From f1 help....
EXTRACT
Basic form
EXTRACT fg.
Effect
Writes all fields of the field group fg (FIELD-GROUPS) as an entry in asequential dataset. If you have defined a field group HEADER,its fields precede each entry as a sort key. Afterwards, you canuse SORT and LOOP ... ENDLOOP to sort or process the datasetrespectively. No further EXTRACT statements are possible afterthis.
Notes
General:
As soon as you have extracted a dataset using EXTRACT, you canno longer extend the field group using INSERT. In particular, you cannot change the HEADERfield group at all after the first EXTRACT (regardless of thefield group to which it applied).
Large extract datasets are not stored in main memory. Instead, theyare kept in an external auxiliary file. You can set the directory inwhich this file is created using the SAP profile parameterDIR_EXTRACT. The default directory is the SAP data directory(SAP profile parameter DIR_DATA).
Notes
Runtime errors:
EXTRACT_AFTER_SORT/LOOP: EXTRACT after SORT, orLOOP. EXTRACT_BUFFER_NO_ROLL: Unable to create the required main
EXTRACT_FIELD_TOO_LARGE: Occupied length of a field is toolarge.
EXTRACT_HEADER_NOT_UNIQUE: Field group HEADER wasmodified after an EXTRACT statement.
EXTRACT_OPEN_EXTRACTFILE_OPEN:
Error opening the external extract dataset file.
EXTRACT_RESOURCEHANDLER_FAILED: Error deleting the externalextract dataset file.
EXTRACT_TOO_LARGE: Total length of the entry for extraction(including HEADER fields) is too large.
Additional help
Filling anExtract with Data
Extracts
Since internal tables have fixed line structures, they are not suited to handle data sets with varying structures. Instead, you can use extract datasets for this purpose.
An extract is a sequential dataset in the memory area of the program. You can only address the entries in the dataset within a special loop. The index or key access permitted with internal tables is not allowed. You may only create one extract in any ABAP program. The size of an extract dataset is, in principle, unlimited. Extracts larger than 500KB are stored in operating system files. The practical size of an extract is up to 2GB, as long as there is enough space in the filesystem.
An extract dataset consists of a sequence of records of a pre-defined structure. However, the structure need not be identical for all records. In one extract dataset, you can store records of different length and structure one after the other. You need not create an individual dataset for each different structure you want to store. This fact reduces the maintenance effort considerably.
In contrast to internal tables, the system partly compresses extract datasets when storing them. This reduces the storage space required. In addition, you need not specify the structure of an extract dataset at the beginning of the program, but you can determine it dynamically during the flow of the program.
You can use control level processing with extracts just as you can with internal tables. The internal administration for extract datasets is optimized so that it is quicker to use an extract for control level processing than an internal table.
Procedure for creating an extract:
Define the record types that you want to use in your extract by declaring them as field groups. The structure is defined by including fields in each field group.
Defining an Extract
Fill the extract line by line by extracting the required data.
Filling an Extract with Data
Once you have filled the extract, you can sort it and process it in a loop. At this stage, you can no longer change the contents of the extract.
Processing Extracts
INSERT Statement
The INSERT statement is used to insert values into a single database table.
<insert statement> ::= INSERT INTO <table name> <insert column list> <insert source>.
<insert source> ::= VALUES '(' <value> ( ',' <value> )* ')'
                            | <query specification>.
<value> ::= <value expression>
                | <dynamic parameter specification>
                | NULL.
<insert column list> ::= '(' <column name> ( ',' <column name> )* ')'.
In Open SQL the <insert column list> is not optional.
You cannot specify string literals as values for CLOB columns. Hex literals are not supported in Open SQL.
Examples
INSERT INTO employees (employee_id, employee_name)
              VALUES (4711, 'John Smith')
Inserting Values. A new row is inserted into the table employees with the values 4711 and 'John Smith' for the columns employee_id and employee_name respectively.
INSERT INTO well_paid_employees (employee_id, salary)
             SELECT employee_id, salary
                            FROM employees
                            WHERE salary > ?
Inserting the Result of a Query.  The employee_idand the salaryof all employees from table employeeswith a salary exceeding a certain value are inserted into the table well_paid_employees.
Regards

Similar Messages

  • Use of the "updlock" hint with update and insert statements

    I have inherited some stored procedures and am trying to figure out why the developers decided to use the "updlock" hint on many of the update and insert statements. I have looked around everywhere and have found only one explanation of why "update...with
    (updlock)" can be useful, namely when a table has no clustered index:
    http://www.sqlnotes.info/2012/10/10/update-with-updlock/ I have found nothing yet that mentions why "insert into...with (updlock)" might be used. I understand why the hint
    might be useful on select statements in some cases, but if all of the tables have clustered indexes, is there any good reason to use it on update and insert statements?
    Thanks,
    Ron
    Ron Rice

    This form of deadlock error can occur on a table which has a clustered index.
    If you are doing updates on a table which has a clustered index and that table also has a nonclustered index and the nonclustered index is used to find the row to update you can see this type of deadlock.  For example create a table with a clustered
    primary key index and a nonclustered index by running
    Create Table Foo(PK int primary key identity, OtherKey varchar(10), OtherData int);
    go
    Insert Foo Default Values;
    go 10000
    Update Foo Set OtherKey = 'C' + Cast(PK As varchar(10))
    Create Unique Index FooIdx On Foo(OtherKey);
    That creates a table with 10000 rows, a clustered index and a nonclustered index.  Then run
    Begin Transaction
    Update Foo Set OtherData = 1 Where OtherKey = 'C5'
    That will use the FooIdx index to find the row that needs to be updated.  It will get a U lock on the index row in the FooIdx index, then an X lock on the row in the clustered index, update that row, then free the U lock on FooIdx, but keep the X lock
    on the row in the clustered index.  (There is other locking going on, but to simplify things, I'm only showing the locks that lead to the deadlock).
    Then in another window, run
    Begin Transaction
    Update Foo Set OtherData = 2 Where OtherKey = 'C5'
    This will get a U lock on the index row in the FooIdx index, then try to get an X lock on the row in the clustered index.  But that row is already exclusively locked, so this second window will wait holding a U lock on FooIdx row and is waiting for
    an X lock on the clustered index row.
    Now go back to the first window and run
    Update Foo Set OtherData = 3 Where OtherKey = 'C5'
    This will once again try to get the U lock on the FooIdx row, but it is blocked by the U lock the second window holds.  Of course the second window is blocked by the X lock on the clustered index row and you have a deadlock.
    All that said, I certainly do not routinely code my updates with UPDLOCK.  I try to design databases and write code so that deadlocks will be rare without holding excessive locks.  The more locks you hold and the longer you hold them, the more
    blocking you will get and the slower your system will run.  So I write code that if a deadlock exception occurs, it is properly handled.  Then if too many deadlocks occur, that is the time to go back to the code to see what changes are needed to
    decrease the number of deadlocks (one way to do that may be to get locks earlier and/or hold them longer. 
    But I wouldn't worry much about this form of deadlock.  It is, in my experience, vary rare.  I don't recall ever seeing it in a production environment.
    Tom

  • Statement,Prepared Statement and callable statement

    Hi,
    Please let me know in which scenario we are using Statement,Prepared Statement and callable statement.
    and which is efficient one among the above.
    Thanks in advance

    Welcome to the forum!
    >
    Please let me know in which scenario we are using Statement,Prepared Statement and callable statement.
    >
    We don't know what scenario you are using those in or if you are using them at all. Are you asking what they are?
    For document related questions you should consult the documentation or use your favorite search engine to get information.
    See the Java Tutorial
    http://docs.oracle.com/javase/tutorial/jdbc/basics/prepared.html
    >
    The main feature of a PreparedStatement object is that, unlike a Statement object, it is given a SQL statement when it is created. The advantage to this is that in most cases, this SQL statement is sent to the DBMS right away, where it is compiled. As a result, the PreparedStatement object contains not just a SQL statement, but a SQL statement that has been precompiled. This means that when the PreparedStatement is executed, the DBMS can just run the PreparedStatement SQL statement without having to compile it first.
    >
    The Javadocs for your Java SDK have the API for each of those classes and a description of what they are. And the Oracle JDBC Developer Guide has extensive information on how to use them.
    http://docs.oracle.com/cd/B28359_01/java.111/b31224/toc.htm

  • Difference between "print" statements and "select" statements , TSQL

     What is the difference between "print" statements and "select" statements when it omces to debugging and watching varibles in the stored procs .....

    SELECT statement is part of the ANSI SQL language.
    PRINT command is not part of the SQL language, it is used for debugging in T-SQL.
    BOL:" Returns a user-defined message to the client.
    A message string can be up to 8,000 characters long if it is a non-Unicode string, and 4,000 characters long if it is a Unicode string. Longer strings are truncated. The
    varchar(max) and nvarchar(max) data types are truncated to data types that are no larger than
    varchar(8000) and nvarchar(4000).
    RAISERROR can also be used to return messages. RAISERROR has these advantages over PRINT:
    RAISERROR supports substituting arguments into an error message string using a mechanism modeled on the printf function of the C language standard library.
    RAISERROR can specify a unique error number, a severity, and a state code in addition to the text message.
    RAISERROR can be used to return user-defined messages created using the sp_addmessage system stored procedure."
    LINK: http://technet.microsoft.com/en-us/library/ms176047.aspx
    The SSMS (client software) returns SELECT output to Results and PRINT output to Messages.
    The SQLCMD -o (output file) option captures all outputs into one file mixed.
    Kalman Toth Database & OLAP Architect
    T-SQL Scripts at sqlusa.com
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Relation between record in a form and insert statement written in button

    hi all,
    i am using Forms [32 Bit] Version 6.0.8.24.1 (Production).
    i have a master detail form with relation
    A is master of B, B is master of C and a button which resides on control block(other than A,B,C).
    so i will insert a one record into the block 'A' and i will press button which will insert particular record into particular table.
    so when i try to move to next record('A' block) it is asking for database change. when i give 'yes' everything is ok. but when i give 'no'(w.r.t that record) and moves to next record and inserts the record and insert record throguh button also, at this time user press 'yes' then the first record is not saving but what ever i have inserted through the insert statement is not rolling back.
    How can i control insert statement with the respect to datablock change in the block.
    The block 'C' data is going to the other table through insert statement the block 'C' i am posting. So due to 'post' the block is not getting cleared so insert statement is also firing.
    In other words i want to unpost the posted data when user press 'no' in the database message.
    I know there is nothing to do with the forms message. But is its possible to control when user press 'no' then the insert statement should not gets saved into the table.
    Please help.
    Thanks..
    Edited by: GD on Jun 27, 2011 5:38 AM

    First off, you need to understand how Oracle Forms interacts with an Oracle database. Forms natively handles all DML transactions for you. Meaning, if you have a Forms data block based on a database table, Forms will generate all the necessary DML to handle any changes that occur in that block. You do not need to write your own DML statements in code.
    so i will insert a one record into the block 'A' and i will press button which will insert particular record into particular table.Is Block "A" based on a table? How are you inserting the record into the table? If you are writting your own DML to insert the record this would explain why you are being prompted to save when you change records. As I mentioned, if your block is based on a table, Forms will know if you change a value within the block.
    How can i control insert statement with the respect to datablock change in the block.If your blocks are based on tables, let Forms handle the DML! don't do it yourself.
    In other words i want to unpost the posted data when user press 'no' in the database messageIf your block is based on a table, when you are prompted to save changes - answering 'NO' will automatically clear the current record of the data block (in essence - rollback the change).
    Craig...

  • Merge statement and insert into a third table

    I'm wondering if the merge statement will work in my case. I'm loading a file into a temporary table. I want to compare this temporary table with an existing source table (there are multiple source tables, I've thought of breaking them up into separate statements) and write out any differences to a third table. The third table would be used for future processing on the rows that are found to be different. Do you think this is possible using the merge command?

    Why use the merge command for that purpose?
    If you want to find out the differences of two tables and put the result into a third one then you should do
    insert into table_c
    query_a
    minus
    query_b
    or
    insert into table_c
    (query_a
    minus
    query_b)
    union all
    (query_b
    minus
    query_a)
    hth

  • Select query and Insert statement performance

    Hi all,
    Can anyone plz guide us on below problem I am facing ?
    1) One of the simple Insert statement runs very slow..What might be the reason? Its simple table without any LOBs ,LONG or so. Everything else in the DB works fine.
    2) one of the SELECT statement runs very slow. It selects all records (around 1000) from a table..How can i improve its performance?
    3)Which columns in the Master and its detail tables should be indexed to improve Query performance on them.
    Many Thanks
    Regards
    sandeep

    To get an answer to your questions you have to post some informations about your system:
    1. operating system
    2. RAM
    3. oracle version
    4. init.ora
    Thomas

  • Cfloop and insert statement

    I have a form that lists property addresses. For each address
    you want to post a payment for, you select the checkbox next to the
    address (value=property_id), you fill out the form filed for Amount
    Paid (value=paid_num) and you can put something in the notes form
    field as well(value=notes_txt)
    I also have single form fields that relate to all properties:
    month (month_id), year (year_id), pay date (paid_dt).
    My action page uses a cfloop using property_id. I need to
    insert a payment record for each property address that was selected
    using the data in the formfields. After the payment record is
    inserted, then I need to update the property's balance to reflect
    the new payment. ex: a property's new balance would be current
    balance - payment amount
    The loop seems to be working properly, but... if I have more
    than one property selected, it's trying to insert all the payment
    amounts (paid_num) for a single address (so i get error saying the
    number of values in the form don't match up agains the insert
    statement.). I hope this is clear - see my attached code.
    If anyone can figure out what I'm doing wrong I would really
    appreciate it.

    Thanks web-spinner. I tried your first bit since i don't want
    to insert a payment record if no payment is made... but I got this
    error. I believe it's having a problem with this bit of code in the
    INSERT statement
    #evaluate(form.paid_num#ListElement#)#
    see error message below...

  • Difference Betwen #include statement and Import statement

    What is the Difference between #include and Import statements!

    Why do you need to shout! Are you unware that English has a question mark that is used at the end of a question sentence! Java doesn't have #include! It only has import!
    Import in Java simply tells the compiler that when you say, for example, List, you mean, for example, java.util.List! It does not affect the generated class file in anyway!
    #include in C/C++ causes the body of the reference file to be inserted into the compilation stream! So, unlike Java's import, that file actually gets compiled into the final output!

  • Statement and Prepared Statement

    if i write a same query with statement and preparedStatement
    like
    Select * from emp_detail where emp_id =20;
    stmt= con.createStatment();
    rs = stmt.executeQuery(query);
    and using preparedStatement
    Select * from emp_detail where emp_id =?;
    pstmt= con.prepareStatement();
    pstmt.setInt(1,20);
    rs = stmt.executeQuery(query);
    Using which statment(Statement or Prepared Statement) the data will retrive fast and why.... in these case ????

    Statement should be quicker than Prepared Statement, because
    Statment do only one thing: send that sql to server or run that sql directly.
    Prepared Statement should do two (or more than two)things:
    1. parse your sql first, prepare a store procedure, then call that store procedure.
    Or
    2. prase your sql first, then use your value to replace "?" for getting a new sql, then work like Statement.
    Prepared Statement is quiker when you use it repeatedly.

  • ESS ERP2005: total compensation statement and salary statement errors

    Hello everyone,
    I am facing two problems with ESS on NW04s J2EE SP10 w. Portal and ERP2005 Backend. Both have been discussed here but some time ago and no sufficient answer has been found so I'd like to do a recap:
    1) Salary Statement (and Time Slip also).
    Even if the PAY_SLIP_XY form in hrforms is correct, working within ERP transaction (PY-HF) and customized in IMG HRFOR, the iview producdes the error "<myForm>" not found. When I change <myForm> the change is recognized so obviously the customizing is correct. The same is about Time_Slip forms.
    Anyway, can anyone point me to a link to integrate Adobe DS at this point, should I, or isn't this possible yet?
    2) Total Compensation Satement ivew throws an ArrayIndexOutOfBoundsException -1. The first few stack trace lines are:
    at com.sap.mw.jco.JCO$Record.getString(JCO.java:12778)
        at com.sap.aii.proxy.framework.core.JcoBaseTypeData.getElementValueAsString(JcoBaseTypeData.java:669)
        at com.sap.tc.webdynpro.modelimpl.dynamicrfc.DynamicRFCModelClass.getAttributeValueAsString(DynamicRFCModelClass.java:427)
        at com.sap.xss.hr.rep.model.rfwmodel.Hrxss_Ser_Rfw_Rfc_Get_Form_Output.getHeight(Hrxss_Ser_Rfw_Rfc_Get_Form_Output.java:179)
        at com.sap.xss.hr.rep.fcrfw.FcRepFramework.callRfcGetForm(FcRepFramework.java:395)
    Restarting the server doesn't help, the server was newly started as the error occured.
    Maybe I missed some IMG activity? I went through the Company Compensation Management and added some values to compensation type, the structure is definied, but not sure if this is all.
    Pls can anyone help. I'm just implementing the standard BP for the moment, no individual app.
    Regards
    Carsten

    Hi Patrick,
    no unfortunately not and as you can see we've got no answers.
    But I'm still in the need to fix it. It's not very urgent, but to know the solution would be great.
    In general we still have problems with print forms in ESS/MSS webdynpro implementation. The HRFORM is defined and well customized in IMG, so I think this is not the point.
    As I pointed out in another post I am confused if Adobe Document Services is needed to render (PDF) print forms since ESS/MSS 600 (for ERP 2005) or what else.
    Do you know?
    Did you get other print forms like salary statement working?
    I went through the entire post installation procedure regarding Adobe DS but it did  not help.
    I always get ther failure "The form  is the form customized for ESS in IMG and the form does exist and is tested within HRFORM transaction.
    Except the time slip (and as well total compensation), where we get this "ArrayIndexOutOfBounds" exception.
    Regards
    Carsten
    Message was edited by:
            Carsten Schön
    Message was edited by:
            Carsten Schön
    correction: error also in total conpensation statement

  • View State question - changing states and custom states

    Hi all,
    I'm working on an application that lets a user register for an event. Each event has associated child information: conferences, tickets, etc. associated with it. What I'm trying to do is create some sort of checkbox list so that, when a user clicks on an event to add it to his registration, the associated child information appears in the display so he can choose all this information at once. I have the list working and I've been trying to use a custom ItemRenderer to pop in the extra info for the user to select when he clicks on an event. The problem I'm having is that, when the user goes to click on a child to add it to his registration, my state is changing back from "selected" to "normal" and the child information disappears. So I guess I have two questions. One, am I even remotely on the right track here? If not, can someone suggest a better approach? Two, if this is the right approach, how do I solve the "disappearing child" problem? I tried creating a custom state that would set everything to visible, but I can't seem to figure out how to get into it...I tried just putting a click event on it and just doing an Alert.show(currentState) to see if I was even getting into my custom state, but I just kept switching between "normal" and "selected."
    Code:
    ItemRenderer:
    <s:ItemRenderer name="eventItemRenderer"
    xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    focusEnabled="false" xmlns:mx="library://ns.adobe.com/flex/halo" xmlns:registrationapi="services.registrationapi.*">
    <fx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.events.FlexEvent;
    //this gets my data to populate the dropDown list when the parent event is selected
    protected function checkbox1_clickHandler(event:MouseEvent, selectedEventCode:String):void
    showPrimaryConferences = true;
    getEventConferencesResult.token = registrationAPI.getEventConferences(selectedEventCode.name);
    protected function comboBox_creationCompleteHandler(event:FlexEvent):void
    getEventConferencesResult.token = registrationAPI.getEventConferences(data.EventCode);
    ]]>
    </fx:Script>
    <s:states>
    <s:State name="normal"/>
    <s:State name="hovered"/>
    <s:State name="selected"/>
    </s:states>
    <s:Rect top="0" left="0" right="0" bottom="0">
    <s:fill>
    <s:SolidColor id="backgroundColor" color="0xFFFFFF" />
    </s:fill>
    </s:Rect>
    <!-- checkmark -->
    <s:Path data="M 3.5 6.5 l 2 2 l 6 -7" includeIn="selected" right="2" verticalCenter="1">
    <s:stroke>
    <s:SolidColorStroke weight="2" caps="square" color="0x000000" />
    </s:stroke>
    </s:Path>
    <fx:Declarations>
    <s:CallResponder id="getEventConferencesResult"/>
    <registrationapi:RegistrationAPI id="registrationAPI" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>
    </fx:Declarations>
    <s:VGroup left="3" right="10" top="3" bottom="3">
    <s:CheckBox name="{data.EventCode}" label="{data.EventTitle}" id="selectedEventCode" fontWeight="bold" click="checkbox1_clickHandler(event, selectedEventCode.name)" />
    <s:Label text="{data.EventTitle}" id="selectedEventCodeLabel" fontWeight.selected="bold"  />
    </s:VGroup>
    </s:ItemRenderer>
    Thanks in advance for any suggestions!
    ~ amanda

    I simplified the problem to it's essence and came up with this:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal"
        creationComplete="init()">
        <mx:Script>
            <![CDATA[
                import mx.collections.ArrayCollection;
                [Bindable]
                public var lProvider:ArrayCollection;
                private function init():void
                    var la:Array = [{label: "Conference", checked: true},
                                    {label: "Tickets", checked: false}];
                    lProvider = new ArrayCollection(la);
            ]]>
        </mx:Script>
        <mx:List id="cList" width="200" dataProvider="{lProvider}" itemClick="lProvider.refresh()">
            <mx:itemRenderer>
                <mx:Component>
                    <mx:HBox width="100%">
                        <mx:CheckBox selected="{data.checked}" click="data.checked = event.target.selected"/>
                        <mx:Label text="{data.label}"/>
                    </mx:HBox>
                </mx:Component>
            </mx:itemRenderer>
        </mx:List>
        <mx:VBox width="600">
            <mx:Panel title="Conference component" width="100%" height="200"
                    visible="{lProvider.getItemAt(0).checked}"
                    includeInLayout="{lProvider.getItemAt(0).checked}"/>
            <mx:Panel title="Ticket component" width="100%" height="200"
                    visible="{lProvider.getItemAt(1).checked}"
                    includeInLayout="{lProvider.getItemAt(1).checked}"/>
        </mx:VBox>
    </mx:Application>
    Does this help?
    Dany

  • Issues with interactivity between component states and page states

    Hi there, I recently downloaded the trial of Catalyst 5.5 and am encountering the following problem:-
    I have many screens in my application and am attempting to get around the 20 state limit by creating custom components that contain multiple states that can be used as screens. So, I have created button links between the component states which work fine but have also created button links to and from the standard states of the application, which dont work upon running/publishing. I'm not quite sure whats wrong here as the button commands are pointing to the right place, i.e. they are pointing firstly to the specific custom component and then the state within the component, but its just not working.
    Is this a trial issue or something deeper?
    I really hope someone can help as apart from this issue I have been very happy with the application but if I can not find a solution theres no point in purchasing it.
    Cheers.

    Ive had the same problem. Im trying to create an interactive e-book but im having problmes with the limit of states. I have now worked out that i have to create custom components to create a sub-state but im finding it difficult to go between sub states. Help anyone?

  • Dynamic insert statement

    Hi all
    I had problem in insert statement.
    I know the column of the table, tablename and the value to be insert.
    My code:
    Data: column(20) type c.   -
    >refer to the tablecolumn
    Data: tablename(20) type c.  -
    >refer to table name
    Data: value(20) type c.          -
    >value to be insert to the column in the table
    column = 'Admino'.
    tablename = 'Student'.
    value = '123456'.
    <b>insert <column> into <tablename> values <value>.</b>
    i know there something wrong with my insert statement. How to do it in abap insert code where i can put in all the parameter in the insert statement.
    Anycode or sample to show. Many thank.

    From f1 help....
    EXTRACT
    Basic form
    EXTRACT fg.
    Effect
    Writes all fields of the field group fg (FIELD-GROUPS) as an entry in asequential dataset. If you have defined a field group HEADER,its fields precede each entry as a sort key. Afterwards, you canuse SORT and LOOP ... ENDLOOP to sort or process the datasetrespectively. No further EXTRACT statements are possible afterthis.
    Notes
    General:
    As soon as you have extracted a dataset using EXTRACT, you canno longer extend the field group using INSERT. In particular, you cannot change the HEADERfield group at all after the first EXTRACT (regardless of thefield group to which it applied).
    Large extract datasets are not stored in main memory. Instead, theyare kept in an external auxiliary file. You can set the directory inwhich this file is created using the SAP profile parameterDIR_EXTRACT. The default directory is the SAP data directory(SAP profile parameter DIR_DATA).
    Notes
    Runtime errors:
    EXTRACT_AFTER_SORT/LOOP: EXTRACT after SORT, orLOOP. EXTRACT_BUFFER_NO_ROLL: Unable to create the required main
    EXTRACT_FIELD_TOO_LARGE: Occupied length of a field is toolarge.
    EXTRACT_HEADER_NOT_UNIQUE: Field group HEADER wasmodified after an EXTRACT statement.
    EXTRACT_OPEN_EXTRACTFILE_OPEN:
    Error opening the external extract dataset file.
    EXTRACT_RESOURCEHANDLER_FAILED: Error deleting the externalextract dataset file.
    EXTRACT_TOO_LARGE: Total length of the entry for extraction(including HEADER fields) is too large.
    Additional help
    Filling anExtract with Data
    Extracts
    Since internal tables have fixed line structures, they are not suited to handle data sets with varying structures. Instead, you can use extract datasets for this purpose.
    An extract is a sequential dataset in the memory area of the program. You can only address the entries in the dataset within a special loop. The index or key access permitted with internal tables is not allowed. You may only create one extract in any ABAP program. The size of an extract dataset is, in principle, unlimited. Extracts larger than 500KB are stored in operating system files. The practical size of an extract is up to 2GB, as long as there is enough space in the filesystem.
    An extract dataset consists of a sequence of records of a pre-defined structure. However, the structure need not be identical for all records. In one extract dataset, you can store records of different length and structure one after the other. You need not create an individual dataset for each different structure you want to store. This fact reduces the maintenance effort considerably.
    In contrast to internal tables, the system partly compresses extract datasets when storing them. This reduces the storage space required. In addition, you need not specify the structure of an extract dataset at the beginning of the program, but you can determine it dynamically during the flow of the program.
    You can use control level processing with extracts just as you can with internal tables. The internal administration for extract datasets is optimized so that it is quicker to use an extract for control level processing than an internal table.
    Procedure for creating an extract:
    Define the record types that you want to use in your extract by declaring them as field groups. The structure is defined by including fields in each field group.
    Defining an Extract
    Fill the extract line by line by extracting the required data.
    Filling an Extract with Data
    Once you have filled the extract, you can sort it and process it in a loop. At this stage, you can no longer change the contents of the extract.
    Processing Extracts
    INSERT Statement
    The INSERT statement is used to insert values into a single database table.
    <insert statement> ::= INSERT INTO <table name> <insert column list> <insert source>.
    <insert source> ::= VALUES '(' <value> ( ',' <value> )* ')'
    | <query specification>.
    <value> ::= <value expression>
    | <dynamic parameter specification>
    | NULL.
    <insert column list> ::= '(' <column name> ( ',' <column name> )* ')'.
    In Open SQL the <insert column list> is not optional.
    You cannot specify string literals as values for CLOB columns. Hex literals are not supported in Open SQL.
    Examples
    INSERT INTO employees (employee_id, employee_name)
    VALUES (4711, 'John Smith')
    Inserting Values. A new row is inserted into the table employees with the values 4711 and 'John Smith' for the columns employee_id and employee_name respectively.
    INSERT INTO well_paid_employees (employee_id, salary)
    SELECT employee_id, salary
    FROM employees
    WHERE salary > ?
    Inserting the Result of a Query. The employee_idand the salaryof all employees from table employeeswith a salary exceeding a certain value are inserted into the table well_paid_employees.
    Please reward points if helpful.

  • In Oracle SQL, cannot use column in select statement and order by

    Hi,
    Is there a work around for this.
    Thanks in advance
    Pablo.

    Hi,
    943981 wrote:
    Hi All,
    This is the error I get:
    ORA-00960: ambiguous column naming in select list
    00960. 00000 - "ambiguous column naming in select list"
    *Cause:    A column name in the order-by list matches more than one select
    list columns.
    *Action:   Remove duplicate column naming in select list.
    Error at Line: 6 Column: 17That error message looks pretty clear to me. What don't you understand?
    Either
    (a) use aliases, so each column has a unique name, or
    (b) remove duplicate columns from the SELECT clause.
    Post your query. It's hard to say exactly what you're doing wrong when we don't know exactly what you're doing.
    For best results, post a complete test script (including CREATE TABLE and INSERT statements, if necessary) that people can to re-create the problem and test their ideas.
    See the forum FAQ {message:id=9360002}

Maybe you are looking for

  • Can I preload US apps for students overseas?

    What is the best way to pre-purchase apps for iPads overseas? I am gifting two iPads for Christmas to my wife's niece and newphew overseas. They are young college students and have no money or credit cards, nor does the family. One of them is a gifte

  • Configure UME

    Hi All, I have done implementation ESS+MSS using UME configured  ABAP system, it is working fine. Now I have to change UME configuration  LDAP or JAVA stack database. Case 1: IF I am going to use LDAP I have to map employee personal number to the use

  • Sales order(so)  order release

    Hi all., I created one workflow for so release process with custom object with copying bus2032. in workflow definition i created start events with create and change and binding is done properly. if user creates the sales order its triggering perfectl

  • Free Keynote templates

    Free Keynote templates can be found at the following url: http://etc.usf.edu/presentations/ David Moore eMac/MacBook Pro/   Mac OS X (10.4.9)  

  • Shipment cost changes

    Dear All, I would like to see the changes in the shipment cost document (VI02--Changes),There is no option in environment,Please tell me how to see the complete changes from shipment cost creation.