For all entries issue

Hi All,
Below is the select query I have which is taking more time when the records in the internal table is touching to almost 2 million.
SELECT paledger vrgar versi                                 
        perio paobjnr pasubnr                             
        belnr posnr gjahr perde                                                
    FROM   ce1ec01
    APPENDING TABLE t_ce1ec01 PACKAGE SIZE 10000           
    FOR ALL ENTRIES IN t_arixco2_tmp                       
    WHERE paobjnr EQ t_arixco2_tmp-paobjnr                 
      AND PERIO gt p_perio.                                
ENDSELECT.     
The secondary index is created with fields PAOBJNR and PERIO fields.
I have used ST05 and it is using the secondary index.
Regards,
Pratyusha.

the second thing (after Rob's suggestion) to do is to try it like this:
SELECT paledger vrgar versi
perio paobjnr pasubnr
belnr posnr gjahr perde
FROM ce1ec01
INTO TABLE t_ce1ec01
FOR ALL ENTRIES IN t_arixco2_tmp
WHERE paobjnr EQ t_arixco2_tmp-paobjnr
AND PERIO gt p_perio.
since the package size will not save memory for the FAE we can try it directly
since all the data is selected before the package size is applied in any case.
if this fails we have a configuration issue. (your memory demand is higher than what
your configuration allows). You have to think of alternative solutions than... e.g.
divide the entries in t_arixco2_tmp in packages and process one after the other with FAE.
Kind regrds,
Hermann

Similar Messages

  • Performance Issue in Select Statement (For All Entries)

    Hello,
    I have a report where i have two select statement
    First Select Statement:
    Select A B C P Q R
         from T1 into Table it_t1
              where ....
    Internal Table it_t1 is populated with 359801 entries through this select statement.
    Second Select Statement:
    Select A B C X Y Z
         from T2 in it_t2 For All Entries in it_t1
              where A eq it_t1-A
                 and B eq it_t1-B
                 and C eq it_t1-C
    Now Table T2 contains more than 10 lac records and at the end of select statement it_t2 is populated with 844003 but it takes a lot of time (15 -20 min) to execute second select statement.
    Can this code be optimized?
    Also i have created respective indexes on table T1 and T2 for the fields in Where Condition.
    Regards,

    If you have completed all the steps mentioned by others, in the above thread, and still you are facing issues then,.....
    Use a Select within Select.
    First Select Statement:
    Select A B C P Q R package size 5000
         from T1 into Table it_t1
              where ....
    Second Select Statement:
    Select A B C X Y Z
         from T2 in it_t2 For All Entries in it_t1
              where A eq it_t1-A
                 and B eq it_t1-B
                 and C eq it_t1-C
    do processing........
    endselect
    This way, while using for all entries on T2, your it_t1, will have limited number of entries and thus the 2nd select will be faster.
    Thanks,
    Juwin

  • Performance issue with select query and for all entries.

    hi,
    i have a report to be performance tuned.
    the database table has around 20 million entries and 25 fields.
    so, the report fetches the distinct values of two fields using one select query.
    so, the first select query fetches around 150 entries from the table for 2 fields.
    then it applies some logic and eliminates some entries and makes entries around 80-90...
    and then it again applies the select query on the same table using for all entries applied on the internal table with 80-90 entries...
    in short,
    it accesses the same database table twice.
    so, i tried to get the database table in internal table and apply the logic on internal table and delete the unwanted entries.. but it gave me memory dump, and it wont take that huge amount of data into abap memory...
    is around 80-90 entries too much for using "for all entries"?
    the logic that is applied to eliminate the entries from internal table is too long, and hence cannot be converted into where clause to convert it into single select..
    i really cant find the way out...
    please help.

    chinmay kulkarni wrote:Chinmay,
    Even though you tried to ask the question with detailed explanation, unfortunately it is still not clear.
    It is perfectly fine to access the same database twice. If that is working for you, I don't think there is any need to change the logic. As Rob mentioned, 80 or 8000 records is not a problem in "for all entries" clause.
    >
    > so, i tried to get the database table in internal table and apply the logic on internal table and delete the unwanted entries.. but it gave me memory dump, and it wont take that huge amount of data into abap memory...
    >
    It is not clear what you tried to do here. Did you try to bring all 20 million records into an internal table? That will certainly cause the program to short dump with memory shortage.
    > the logic that is applied to eliminate the entries from internal table is too long, and hence cannot be converted into where clause to convert it into single select..
    >
    That is fine. Actually, it is better (performance wise) to do much of the work in ABAP than writing a complex WHERE clause that might bog down the database.

  • Performance issue fetching huge number of record with "FOR ALL ENTRIES"

    Hello,
    We need to extract an huge amount of data (about 1.000.000 records) from VBEP table, which overall dimension is about 120 milions records.
    We actually use this statements:
    CHECK NOT ( it_massive_vbep[] IS INITIAL ) .
    SELECT (list of fields) FROM vbep JOIN vbap
                 ON vbepvbeln = vbapvbeln AND
                  vbepposnr = vbapposnr
                 INTO CORRESPONDING FIELDS OF  w_sched
                 FOR ALL ENTRIES IN it_massive_vbep
                 WHERE    vbep~vbeln   = it_massive_vbep-tabkey-vbeln
                    AND    vbep~posnr   = it_massive_vbep-tabkey-posnr
                    AND    vbep~etenr   = it_massive_vbep-tabkey-etenr.
    notice that internal table it_massive_vbep contains always records with fully specified key.
    Do you think this query could be further optimized?
    many thanks,
    -Enrico

    the are 2 option to improve performance:
    + you should work in blocks of 10.000 to 50.000
    + you should check archiving options, does this really make sense
    > VBEP table, which overall dimension is about 120 milions records.
    it_massive_vbep  into it_vbep_notsomassive (it_vbep_2)
    CHECK NOT ( it_vbep_2[] IS INITIAL ) .
      get runtime field start.
    SELECT (+list of fields+)
                  INTO CORRESPONDING FIELDS OF TABLE w_sched
                  FROM vbep JOIN vbap
                  ON vbep~vbeln = vbap~vbeln AND
                       vbep~posnr = vbap~posnr
                  FOR ALL ENTRIES IN it_vbep_2
                  WHERE vbep~vbeln = it_vbep_2-vbeln
                  AND      vbep~posnr = it_vbep_2-posnr
                  AND      vbep~etenr  = it_vbep_2-etenr.
      get runtime field stop.
    t = stop - start.
    write: / t.
    Be aware that even 10.000 will take some time.
    Other question, how did you get the 1.000.000 records in it_massive_vbep. They are not typed in, but somehow select.
    Change the FAE into a JOIN and it will be much faster.
    Siegfried

  • Issue with FOR ALL ENTRIES

    Hi All,
    I have used FOR ALL ENTRIES statement in while selecting data based on some other internal table (to avoid select within loop).
    While using FOR ALL ENTRIES, the target table (internal table in which data is getting stored) is getting affected.
    The other fields are becoming zero and several rows gets delerted from the internal table after performing select query.
    How to avoid this bug?
    Kindly help me out....
    Regards
    Pavan

    hi after the for all entries statement did you used the read statement .
    if not you will not get any data ..check this program..
    tables:mara,marc.
    data:begin of itab occurs 0,
         matnr like mara-matnr,
         end of itab.
    data:begin of itab1 occurs 0,
         matnr like marc-matnr,
         werks like marc-werks,
         end of itab1.
    select   matnr
          from mara
          into corresponding fields of  table itab.
          if   itab is initial.
          select  matnr
                  werks
                 from marc
                 into  table itab1
                 for all entries in itab
                 where matnr = itab-matnr.
                 loop at itab1.
                 read table itab with key matnr = itab-matnr.
                 write:/ itab1-matnr,itab1-werks.
                 endloop.
                 endif.

  • Performance issue in 'Selelect statement with for all entries'

    Hi,
      The following SELECT statement is taking too much time.
             SELECT * FROM /rb04/yc5_mver
             INTO TABLE g_it_mver
             FOR ALL ENTRIES IN l_it_inva
             WHERE matnr EQ l_it_inva-matnr  AND
                          werks EQ l_it_inva-werks  AND
                          indei EQ l_it_inva-indei  AND
                          gjahr IN g_r_gjahr.
         Internal table l_it_inva is having too many records.
        Is there any way to optimize it.
    Regards,
    Tintu

    Hi Tintu,
    check table  l_it_inva for initial.
    sort internal table  l_it_inva with key  matnr werks indei gjahr.
    delete adjacent duplicates from  l_it_inva comparing   matnr werks indei gjahr.
    Then use following select query.
    SELECT * FROM /rb04/yc5_mver
    INTO TABLE g_it_mver
    FOR ALL ENTRIES IN l_it_inva
    WHERE matnr EQ l_it_inva-matnr AND
    werks EQ l_it_inva-werks AND
    indei EQ l_it_inva-indei AND
    gjahr IN g_r_gjahr.
    Regards,
    Vijay

  • About for all entries in itab usage issue

    hi
    i will get a lot of material information first.
    the next i will get inforamtion about table MARC AND MBEW.
    one statement i use sap function to get MARC:
      CALL FUNCTION 'MARC_ARRAY_READ'
        EXPORTING
          KZRFB                = ' '
          NEUFLAG              = ' '
          SPERRMODUS           = ' '
          STD_SPERRMODUS       = ' '
          EXCEPTION_ON_LOCK    = ' '
        IMPORTING
          RETC                 = ret
        TABLES
          IPRE01               = ipre
          MARC_TAB             = disp
        EXCEPTIONS
          ENQUEUE_MODE_CHANGED = 1
          LOCK_ON_MARC         = 2
          LOCK_SYSTEM_ERROR    = 3
          OTHERS               = 4.
    two statement if i use:
        select matnr dispo ekgrp plifz
      into table disp
      from marc
      for all entries in ipre
      where werks = ipre-werks and
            matnr = ipre-matnr.
    which one will get better performce.
    and
    if ipre table have a lot of data, so in sap what about for all entries of Limit?
    and will lose data to use for all entries of statements?
    have function in sap to get data like 'MARC_ARRAY_READ' about MEBW.
    THANK YOU!

    thank you!
    what about for all entries of Limit?
    and will lose data to use for all entries of statements?
    exist function about get MEBW ARRAY??

  • FOR ALL ENTRIES IN Memory Dump Issue

    We have a "TSV_TNEW_BLOCKS_NO_ROLL_MEMORY" dump that is confusing me.  The dump shows the SELECT (copied below) results in a gt_ekko_total table with over 70 million records (from the dump - Table IT_58[70324288x66]).  The problem is since EKKO has 294,000 rows and EKPO has 4.5 million rows, and a FOR ALL ENTRIES IN automatically changes the SELECT to a SELECT DISTINCT, the result table can have at most 4.5 million records.  On a FOR ALL ENTRIES IN, does the database return all the rows and then SAP "deletes adjacent duplicates"?
    The only solution I can think of is to change the SELECT to a SELECT DISTINCT, so perhaps when SAP builds the receiving itab, it may have many fewer rows.  Let me know if you have seen this before.
    SELECT ekkoebeln ekkobsart ekkolponr ekkolifnr ekpo~werks
      FROM ekko
    INNER JOIN ekpo ON ekkoebeln = ekpoebeln
      INTO TABLE gt_ekko_total
       FOR ALL ENTRIES IN pt_sched_agrm
    WHERE ekko~lifnr = pt_sched_agrm-vendor
       AND ekko~bsart = pt_sched_agrm-doc_type
       AND ekpo~werks = pt_sched_agrm-plant
       AND ekko~loekz = space.

    Hi Mike,
    If did all the pre-requisite for for all entries and failed to improve the performance, you use the following way.
    Instead of directly select from ekko you can select the po number(EBELN) from VIEW M_MEKKL based on LIFNR, BSART and BSTYP (what ever the fields you have) . Then do the joining select based on EBELN not LIFNR. It will surely improve your performance. For more details take reference of sap note: 0000191492.
    Thanks
    Subhankr

  • Which is better group by or for all entries in

    We have more than 11 Lac Records in AUFM table.
    I am working on a Report to find SO to Production Order to AUFM (for raw material).
    It's ALV OOP.
    Which code will give better result - For AUFM fetch with key AUFNR.
    GROUP BY matnr
    OR
    FOR ALL ENTRIES IN it_previous
    Moderator message: too vague to give decent advice, please try yourself first and compare runtimes, re-post including all relevant information if required, please use international units only when posting again.
    Please Read before Posting in the Performance and Tuning Forum
    locked by: Thomas Zloch on Sep 8, 2010 10:13 AM

    that oracle wont work if we have group by on a column which is character data type instead of number data typeEither he has been taught wrongly OR he has come across one specific case where it seems that there was an issue but he doesn't know enough about that case and is making a generalisation.
    Hemant K Chitale

  • Select... for all entries in...

    Hi,
    Can anybody help me to sort out this issue. This select should work. I m filling an itab with distinct pernr. in temp it should give <b>all the records for which pernr should not be in itab.</b>
    report ZTEST4.
    data : begin of ITAB occurs 0,
            PERNR like PA0001-PERNR,
            ename like pa0001-ename,
           end of ITAB.
    data : temp like itab occurs 0 with header line.
    clear : ITAB, TEMP.
    refresh : ITAB,TEMP.
    select distinct PERNR into table ITAB from PA0001 where PERNR le 10.
    select PERNR ENAME into table TEMP from PA0001
    for all entries in ITAB where pernr not in itab-pernr.
    sort TEMP by PERNR.
    break-point.

    Hi Sagar,
    If i understand it well, you exclude all PERNR LE 10.
    But first things first.
    You cannot use the FOR ALL ENTRIES in your case (it doesn't allow the operator "NOT IN").
    Your code should be:
    REPORT ztest4.
    TYPES: BEGIN OF ty_itab,
             pernr TYPE persno,
             ename TYPE emnam,
           END OF ty_itab.
    DATA : itab TYPE ty_itab occurs 0,
           wtab TYPE ty_itab.
    CLEAR: itab,
           wtab.
    SELECT pernr ename
         INTO TABLE itab
               FROM pa0001
              WHERE pernr LE 10
           ORDER BY pernr.
    IF sy-subrc EQ 0.
      DELETE ADJACENT DUPLICATES FROM itab COMPARING pernr.
    ENDIF.
    Regards,
    Rob.

  • SELECT ... FOR ALL ENTRIES IN fails!!!

    Hi,
    we are on Kernel 640_REL unicode and found a Kernel error:
    Using SELECT ... FOR ALL ENTRIES IN with a field list to be retrieved,  the ABAP-Database interface obviously deletes duplicate records.
    Our scenario is retrieval of open special ledger postings for customers from BSID.
    The fields specified were
    BUKRS KUNNR WAERS DMBTR WRBTR SHKZG UMSKZ
    If a customer has more than one matching record with the same amount, only one of those is returned. The only way to get all matching records is to retrieve all key fields.
    I forwarded to the people handling OSS-requests in our project. Before we get the solution, i want to issue a severe warning.
    This failure is decribed in note 65554 for Kernel-Release <= 3.0F and <= 4.6D, also Release 6.10. But nothing newer.
    After all those years of ABAP I did not expect they can't handle SQL.
    regards,
    Clemens

    Hi Clemens
    If I understand your post, I don't think there is an error, the following is from the online help:
    "The result set of the SELECT statement is the union of the individual selections for each line of the internal table. Duplicate lines are automatically eliminated from the result set. If <itab> is empty, the addition FOR ALL ENTRIES is disregarded, and all entries are read. "
    I believe that 'FOR ALL ENTRIES' is a union and therefore duplicate rows are removed.  If you want each row to appear then you need to make the row unique by using all the key fields. I think it would also be better to inlcude all the key fields in the WHERE clause anyway.
    Kind regards
    Andy

  • Populating Empty Fields for Existing Internal Table Using For All Entries

    I have an internal table called itab_extract that populates without any issues in SELECT A and SELECT B below. Trying to avoid looping, I am using select DB table 'for all entries' in itab_extract. I want the empty fields in itab_extract to populate from the values in the database. However, about 200,000 entries are being appended to the table, and, the values that existed for the already populated fields in itab_extract are gone, and the new fields are populated.
    I've played with the syntax and cannot seem to get it to work. My next option is a time consuming loop.
    How should the for all entries syntax look to accomplish filling the empty fields in the itab?   Thank-You
    *read ekko
        select ebeln lifnr aedat bsart from ekko                                                     *SELECT A*
               into  CORRESPONDING FIELDS OF TABLE me->itab_extract
               where aedat in r_aedat.
        select ebeln lifnr aedat BSART from ekko                                                  *SELECT B*
               appending CORRESPONDING FIELDS OF TABLE me->itab_extract
               where aedat in S_DATE2 AND
                     BSART IN S_BSART.
          select ebelp werks matnr                                                                           *SELECT C*
            into CORRESPONDING FIELDS OF TABLE itab_extract
            from ekpo
            FOR ALL ENTRIES IN itab_extract
            where ebeln = itab_extract-ebeln.

    Hi Tom,
               This SQL statement will be time consuming, Do not use a loop.
    There are two options.
    1. Select EKKO and EKPO details based on standard SAP view. (You can type EKKO in se11 view to find the correct view).
        also use one range table populate r_aedat and s_date2 in the same. So you where condition will have r_newrange and   
        s_bsart. Also do not use into corresponding fields, it is not a good idea. It will increase your performance. Maintain the proper 
        sequence (Based on database structure of EKKO and EKPO)
    2. If you are keen to use for all entries, then first select ekko then after your sy-subrc check get the data from EKPO.
    Should be like this.
    select ebeln bsart aedat lifnr from ekko into table gt_ekko where aedat in r_newrange and bsart in s_bsart.
    if sy-subrc eq 0.
    sort gt_ekko by ebeln ascending.
    select ebeln ebelp werks matnr  into table gt_ekpo for all entries in gt_ekko where ebeln eq gt_ekko-ebeln.
    endif.
    Hope it helps,
    Best Regards,
    Tapodipta Khan.

  • Replacing a inner join with for all entries

    Hi Team,
       In a already developed program I am replacing a inner join with select query follow up with for-all-entris and passing the data to final internal table but in both the case the result should be same then only my replacement will be correct. But my no records in both cases differs. This happening because when i am selecting data from first data base table is 32 lines. then I am doing fo-all-entries moving all the duplicate entries then the no records are four. but in final internal table i am looping the first internal table. So in final internal table the no of records are 32. But in inner join query the records are 16.So please let me know how resolve this issue?
    Thanks and REgards
    Deepa

    Hi Thomas,
      Thanks for ur suggestion.
    The solved that in below.
    In select query I did not change anything The way I had written the code was correct.
    I think many of us know how to write that how to make the performance better in that way.
    I made the change when I transfered the to final internal table.
    The original Inner join code:
    select a~field1 a~field2 a~field3 b~field2 b~field3 b~field4
               from dbtab1 as a  inner join dbtab2 as b
              on a~field1 = b~field1 into it_final where
              a~field1 in s_field1. [Field1  in both the table are key field]
    Before code:
    Sort itab1 by key-fields.
    sort itab2 by keyfields.
    loop at itab1 into wa1.
    move: wa1-field1 to wa_final-field1,
               wa1-field2 to wa_final-field2,
               wa1-field3 to wa_final-field3.
    read table itab2 into wa2 witk key field1 = wa1-field1 binary search.
      if sy-subrc = 0.
      move : wa2-field2 to wa_final-field4,
                 wa2-field3 to wa_final-field5,
                 wa2-field4 to wa_final-field6.
    append wa_final to it_final.
    endif.
    Clear : wa1, wa2, wa_final.
    endloop.
    In this case if the one key fieild value is not present there in second internal table but its there in first internal table still it will read that row with 2nd internal values having zeroes. Normally what does not happen in inner join case if the key field value will same in both the case ,then that will fetch only those rows.
    Changed Code
    loop at itab1 into wa1.
    read table itab2 into wa2 witk key field1 = wa1-field1 binary search.
      if sy-subrc = 0.
    move: wa1-field1 to wa_final-field1,
               wa1-field2 to wa_final-field2,
               wa1-field3 to wa_final-field3.
      move : wa2-field2 to wa_final-field4,
                 wa2-field3 to wa_final-field5,
                 wa2-field4 to wa_final-field6.
    append wa_final to it_final.
    endif.
    Clear : wa1, wa2, wa_final.
    endloop.
    In this case the values will read to final internal table if both key field matches.
    With Regards
    Deepa

  • Dynamic SELECT with FOR ALL ENTRIES IN

    Hello Xperts,
    we are having a bit of trouble with the following SELECT
    FIELD-SYMBOLS:
            <itab1>      TYPE standard table.
      ASSIGN ATTR_T_I->* TO <itab1>.
        select
          FIELD1
          FIELD2
        from DBTAB1
        into CORRESPONDING FIELDS OF table <itab1>
        FOR ALL ENTRIES IN <itab1>
        where
          FIELD3     =   <itab1>-FIELD3    and
          FIELD4     =   <itab1>-FIELD4
    ATTR_T_I is a static attibute of type table.
    The syntax check throws the following message:
    The specified type has no structure and therefore no component  called FIELD3.
    Any ideas out there how to solve this issue?
    Thanx!

    Hi Martin,
    Change your code like this and try.
    DATA: itab2 TYPE TABLE OF string.
    FIELD-SYMBOLS:
            <itab1>      TYPE standard table.
      ASSIGN ATTR_T_I->* TO <itab1>.
    APPEND 'FIELD3     =   <itab1>-FIELD3    and' TO itab2.
    APPEND 'FIELD4     =   <itab1>-FIELD4' TO itab2.
        select
          FIELD1
          FIELD2
        from DBTAB1
        into CORRESPONDING FIELDS OF table <itab1>
        FOR ALL ENTRIES IN <itab1>
        where
          (itab2)
    Regards,
    Rahul Muraleedharan.

  • For all entries on custom tables

    i have created 2 custom tables::zhospital_info n zpatient_info..
    zhospitalinfo tab fields:::_
    doc_name::prim key
    patient_name:::prim key
    place::prim key
    zpatientinfo tab fields::_
             ZDATE ::prim key
             JOINING
             MEDICINE
             PRICE
             QUANTITY
             DOC_NAME ::for key
             PATIENT_NAME::for key
             PLACE ::for key
    and inserted some values to the table contents..
    this is my logic:::
    TYPES: BEGIN OF ZHOSPITAL_INFO,
            DOC_NAME TYPE ZDOC_NAME,
            PATIENT_NAME TYPE ZPATIENT_NAME,
            PLACE TYPE ZPLACE,
           END OF ZHOSPITAL_INFO.
    DATA: W_HI TYPE ZHOSPITAL_INFO.
    DATA:T_HI TYPE STANDARD TABLE OF ZHOSPITAL_INFO.
    TYPES: BEGIN OF ZPATIENTL_INFO,
             ZDATE TYPE ZDATE,
             JOINING TYPE ZJOINING,
             MEDICINE TYPE ZMEDICINE,
             PRICE TYPE ZPRICE,
             QUANTITY TYPE ZQUANTITY,
             DOC_NAME TYPE ZDOC_NAME,
             PATIENT_NAME TYPE ZPATIENT_NAME,
             PLACE TYPE ZPLACE,
           END OF ZPATIENTL_INFO.
    DATA: W_PI TYPE ZPATIENTL_INFO.
    DATA:T_PI TYPE STANDARD TABLE OF ZPATIENTL_INFO.
    TYPES: BEGIN OF FTAB,
            DOC_NAME TYPE ZDOC_NAME,
            PATIENT_NAME TYPE ZPATIENT_NAME,
            PLACE TYPE ZPLACE,
            DATE TYPE ZDATE,
            JOINING TYPE ZJOINING,
            MEDICINE TYPE ZMEDICINE,
            PRICE TYPE ZPRICE,
            QUANTITY TYPE ZQUANTITY,
           END OF FTAB.
    DATA: W_FTAB TYPE FTAB,
          T_FTAB TYPE STANDARD TABLE OF FTAB.
    SELECT DOC_NAME
           PATIENT_NAME
           PLACE
           INTO TABLE t_hi
           FROM ZHOSPITAL_INFO .
    IF NOT t_hi IS NOT INITIAL.
    SELECT DOC_NAME
           PATIENT_NAME
           PLACE
           ZDATE
          MEDICINE*
           PRICE
           QUANTITY FROM ZPATIENTL_INFO INTO TABLE t_pi FOR ALL ENTRIES IN
    t_hi
           WHERE DOC_NAME = t_hi-doc_name.
    ENDIF.
    LOOP AT t_pi INTO w_pi.
    MOVE-CORRESPONDING: w_pi TO W_FTAB.
    READ TABLE t_hi INTO w_hi WITH KEY DOC_NAME = W_FTAB-DOC_NAME.
    MOVE: w_hi-patient_name TO W_FTAB-PATIENT_NAME,
          w_hi-place TO W_FTAB-PLACE.
          APPEND W_FTAB TO T_FTAB.
    ENDLOOP.
    LOOP AT T_FTAB INTO W_FTAB.
       WRITE:/ W_FTAB-DOC_NAME,
               W_FTAB-PATIENT_NAME,
               W_FTAB-PLACE,
               W_FTAB-DATE,
               W_FTAB-JOINING,
               W_FTAB-MEDICINE,
               W_FTAB-PRICE,
               W_FTAB-QUANTITY.
    ENDLOOP.
    req output:::when i enter doc_name the related info accr to doc_name from the both tables should be display..
    m getting no errors but i cant execute my prog..
    please check out my code...
    thanx in adv..

    Hi,
    The problem is in the select statement:
    SELECT DOC_NAME
    PATIENT_NAME
    PLACE
    ZDATE
    MEDICINE
    PRICE
    QUANTITY FROM ZPATIENTL_INFO INTO TABLE t_pi FOR ALL ENTRIES IN
    t_hi
    WHERE DOC_NAME = t_hi-doc_name.
    Change this to SELECT DOC_NAME PATIENT_NAME PLACE ZDATE MEDICINE PRICE QUANTITY FROM ZPATIENTL_INFO INTO CORRESPONDING FIELDS OF TABLE t-pi FOR ALL ENTRIES IN t_hi WHERE DOC_NAME = t_hi-doc_name.
    I hope the above code will help you...
    Also i hope to tell the following for performance issues and also a good programming practice:
    LOOP AT t_pi INTO w_pi.
    MOVE-CORRESPONDING: w_pi TO W_FTAB.
    READ TABLE t_hi INTO w_hi WITH KEY DOC_NAME = W_FTAB-DOC_NAME.
    MOVE: w_hi-patient_name TO W_FTAB-PATIENT_NAME,
    w_hi-place TO W_FTAB-PLACE.
    APPEND W_FTAB TO T_FTAB.
    ENDLOOP.
    Please do a sy-subrc check after READ statement always...
    LOOP AT t_pi INTO w_pi.
    MOVE-CORRESPONDING: w_pi TO W_FTAB.
    READ TABLE t_hi INTO w_hi WITH KEY DOC_NAME = W_FTAB-DOC_NAME.
    If sy-subrc = 0.
    MOVE: w_hi-patient_name TO W_FTAB-PATIENT_NAME,
    w_hi-place TO W_FTAB-PLACE.
    clear w_hi.
    Endif.APPEND W_FTAB TO T_FTAB.
    ENDLOOP.
    Please revert back for clarifications.
    Best Regards,
    Suresh

Maybe you are looking for