How to select records in batch?

Hi Friends.
I want to select 10 lacs records. But if i used for all entries also it is giving error of time out. now i want to select records ina batch og 100000. Means forst it will select 100000 records and move in a internal table ..after that it will again fetch next 100000 records and append in that internal table like that..Is it possible..how to do this? i am selecting BELNR from BKPF and using FOR ALL ENTRIES fetching records from BSEG. requirement is such as i have to fetch records from BSEG only and not from BSID,BSIK... like tables..
Please help me...its urgent friends....

Hi ..
My program is not a normal abap program..it is a RFC. actually requirement is to fetch data from sap and send it to squ server database. So non sap application execute the RFC. so i cant run this it in background...is it possible to run RFC in background..

Similar Messages

  • How to select records in ALV using FM

    Hi guys,
    How to select records in ALV using FM. Not the OO method. Thx in advance!
    Kun

    hI
    by using REUSE_ALV_FIELDCATALOUG_MERGE. Iys fill field catalouge table as per internal table description. Then use REUSE_ALV_GRID_DISPLAY for display ALV REPORT.
    **Please reward suitable points***
    With Regards
    Navin Khedikar

  • How to select records based on Max/Min on different columns and group by

    I have a table with 5 columns(a,b,c,d,e), i need to select records based on MAX(c),Max(D) and Min(e) group by a,b. i am trying using : select max(c),max(d),min(e) from table group by a,b. this is not working. its giving me 1 6 1
    a b c d e
    1 1 1 2 1
    1 1 1 6 4
    1 1 1 6 3
    when i group by a,b i am expecting the record 1 6 3
    Please help me with this.. Thanks in advance....

    Hi,
    Welcome to the forum!
    962163 wrote:
    I have a table with 5 columns(a,b,c,d,e), i need to select records based on MAX(c),Max(D) and Min(e) group by a,b. i am trying using : select max(c),max(d),min(e) from table group by a,b. this is not working. its giving me 1 6 1
    a b c d e
    1 1 1 2 1
    1 1 1 6 4
    1 1 1 6 3
    when i group by a,b i am expecting the record 1 6 3It looks to me like "1 6 1" is the correct answer. You're asking for the lowest value of e, and 1 is lower than 3.
    Maybe you don't want MIN (e). Explain why you want 3 (that is, how you decided that 3 is the correct value for the last column) and someone will help you code it.
    Edited by: Frank Kulash on Sep 28, 2012 6:17 PM
    Whenever you have a problem, you should psot CREATE TABLE and INSERT statements for your sample data. That way, the people who want to help you can re-create the problem and test their ideas. It often helps to clarify the problem, too. since this is your first message, I'll do it for you:
    CREATE TABLE     table_x
    (       a     NUMBER
    ,     b     NUMBER
    ,     c     NUMBER
    ,     d     NUMBER
    ,     e     NUMBER
    INSERT INTO table_x (a, b, c, d, e) VALUES (1, 1, 1, 2, 1);
    INSERT INTO table_x (a, b, c, d, e) VALUES (1, 1, 1, 6, 4);
    INSERT INTO table_x (a, b, c, d, e) VALUES (1, 1, 1, 6, 3);
    COMMIT;

  • How to select records with certain fields unique while others not

    Hi,
    For example, I have table with 6 columns, called 'A', 'B', 'C', 'D', 'E', 'F'. There's no unique constraint built-in, and I would like to select records that have both column 'A' and 'B' unique. What should the sql statement look like?
    Columns 'C', 'D', 'E', 'F' can have same data in different records or null, not a concern.
    Thanks.

    select A, B, max(C), max(D), max(E), max(F) from <your_tab>
    group by A, B
    select * from (select t.*, row_number() over (partition by A,B order by null) rn from <your_tab> t)
    where rn=1they are not the same, but seem to meet your needs both.

  • How to select records considering 200 entries at a time

    Dear All,
    Need some help.
    Scenario :-
    I have an idoc number range in select options.Instead of selecting all the
    records falling in this range and populating the final internal table i want
    that every 200 idoc no.s (from select-options)be copied into a range field and then this field be used
    repetitively (until idoc nos are finished)for populating final data.
    The reason for doing this way is performance factor.
    Please suggest how to do this.

    Hi Deepali,
    check the package size addition of select statement.
    ... INTO|APPENDING [CORRESPONDING FIELDS OF] TABLE itab [PACKAGE SIZE n]
    Effect
    If the result set consists of multiple lines, an internal table itab of any table type can be specified after INTO or APPENDING. The row type of the internal table must meet the prerequisites.
    The result set is inserted into the internal table itab line-by-line; a sorting process is executed in the case of a sorted table. If INTO is used, the internal table is initialized before the first line is inserted. Previous lines remain intact if APPENDING is used.
    Before any assignment of a line of the result set, an initial row of the internal table itab is created and the line of the result set is assigned to this row. When assigning a line of the result set to a row of the internal table with or without CORRESPONDING FIELDS, the same rules apply as when assigning to an individual work area wa (see above).
    If the PACKAGE SIZE addition is not used, all lines of the result set are inserted in the internal table itab and the ENDSELECT statement must not be specified after SELECT.
    If you specify the PACKAGE SIZE addition, all lines of the result set for SELECT are processed in a loop, which must be closed with ENDSELECT. The lines are inserted in the internal table itab in packages of n lines. n must be a type i data object that contains the number of lines. If the value of n is smaller than 0, an exception that cannot be handled occurs. If n is equal to 0, all lines of the result set are inserted in the internal table itab. If used in the FETCH statement, n lines are extracted from the current cursor position.
    If INTO is used, the internal table is initialized before each insertion and, in the SELECT loop, it only contains the lines of the current package. If APPENDING is used, a further package is added to the existing rows of the internal table for each SELECT loop or for each extraction using FETCH.
    After ENDSELECT, the content of itab is not defined if INTO is used - that is, the table can either contain the lines of the last package or it can be initial. If APPENDING is used, the content of itab retains the state of the last loop pass.
    Notes
    In the case of an internal table with a unique key, an exception that cannot be handled occurs if an attempt is made to create a duplicate entry.
    If the addition PACKAGE SIZE is specified together with FOR ALL ENTRIES, it is not passed to the database system, but is applied to the result set on the application server, after all selected rows have been read.
    Thanks,
    Vinod.

  • How to select record in mulitple rows based on another field's values?

    Hi,
    sorry about the bad title, really not sure how to explain this
    Have the following data:
    Cost_center       Activity_type
    1005009401     CLBR0
    1005009401     CLBR1
    1005009401     TLBR0
    1005009401     TLBR1
    1005009401     VEH00
    1005009402     CLBR3
    1005009402     CLBR4
    1005009402     TLBR5
    1005009402     TLBR6
    1005009402     VEH07
    1005009901     CE000
    1005009901     CLBR0
    1005009901     CLBR1
    1005009901     TLBR0
    1005009901     TLBR1
    1005009901     VEH01 I need to return a list of cost centers (with its associated activity types) that do not have activity types of CLBR0 and CLBR1 and TLBR0 and TLBR1 and VEH01. So in the above data, cost center 1005009401 and 1005009402 would be returned.
    Any thoughts?
    Thanks.
    Edited by: dgouin on Aug 29, 2012 11:42 AM - added more sample data.
    Edited by: dgouin on Aug 29, 2012 11:45 AM
    Edited by: dgouin on Aug 29, 2012 11:49 AM

    Sorta kludgey, but functional:
    WITH ccs AS
      SELECT '1005009401' AS CC, 'CLBR0' AS activity_type FROM dual
      UNION ALL
      SELECT '1005009401' AS CC, 'CLBR1' AS activity_type FROM dual
      UNION ALL
      SELECT '1005009401' AS CC, 'TLBR0' AS activity_type FROM dual
      UNION ALL
      SELECT '1005009401' AS CC, 'TLBR1' AS activity_type FROM dual
      UNION ALL
      SELECT '1005009401' AS CC, 'VEH00' AS activity_type FROM dual
      UNION ALL
      SELECT '1005009901' AS CC, 'CE000' AS activity_type FROM dual
      UNION ALL
      SELECT '1005009901' AS CC, 'CLBR0' AS activity_type FROM dual
      UNION ALL
      SELECT '1005009901' AS CC, 'CLBR1' AS activity_type FROM dual
      UNION ALL
      SELECT '1005009901' AS CC, 'TLBR0' AS activity_type FROM dual
      UNION ALL
      SELECT '1005009901' AS CC, 'TLBR1' AS activity_type FROM dual
      UNION ALL
      SELECT '1005009901' AS CC, 'VEH01' AS activity_type FROM dual
    SELECT cc, activity_type
    FROM   ccs c1
    WHERE  5 != (SELECT COUNT(DISTINCT activity_type)
                 FROM   ccs c2
                 WHERE  activity_type IN ('CLBR0','CLBR1','TLBR0','TLBR1','VEH01')
                 AND    c1.cc = c2.cc
    CC         ACTIVITY_TYPE
    1005009401 CLBR0        
    1005009401 CLBR1        
    1005009401 TLBR0        
    1005009401 TLBR1        
    1005009401 VEH00 

  • How to select records which are added during last week

    I have a scenerio in which I have a person dimension, which includes all the information about the person. I want to take two extracts out of it. One is monthly and one is on weekly basis. In the monthly I am just taking data for that particular month and then joining it with the Fact table. It is simple and I have already done it. I am having trouble for doing it on weekly basis of the current month, what I want to do is after the 1st week I want to select the new persons which were added (delta) during the 1st week. In the end of 2nd week I want to select those records which were added during 2nd week and so on for all the 4 weeks. e.g.
    Day
    8     The person’s which were added during 1st – 7th
    15     The person’s which were added during 8th – 14th
    23     The person’s which were added during 15th – 22nd
    31     The person’s which were added during 23rd – 31st
    Any suggestions will be appriciated please. Thanks

    A few steps arem required
    1) when inserting or updating a record in the target table set wk and mth IND to 'N'
    2) when running the week load after loading the data in the proper target end table
    set the wk ind to 'N' where wk_ind = 'Y'
    3) when running the month load after loading the data in the proper target end table
    set the wk ind to 'N' where mth ind = 'Y'
    did this help ?
    DJ

  • How to select records filter by the value which stored in xml field

    I read many datas to solve my problem,but those doesn't work...
    At first, I create a table in sqlserver
    CREATE TABLE [dbo].[Demo](
    [ID] [int] IDENTITY(1,1) NOT NULL,
    [Content] [xml] NOT NULL
    Then I insert two records:
    INSERT INTO Demo(Content) VALUES(
    '<plan>
    <teachers>
    <teacher>1</teacher>
    <teacher>2</teacher>
    </teachers>
    </plan>')
    INSERT INTO Demo(Content) VALUES(
    '<plan>
    <teachers>
    <teacher>3</teacher>
    <teacher>4</teacher>
    </teachers>
    </plan>')
    Now ,I want to get the records which the Content field's teacher=3. I try my best to sovle it ,but I can't.
    Are there somebody can help me? Thanks !

    You can use the .exist method to do that.  Try these:
    SELECT *
    FROM Demo
    WHERE Content.exist('plan/teachers/teacher[. = 3]') = 1
    DECLARE @teacherId INT = 3
    SELECT *
    FROM Demo
    WHERE Content.exist('plan/teachers/teacher[. = sql:variable("@teacherId")]') = 1

  • How to select records inserted in a table in last 30 mins

    I need to select the records inserted or generated in the basic scott.emp table assuming date created is a new column which inserts the time at the time of creation
    select * from emp where  (date_Created) between  (sysdate -30/1440) and sysdate;Does the above code works or should i need to look something new
    Please advise
    Regards,

    sri wrote:
    I need to select the records inserted or generated in the basic scott.emp table assuming date created is a new column which inserts the time at the time of creation
    select * from emp where  (date_Created) between  (sysdate -30/1440) and sysdate;Does the above code works or should i need to look something new
    Please advise
    Regards,It would be better to say:
    select * from emp where  date_created >= sysdate-30/(24*60);

  • How to select records from Interactive Reports based on checkboxes

    Referring to the link below
    http://apex.oracle.com/pls/otn/f?p=31517:95
    I want to select rows from the Interactve Report based on a checkbox. This demo page has 2 sections, one for classic report and other for interactive one. The classic report is able to select the whole records but the interactive report selects only the emp nos. I am looking for a functionality where I can select the whole record from the interactive report.
    Any pointers will be helpful.
    Thanks

    That is easy. You should just modify the query:
    DECLARE
       v_count   INTEGER := 0;
    BEGIN
       :p95_text_ir := NULL;
       FOR i IN 1 .. apex_application.g_f20.COUNT
       LOOP
          v_count := v_count + 1;
          FOR c IN (SELECT ename, job, mgr, sal, deptno
                      FROM emp
                     WHERE empno = apex_application.g_f20 (i))
          LOOP
             :p95_text_ir :=
                   :p95_text_ir
                || 'ID: '
                || c.empno
                || ' / '
                || 'Name: '
                || c.ename
                || ' / '
                || 'Job: '
                || c.job
                || ' / '
                || 'Manager: '
                || c.mgr
                || ' / '
                || 'Salary: '
                || c.sal
                || ' / '
                || 'Department: '
                || c.deptno
                || CHR (10);
          END LOOP;
       END LOOP;
       :p95_text_ir := :p95_text_ir || ' / Records selected: ' || v_count;
    END;Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • How to select record like A?

    Hi,
    I want to select the records like "one letter + non alphabetic characters" from a table. For example: A!, B??, D2, F%5 etc.
    What is the right SQL for those kind of records. I think, I should use regular expression but i couldn't find the right one. I'll be appreciated if you can send the sql statement.
    Thanks
    Seher

    I want to select the records like "one letter + non alphabetic characters" from a table. Maybe something like:
    SQL> WITH test_tab AS
      2       (SELECT 'A!' col_1 FROM DUAL
      3        UNION ALL
      4        SELECT 'A?$#' FROM DUAL
      5        UNION ALL
      6        SELECT 'AB&' FROM DUAL
      7        UNION ALL
      8        SELECT 'A123' FROM DUAL
      9        UNION ALL
    10        SELECT '123' FROM DUAL)
    11        -- end test_data
    12  SELECT col_1
    13    FROM test_tab
    14  /
    COL_
    A!
    A?$#
    AB&  -- Discard because second letter is an alphabet
    A123
    123  -- Discard because first letter is a digit
    5 rows selected.
    SQL> WITH test_tab AS
      2       (SELECT 'A!' col_1 FROM DUAL
      3        UNION ALL
      4        SELECT 'A?$#' FROM DUAL
      5        UNION ALL
      6        SELECT 'AB&' FROM DUAL
      7        UNION ALL
      8        SELECT 'A123' FROM DUAL
      9        UNION ALL
    10        SELECT '123' FROM DUAL)
    11        -- end test_data
    12  SELECT col_1
    13    FROM test_tab
    14   WHERE REGEXP_LIKE (col_1, '^[[:alpha:]][^[:alpha:]]')
    15  /
    COL_
    A!
    A?$#
    A123
    3 rows selected.
    SQL> Regards,
    Jo
    Edit: Changed Query. Thanks to Sean... ;)
    Edit: Removed '*$' from query. Thanks again to Sean... !http://www.mysmiley.net/imgs/smile/angel/angelnot.gif!
    Sigh... I think I need to have more practice on these.

  • How to select record item,vendor & quotation wise

    Hi experts,
    I have one quiery regarding developing a report & smartforms i hav to fetch data item wise vendor wise & quotation wise in same requirement.
    thanks
    ketan pande
    ABAP consultant.

    Hi,
    To get the SC item details,you an use the FM 'BBP_PD_SC_GETDETAIL".
    Also to get the vendor details,you can use the FM "BBP_PARTNER_GET_PURCH_DATA_NEW".
    BR,
    Disha.
    Pls reward points for useful answers.

  • Select records based on the closest given time

    Dear SQL gurus,
    I have a table T1:
    Name Null? Type
    ID NOT NULL NUMBER(5)
    MOMENT NOT NULL DATE [DD.MM.YYYY HH24:MI]
    MEASUREMENT NOT NULL NUMBER(8,3)
    Example (ID, MOMENT, MEASUREMENT)
    -- START OF EXAMPLE --
    9380 18.11.2000 03:45 17.6
    9380 18.11.2000 04:30 17.3
    9380 18.11.2000 05:45 16.8
    9380 18.11.2000 06:15 16.8
    9380 18.11.2000 07:00 16.2
    9380 18.11.2000 07:30 16.2
    9380 18.11.2000 08:15 16
    9380 18.11.2000 08:45 15.7
    9380 18.11.2000 09:30 15.4
    9380 18.11.2000 10:00 15.4
    9380 18.11.2000 11:15 15.4
    9380 18.11.2000 11:45 15.4
    9380 18.11.2000 12:30 15.4
    9380 18.11.2000 13:00 15.4
    9380 18.11.2000 13:45 15.4
    --- END OF EXAMPLE --
    How to select records based on the:
    - time period specified by the day only [DD.MM.YYYY] - CONDITION 1
    - with values for 6AM only, and if not available, with values closest to 6AM - CONDITION 2
    (if the time gap in MOMENT field is too big, lets say > 5h then choose the average between the value before 6AM (ex. 4:15AM) and the value after the 6AM (ex. 9:45AM))
    CONDITION 1 (something like): moment between '01.01.2005' and '31.12.2004' - this is OK
    CONDITION 2: I do not know how to formulate, especially if 6AM value is not availabe, and I have to find the closest available value, or get the avergae from the two adjacent values.
    Maybe cursor magic??? Thanks a lot for your help.
    Rado

    About condition two, would the following select be of use to you? Picking the first record could be achived by rownum, analytic function, etc.
    WITH t1 AS (SELECT 9380 id, TO_DATE('18.11.2000 03:45', 'dd.mm.yyyy hh24:mi') moment,  17.6 measurement
                  FROM dual
                 UNION 
                SELECT 9380 id, TO_DATE('18.11.2000 04:30', 'dd.mm.yyyy hh24:mi') moment,  17.3 measurement
                  FROM dual
                 UNION
                SELECT 9380 id, TO_DATE('18.11.2000 05:45', 'dd.mm.yyyy hh24:mi') moment,  16.8 measurement
                  FROM dual
                 UNION
                SELECT 9380 id, TO_DATE('18.11.2000 06:15', 'dd.mm.yyyy hh24:mi') moment,  16.8 measurement
                  FROM dual
    SELECT id, moment, measurement, diff
      FROM (SELECT id, moment, measurement,
                   moment - TO_DATE(TO_CHAR(moment, 'dd.mm.yyyy ') || '06:00', 'dd.mm.yyyy hh24:mi') diff
              FROM t1
    ORDER BY abs(diff) asc, SIGN(diff) desc;
      C.

  • Selecting record from cdpos

    Hi SAP team,
    How to select record from CDPOS when value_old field is initial. For currency field .
    Thanks & Rgds,
    Santhosh Kumar.
    Moderator message: please search for information and try yourself before asking.
    Edited by: Thomas Zloch on Mar 9, 2011 3:52 PM

    Since the problem is related to a custom IDoc, it is the process code of said IDoc where you will have to look. Depending on how the condition records are updated, this will be responsible for writing correct change documents.
    If the process code uses a standard BAPI, then change documents should be written correctly. Otherwise, the code should take care of writing the correct change documents after updating the condition records.
    Often it is possible to update a business object with calling a standard function module, but change documents will not always be written since that is done separately in the usual update process. For instance, you can update a delivery by using RV_DELIVERIES_UPDATE but that won't write change documents by itself at all. So take a look at the process code and investigate how the condition records are updated. Then you'll see the way the change documents are handled.

  • How to create and process Iinteractive report with selected records in 4.1

    Hi,
    I want to have an Interactive report that will have in front of each row a checkbox that can be selected for batch processing. Is there a way to do so?
    If there is please include some method to process those records i.e. for each selected record create a new record on a different table and update the record itself as processed.
    thanks
    Edited by: yannisr on Jul 13, 2012 5:58 AM

    For this you need to consult APEX documentation for two things
    Create a checkboxes using APEX_ITEM API
    How to reference those checkboxes within an On Submit Process

Maybe you are looking for

  • Error Message when installing adobe reader 9.1

    I have a relatively new HP Pavilion dv6936us Entertainment Notebook PC with Windows Vista Home Premium 64-bit.  I cannot get adobe reader installed.  I always get an error message or it says the install was interrupted.  VERY frustrating!  Please hel

  • Microphone buttons do not function.

    So I have the weirdest issue with my headphones. Both earpieces send sound fine, the microphone actually works in a sense that I can have a conversation clearly while on the phone, but the button to start/stop phones, and also the volume control for

  • White / coloured dot in iphone 5 photos and videos

    I have started getting a small white /coloured dot, a reflection possibly, when taking photos, video or vines with the iphone 5. Occurs when shooting towards a bright light. Occurs in the daytime when the sun is out, in the vicinity of but not shooti

  • Digital Signiture in Purchase Orders

    Dear all, I was asked to prepare the technical infrastructure in order for end users (purchasing/procurement department) to assign digital signitures in Purchase Orders produced by SAP. Do you know where do I have to look first in order to get approp

  • Wireless high density - Cisco vs World

    For wireless environments with high density of clients many manufacturers (Meru, Xirrus, Ruckus, Trapeze, ...) have developed equipment and capabilities optimized to provide good performance, these features are mainly based on the use of a single cha