Data fetching anomalities

Ctrl+A fetches all rows and there is no way to cancel it.
I was lucky that this was just a development database (some 60K records vs 20M in production).
Old habits die hard, and I'm used to selecting all fetched data with Ctrl+A. :)
Also - shouldn't hitting Ctrl + End lead you to the very last column of the very last fetched row?
As it is now (v1215) it brings you to the same column of 51st row before the last fetched one (i.e. - brings you to the last row and fetches 50 more).
One more - repeated pressing of Ctrl+End continues fetching more rows. This is no real problem, just thought it was [Page Down]'s job to do that.

And page down does it really nicely - it even returns from time to time to the first column of the first row - so you need to repage them once more, very encouraging if you are at the middle of a long paging.
It seems that this behavor manifest itself if you page fast enough on relatevely slow connection (and if you make pauses while paging all seems to run smoothly, but I'm not 100% sure)

Similar Messages

  • OBIEE 11g - Data Fetch Issue.

    Hi,
    I am facing this weird issue regarding data fetching while executing Reports in OBIEE 11.1.1.5. When I login to the BI user interface and execute any report for the first time, everything is working fine. Bt after that I am not able to execute any report later. Even the report executed for the first time, when I rebuilt and execute it I cannot see the data this time. The Results user interface says - The layout of this view combined with the data,selections,drills or prompt values choosen resulted in no data.
    Thanks in advance.
    Regards,
    Dev.

    Hi,
    I also encounter the same issue. When I view combined layout, I get the No Results message. But when I edit the table layout, I see that there are records returned. Does anyone had any luck in resolving this issue?
    Thanks!

  • Data fetching from BSEG table

    Hi,
    I have used smartforms for generating suppler payment statement for financial department. more time duration is taken by the program when it is generating.
    I think this problem comes while data fetching from BSEG table. because, it has more records for one vendor ID.
    I want reduce this time duration.
    Please guide me.

    Have you tried this selection in se16? I'm quite sure that It will take
    a long time.
    The problem has been explained in this group before and I think you
    should search for bseg in the answers given.
    As a hint: It has to do with the selection universe. You are restricting
    only bukrs from the primary key (all the other restrictions in your
    where clause are filters that are applied on SAP's side (not on the
    database side)). The problem is that bseg isn't stored as separated
    fields in the RDBMS, but as a table with the primary key and a stream of
    bits in a raw field.
    You should review and change the logic you're using before reading bseg.
    It's the only way you'll improve the performance of this select. (for
    example, you could use one or more secondary index tables - bi or ba
    to retrieve belnr and access bseg with a better where clause).

  • ABAP OO data fetch logic

    Hi Experts,
                     I have normal report with dat fetch logic. I need to convert my normal code logic to OO abap logic using classes & methods..
    Exp:
          select knumh kotabnr vakey datab datbi knuma_bo
                 from konh
                 into corresponding fields of table i_konh
                 for all entries in i_kona
                 where knuma_bo eq i_kona-knuma.
    Is there any easy way to write the code in OO using classes & methods.
    Thanks.

    Hi Khan,
    Here is the code for your query with OO abap logic i.e. Class and methods.
    Code.
    TABLES: konh.
    data: i_konh TYPE TABLE OF konh,
          i_kona Type TABLE OF kona.
    CLASS class_name DEFINITION.
    PUBLIC SECTION.
    CLASS-METHODS get_details.
    ENDCLASS.
    CLASS class_name IMPLEMENTATION.
    METHOD get_details.
    DATA: knumh   TYPE REF TO konh-knumh,
               kotabnr  TYPE REF TO konh-kotabnr,
               vakey    TYPE REF TO konh-vakey,
               datab     TYPE REF TO konh-datab,
               datbi       TYPE REF TO konh-datbi,
              knumabo TYPE REF TO konh-knuma_bo.
    select knumh kotabnr vakey datab datbi knuma_bo
                 from konh
                 into corresponding fields of table i_konh
                 for all entries in i_kona
                 where knuma_bo eq i_kona-knuma.
    ENDMETHOD.
       ENDCLASS.
    *Global data.
      data: obj TYPE REF TO class_name.
    *Event block.
      START-OF-SELECTION.
    CREATE OBJECT: obj.
    CALL METHOD obj->get_details.
    Regards,
    Soundarya.
    Edited by: K.Soundarya Singh on Mar 24, 2010 8:42 AM
    Edited by: K.Soundarya Singh on Mar 24, 2010 8:43 AM

  • Pivot Table Data Fetching

    Greetings. I have problem with data fetching in pivot table.
    I can see only 25 rows in it. Any ideas with my problem.

    Hi,
    Try increasing the rangeSize of the iterator to some value like 150?
    -Arun

  • Data fetch problem from EBAN table

    Hi All,
    I have a problem in data fetching. My SQL statement is
            SELECT    A~BANFN
                      A~FRGDT
                      A~MATNR
                      A~MENGE
                      A~MEINS
                      A~AFNAM
                      A~EKGRP
                      A~PRIO_URG
                      A~STATU
                      A~RLWRT
                      A~EBELN
                      A~LOEKZ
                      A~EBELP
                      A~FRGKZ
              INTO CORRESPONDING FIELDS OF TABLE ITAB_DATA
              FROM EBAN AS A
              WHERE     A~STATU IN S_STATU
              AND       A~EKGRP  = S_EKGRP
              AND       A~BANPR  = '05'
              AND       AFNAM  IN P_AFNAM
              AND       BEDNR  IN P_BEDNR .
    In EBAN table data in AFNAM field is like 'Mech', 'mech' & 'Mech'
    Now in selection screen if user give Mech then system picks only that data where 'Mech' is there but requirement is it should pick all data related to ('Mech', 'mech', 'Mech') in AFNAM field. How do I do?
    Thanks and regards,
    Rajesh Vasudeva

    Hello,
    What you ask is not easy but it is feasible.
    We had the same request to make a case-insensitive search on a text field.
    As a reference for our development we took the following example:
    [http://wiki.sdn.sap.com/wiki/display/Snippets/CaseInsensitiveSearchHelpExitforMaterialGroup|http://wiki.sdn.sap.com/wiki/display/Snippets/CaseInsensitiveSearchHelpExitforMaterialGroup]
    In short : the purpose is that first of all you build up a list of all possible values in a separate internal table.
    Then use this separate internal table in the FOR ALL ENTRIES clause when you perform the select on the actual data.
    Success.
    Wim

  • Cursor tips : refresh data fetched by the cursor within run time,discussion

    Hello there,
    May be what I am asking about is kind of weird, but here is the Q:
    let us assume that I have cursor defined as follows:
    cursor emp_cursor is
            select EMPNO, ENAME, deptno
            from emp
            where deptno = 10 ;
    emp_rec  emp_cursor%rowtype;  then inside the loop through the data fetched by this cursor, I need to update some records, which might match the criteria of the cursor, by trying the following code segment:
    open emp_cursor;
          loop
            fetch emp_cursor into emp_rec;
            exit when emp_cursor%notfound;
            "PROCESS THE RECORD'S DATA "
            DBMS_OUTPUT.Put_Line('count of the records: ' || emp_cursor%rowcount);
            DBMS_OUTPUT.Put_Line('deptno: ' || emp_rec.deptno);
            DBMS_OUTPUT.Put_Line('emp no: ' || emp_rec.empno);
            update emp
            set deptno = 10
            where empno= 7566;
            commit;
            DBMS_OUTPUT.Put_Line('after the update');
          end loop;
          close emp_cursor; but the run never shows the record of employee 7566 as one record of the cursor, may be this is the execution plan of the cursor,
    but for the mentioned case, need to re-enter those updated records to the cursor data, to be processed, ( consider that the update statement is conditioned so that not executed always)
    any hints or suggestion
    Best Regards,

    John Spencer wrote:
    Justin Cave wrote:
    Not possible. You'd have to close and re-open the cursor in order to pick up any changes made to the data after the cursor was opened.Then close and re-open it to get any changes made while processing the second iteration, then close and re-open it to get any changes made while processing the third iteration ad infinitum :-)I'm not claiming there are no downsides to the process :-)
    On a serious note, though, the requirement itself is exceedingly odd. You most likely need to rethink your solution so that you remove this requirement. Otherwise, you're likely going to end up querying the same set of rows many, many, many times.
    Justin

  • Data fetch from table without Refresh and without using tab key.

    hi Friends,
    I have a problem i want to extract data from table without Refresh into text field without using Tab key. when i'll enter any value in a text field then corressponding value should come in to corressponding textfield without using Tab Key.
    eg. when i enter emp_id 101 in a text field then the first_name and last_name ,adress should come in to corressponding text fields without refresh and without using Tab key.
    How Can I do this.
    Thanks
    Manoj

    Hi Manoj,
    I assume that this is similar to: Data fetch without Refresh rather than Re: Value of one textfield should come into another textfield Without Using TAB ?
    If so, the only change you need to make on the first one is to use "onkeyup" instead of "onchange" in the item's "HTML Form Element Attributes" setting.
    Note, however, that the user must move away from the item at some point (for example, to click a button), so the onchange will be triggered anyway.
    Andy

  • Firefox Version 27 Reporting Services Action Menu Error. An error has occurred with the data fetch.

    Hello, since I've updated to Firefox 27.0.1 on Windows 7, I'm encountering a problem with Reporting Services on a Sharepoint site. It is a Sharepoint 2010 site with SQL Server Reporting Services 2012 Sharepoint Integrated mode. I was previously on Firefox version 26 and didn't encounter this problem.
    When a report is open and you use the Actions link on the Reporting Services toolbar, I receive the following error messages.
    An error has occurred with the data fetch. Please refresh the page and retry.
    I've tried updating to Firefox 28 beta but the same error occurs. I see another user is having the same problem here. http://sharepoint-community.net/forum/topics/reporting-service-and-firefox-27
    Any help would be appreciated. Thanks!
    Ryan

    Rachel, I did perform the Sharepoint file alteration discussed in the other article and it did stop Firefox from producing the error. I've done some testing on some other browsers and have yet to encounter any problems with the fix however I'm hesitant to perform that workaround in a production environment.
    Thanks for looking.
    Ryan

  • Problem in data fetching

    Hi frnds ,
    When i am testing my workflow i am able to see the values properly . I am havign a activity which is caling a standard template via method which is having some parametres for fetchign the email . so the email is also going to the proper person
    But when i am executing my workflow through the program using event fm then i am not able to see any data displayed . the workflow is triggering if i use a the email as workflow initiator . But there is some problem in data fetching when i go through the program .
    Plz help
    Thanks
    Rohit

    Change this to
    declare
    begin
         go_block('fwqrecview');
    first_record;
    loop
    if :fwqrecview.chk is null then
    clear_record;
    else
    Next_Record;
    Exit When :System.Last_Record = 'TRUE';
    end if;
    end loop;
    end;
    ------------------- End Step 1---------------
    -- fetching records from block 1 -----
    ---- Step 2
         DECLARE
              CURSOR Cur_rv IS
         --     select voucherno.nextval GlVoucher,t.* from
              select inv_no,to_char(r_date,'YYYY') Year, to_char(r_date,'MM') Period,'SRV' Vtype,
              r_date Vdate, narration
              from receipt
              where inv_no = :fwqrecview.inv_no ;
              --) t ;
    BEGIN
              OPEN Cur_rv;
              GO_BLOCK('tempVmaster');
    first_record;
              LOOPi
                   FETCH Cur_Rv INTO :VM_NO,:VM_YEAR,:VM_PERIOD,:VM_VOUCHER_TYPE,:VM_DATE,:VM_NARRATION ;
                   message ('Inv...'||:vm_no);
                   EXIT WHEN Cur_Rv%NOTFOUND;
                   NEXT_RECORD;
              END LOOP;
              CLOSE Cur_Rv;
              FIRST_RECORD;
    END;
    ---- End Step 2 -------

  • Profile error: Memory access violation (data fetch)

    Hello,
    I have VI with a lot of mathematic Nodes. When I try to profile it, I allways get this error: "Memory access violation (data fetch)".
    Keil uVision shows this error:
    "Memory write not possible (Real-Time Agent)
    Memory read not possible (Real-Time Agent)"
    Without profiling the VI works on the MCB2400. And profiling also works if I try very simple examples.
    bye & thanks
    amin

    Hi Amin, Alex,
    I noticed this issue had been open for some time, so I decided to post directly to save time.
    Thanks,
    Jaidev Amrite
    LabVIEW Embedded PSE
     Diagnosis: So apparently, this behavior has nothing to do with the profiler. The culprit is the Advanced Analysis SubVI call (Mean.vi) in BB.vi. 
    Mean.vi has a call library function node inside it and this CLN is configured to run in its own thread (labVIEW spawns a new thread for each call). Probably due to bad thread management on the ARM (in this case), this call causes a memory violation. 
    Solution:Turn off the "Run in any thread" setting on the CLN as shown in the attached screenshot - change it to "Run in UI Thread". For good measure also turn off reentrancy on Mean.vi (second screenshot)
    National Instruments
    LabVIEW Embedded Product Support Engineer

  • IPhone core data - fetched managed objects not being autoreleased on device (fine on simulator)

    I'm currently struggling with a core data issue with my app that defies (my) logic. I'm sure I'm doing something wrong but can't see what. I am doing a basic executeFetchRequest on my core data entity, but the array of managed objects returned never seems to be released ONLY when I run it on the iPhone, under the simulator it works exactly as expected. This is despite using an NSAutoreleasePool to ensure the memory footprint is minimised. I have also checked with Instruments and there are no leaks, just ever increasing allocations of memory (by '[NSManagedObject(_PFDynamicAccessorsAndPropertySupport) allocWithEntity:]'). In my actual app this eventually leads to a didReceiveMemoryWarning call. I have produced a minimal program that reproduces the problem below. I have tried various things such as faulting all the objects before draining the pool, but with no joy. If I provide an NSError pointer to the fetch no error is returned. There are no background threads running.
    +(natural_t) get_free_memory {
        mach_port_t host_port;
        mach_msg_type_number_t host_size;
        vm_size_t pagesize;
        host_port = mach_host_self();
        host_size = sizeof(vm_statistics_data_t) / sizeof(integer_t);
        host_page_size(host_port, &pagesize);
        vm_statistics_data_t vm_stat;
        if (host_statistics(host_port, HOST_VM_INFO, (host_info_t)&vm_stat, &host_size) != KERN_SUCCESS) {
            NSLog(@"Failed to fetch vm statistics");
            return 0;
        /* Stats in bytes */
        natural_t mem_free = vm_stat.free_count * pagesize;
        return mem_free;
    - (void)viewDidLoad
        [super viewDidLoad];
        // Set up the edit and add buttons.
        self.navigationItem.leftBarButtonItem = self.editButtonItem;
        UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(insertNewObject)];
        self.navigationItem.rightBarButtonItem = addButton;
        [addButton release];
        // Obtain the Managed Object Context
        NSManagedObjectContext *context = [(id)[[UIApplication sharedApplication] delegate] managedObjectContext];
        // Check the free memory before we start
        NSLog(@"INITIAL FREEMEM: %d", [RootViewController get_free_memory]);
        // Loop around a few times
        for(int i=0; i<20; i++) {
            // Create an autorelease pool just for this loop
            NSAutoreleasePool *looppool = [[NSAutoreleasePool alloc] init];
            // Check the free memory each time around the loop
            NSLog(@"FREEMEM: %d", [RootViewController get_free_memory]);
            // Create a minimal request
            NSEntityDescription *entityDescription = [NSEntityDescription                                                 
                                                  entityForName:@"TestEntity" inManagedObjectContext:context];
            // 'request' released after fetch to minimise use of autorelease pool       
            NSFetchRequest *request = [[NSFetchRequest alloc] init];
            [request setEntity:entityDescription];
            // Perform the fetch
            NSArray *array = [context executeFetchRequest:request error:nil];       
            [request release];
            // Drain the pool - should release the fetched managed objects?
            [looppool drain];
        // Check the free menory at the end
        NSLog(@"FINAL FREEMEM: %d", [RootViewController get_free_memory]);
    When I run the above on the simulator I get the following output (which looks reasonable to me):
    2011-06-06 09:50:28.123 renniksoft[937:207] INITIAL FREEMEM: 14782464
    2011-06-06 09:50:28.128 renniksoft[937:207] FREEMEM: 14807040
    2011-06-06 09:50:28.135 renniksoft[937:207] FREEMEM: 14831616
    2011-06-06 09:50:28.139 renniksoft[937:207] FREEMEM: 14852096
    2011-06-06 09:50:28.142 renniksoft[937:207] FREEMEM: 14872576
    2011-06-06 09:50:28.146 renniksoft[937:207] FREEMEM: 14897152
    2011-06-06 09:50:28.149 renniksoft[937:207] FREEMEM: 14917632
    2011-06-06 09:50:28.153 renniksoft[937:207] FREEMEM: 14938112
    2011-06-06 09:50:28.158 renniksoft[937:207] FREEMEM: 14962688
    2011-06-06 09:50:28.161 renniksoft[937:207] FREEMEM: 14983168
    2011-06-06 09:50:28.165 renniksoft[937:207] FREEMEM: 14741504
    2011-06-06 09:50:28.168 renniksoft[937:207] FREEMEM: 14770176
    2011-06-06 09:50:28.174 renniksoft[937:207] FREEMEM: 14790656
    2011-06-06 09:50:28.177 renniksoft[937:207] FREEMEM: 14811136
    2011-06-06 09:50:28.182 renniksoft[937:207] FREEMEM: 14831616
    2011-06-06 09:50:28.186 renniksoft[937:207] FREEMEM: 14589952
    2011-06-06 09:50:28.189 renniksoft[937:207] FREEMEM: 14610432
    2011-06-06 09:50:28.192 renniksoft[937:207] FREEMEM: 14630912
    2011-06-06 09:50:28.194 renniksoft[937:207] FREEMEM: 14651392
    2011-06-06 09:50:28.197 renniksoft[937:207] FREEMEM: 14671872
    2011-06-06 09:50:28.200 renniksoft[937:207] FREEMEM: 14692352
    2011-06-06 09:50:28.203 renniksoft[937:207] FINAL FREEMEM: 14716928
    However, when I run it on an actual iPhone 4 (4.3.3) I get the following result:
    2011-06-06 09:55:54.341 renniksoft[4727:707] INITIAL FREEMEM: 267927552
    2011-06-06 09:55:54.348 renniksoft[4727:707] FREEMEM: 267952128
    2011-06-06 09:55:54.702 renniksoft[4727:707] FREEMEM: 265818112
    2011-06-06 09:55:55.214 renniksoft[4727:707] FREEMEM: 265355264
    2011-06-06 09:55:55.714 renniksoft[4727:707] FREEMEM: 264892416
    2011-06-06 09:55:56.215 renniksoft[4727:707] FREEMEM: 264441856
    2011-06-06 09:55:56.713 renniksoft[4727:707] FREEMEM: 263979008
    2011-06-06 09:55:57.226 renniksoft[4727:707] FREEMEM: 264089600
    2011-06-06 09:55:57.721 renniksoft[4727:707] FREEMEM: 263630848
    2011-06-06 09:55:58.226 renniksoft[4727:707] FREEMEM: 263168000
    2011-06-06 09:55:58.726 renniksoft[4727:707] FREEMEM: 262705152
    2011-06-06 09:55:59.242 renniksoft[4727:707] FREEMEM: 262852608
    2011-06-06 09:55:59.737 renniksoft[4727:707] FREEMEM: 262389760
    2011-06-06 09:56:00.243 renniksoft[4727:707] FREEMEM: 261931008
    2011-06-06 09:56:00.751 renniksoft[4727:707] FREEMEM: 261992448
    2011-06-06 09:56:01.280 renniksoft[4727:707] FREEMEM: 261574656
    2011-06-06 09:56:01.774 renniksoft[4727:707] FREEMEM: 261148672
    2011-06-06 09:56:02.290 renniksoft[4727:707] FREEMEM: 260755456
    2011-06-06 09:56:02.820 renniksoft[4727:707] FREEMEM: 260837376
    2011-06-06 09:56:03.334 renniksoft[4727:707] FREEMEM: 260395008
    2011-06-06 09:56:03.825 renniksoft[4727:707] FREEMEM: 259932160
    2011-06-06 09:56:04.346 renniksoft[4727:707] FINAL FREEMEM: 259555328
    The amount of free memory reduces each time round the loop in proportion to the managed objects I fetch e.g. if I fetch twice as many objects then the free memory reduces twice as quickly - so I'm pretty confident it is the managed objects that are not being released. Note that the entities that are being fetched are very basic, just two attributes, a string and a 16 bit integer. There are 1000 of them being fetched in the examples above. The code I used to generate them is as follows:
    // Create test entities
    for(int i=0; i<1000; i++) {
        id entity = [NSEntityDescription insertNewObjectForEntityForName:@"TestEntity" inManagedObjectContext:context];
        [entity setValue:[NSString stringWithFormat:@"%d",i] forKey:@"name"];
        [entity setValue:[NSNumber numberWithInt:i] forKey:@"value"];
    if (![context save:nil]) {
        NSLog(@"Couldn't save");
    If anyone can explain to me what is going on I'd be very grateful! This issue is the only only one holding up the release of my app. It works beautifully on the simulator!!
    Please let me know if there's any more info I can supply.

    Update: I modified the above code so that the fetch (and looppool etc.) take place when a timer fires. This means that the fetches aren't blocked in viewDidLoad.
    The result of this is that the issue happens exactly as before, but the applicationDidReceiveMemoryWarning is fired as expected:
    2011-06-08 09:54:21.024 renniksoft[5993:707] FREEMEM: 6131712
    2011-06-08 09:54:22.922 renniksoft[5993:707] Received memory warning. Level=2
    2011-06-08 09:54:22.926 renniksoft[5993:707] applicationDidReceiveMemoryWarning
    2011-06-08 09:54:22.929 renniksoft[5993:707] FREEMEM: 5615616
    2011-06-08 09:54:22.932 renniksoft[5993:707] didReceiveMemoryWarning
    2011-06-08 09:54:22.935 renniksoft[5993:707] FREEMEM: 5656576

  • Internal table data fetch

    hi,
    I'm fetching 10 datas from flat file to internal table. But my requirement is first column data is passed to table i need to select 5 column of data from my internal table.
    Eg. column 1 = A1
          column 2 = A2
          column 3 = A3
          column 4 = A4
          column 5 = A5
          column 6 = A6
    i passed A1 data and next time i need to select A5. is it possible.
    If any one knows let me give the solution..
    regards,
    bab

    Hi,
    Have a look at this [Convert rows into columns|http://docs.google.com/Doc?id=dfv2hmgs_5d6bcxqgp&hl=en] if you are looking to convert rows of a internal table into columns
    Regards,
    Vikranth

  • Regarding performance tuning for BSEG & BKPF table data fetch

    Hi Friends:
       Plz see the below select queries. This is really impacting the performance of my report. Plz suggest the steps to increase the performance of the report.Points will be rewarded.
    Thanks:
    FORM GET_DATA .
    Selecting the Document number from BSEG table
      SELECT BELNR BUKRS FROM BSEG INTO TABLE L_DOC_NO
                                   WHERE BUKRS IN S_BUKRS
                                   AND   GJAHR = P_GJAHR
                                   AND   HKONT IN S_SAKNR.
      IF SY-SUBRC <> 0.
        MESSAGE ID 'ZTFI' TYPE 'E' NUMBER 006.
      ENDIF.
      CLEAR L_DOC_NO.
      SORT L_DOC_NO BY BELNR.
    Selecting the Document Number Based on the selection-screen.
      SELECT BELNR BUKRS BUDAT CPUDT  BLART MONAT FROM BKPF INTO TABLE
    L_BKPF
      FOR ALL ENTRIES IN L_DOC_NO
                            WHERE BUKRS = L_DOC_NO-BUKRS AND
                                  BELNR = L_DOC_NO-BELNR AND
                                  GJAHR = P_GJAHR AND
                                  BUDAT IN S_BUDAT AND
                                  MONAT IN S_MONAT.
      IF SY-SUBRC <> 0.
        MESSAGE ID 'ZTFI' TYPE 'E' NUMBER 006.
      ENDIF.
    *Fetch the Line Items
      SORT L_BKPF BY BELNR.
      SELECT BELNR BUKRS BUZEI HKONT  SHKZG WRBTR FROM BSEG INTO TABLE
    L_BSEG
                                    FOR ALL ENTRIES IN L_BKPF
                                 WHERE BUKRS = L_BKPF-BUKRS
                                 AND   BELNR = L_BKPF-BELNR
                                 AND   GJAHR = P_GJAHR
                                 AND   BUZEI BETWEEN '001' AND '999'.

    Hi,
    Let me understand your code first.
    The below code (the 2 selects) gets data from BSEG first and then gets data from BKPF table.
    "*Selecting the Document number from BSEG table
    SELECT BELNR BUKRS FROM BSEG INTO TABLE L_DOC_NO
    WHERE BUKRS IN S_BUKRS
    AND GJAHR = P_GJAHR
    AND HKONT IN S_SAKNR.
    IF SY-SUBRC 0.
    MESSAGE ID 'ZTFI' TYPE 'E' NUMBER 006.
    ENDIF.
    CLEAR L_DOC_NO.
    SORT L_DOC_NO BY BELNR.
    "*Selecting the Document Number Based on the selection-screen.
    SELECT BELNR BUKRS BUDAT CPUDT BLART MONAT FROM BKPF INTO TABLE L_BKPF
    FOR ALL ENTRIES IN L_DOC_NO
    WHERE BUKRS = L_DOC_NO-BUKRS AND
    BELNR = L_DOC_NO-BELNR AND
    GJAHR = P_GJAHR AND
    BUDAT IN S_BUDAT AND
    MONAT IN S_MONAT.
    IF SY-SUBRC 0.
    MESSAGE ID 'ZTFI' TYPE 'E' NUMBER 006.
    ENDIF.
    The below code, can't you avoid by taking all the fields required on your 1st select on BSEG table?
    *Fetch the Line Items
    SORT L_BKPF BY BELNR.
    SELECT BELNR BUKRS BUZEI HKONT SHKZG WRBTR FROM BSEG INTO TABLE
    L_BSEG
    FOR ALL ENTRIES IN L_BKPF
    WHERE BUKRS = L_BKPF-BUKRS
    AND BELNR = L_BKPF-BELNR
    AND GJAHR = P_GJAHR
    AND BUZEI BETWEEN '001' AND '999'.
    Please check the below blog on "Performance of Nested Loops" by Rob Burbank which would be really helpful.
    /people/rob.burbank/blog/2006/02/07/performance-of-nested-loops
    Hope this helps. Rwd points if helpful.
    Thanks,
    Balaji

  • Data fetching problem in internal table

    Hi All,
    I have two internal table which are of type as shown below.
    itab1 is of following type:
    regno(255) type c,
    uid type c
    itab2 is of following type
    regno type regno,
    uid type userid,
    address type add,
    phno type phn.
    Datas in itab2 are as follows:
    100       01       india              3454534
    200       01       china             34553543
    300       02       us                  6464654
    400       02       uk                   45654
    Itab1 is populated using the uid field as key as shown below.
    regno                          uid
    100 200                           01
    300 400                           02
    100 200 are values in field regno
    01  is uid.
    What we have done is collected all the regno which belong to the same uid for sending a single mail to the uid person with both the regno. We are able to achieve this. For this finally we loop into itab1 and fetch the uid and send mail to him.
    Now an extra requirement is to send the details of a regno (address and phno) along with the mail. The prob is in our final internal table we have a character field which will have all the regno for a uid (may be upto 20). Each regno will be of length 3.
    I have to loop into tab1 and read tab2 to achieve this using uid as key. But regno will for a uid will be combined. I have fetch each regno say 100 first and get the details and then 200 and then get the details and send a mail to uid 01. Then 300 and 400 details and then a mail to uid 02.
    Please explain how to get individual regno when i loop into tab1 and read tab2 so that i can fetch the details.
    Any suggestion will be very helpful

    Hi Aslam,
    As per my understanding...
    In itab1, instead of maintaining all the reg no in the same field(like 100 200 300 ....) againist uid 01
    maintain multiple records like
    regno  udi
    100      01
    200      01
    300      01 etc
    (in this case the combination of regno & uid becomes the key.)
    now while ur sending mail to the people, just loop the recors of itab1
    in the same loop u can just write a read statement to get the remainig details(address, phone no etc..) of that regno from itab2.
    Hope this helps you, revert back if still u hav any problm.

Maybe you are looking for