"inner join" PLUS "into corresponding fields" in "for all entries"   ???

SAP provides the following example:
DATA: BEGIN OF wa,
        struc1 TYPE scarr,
        struc2 TYPE spfli,
      END OF wa.
DATA itab LIKE SORTED TABLE OF wa
          WITH UNIQUE KEY table_line.
SELECT *
       FROM scarr
         INNER JOIN spfli ON scarr~carrid = spfli~carrid
       INTO TABLE itab.
LOOP AT itab INTO wa.
  WRITE: / wa-struc1-carrid,
           wa-struc1-carrname,
           wa-struc2-connid.
ENDLOOP.
What should the syntax be if:
1) struc1 is your own type with just a few selected fields from scarr;
2) struc2 is your own type with just a few selected fields from spfli
3) you only want these fields in your SELECT (instead of the SELECT *).
Please provide answer only if you know your code works.
Thanks.
djh

Yes, aRs - thanks.
Someone in the shop here had an example that I coded from, and it's like yours:
REPORT  ZFOO.
TABLES:
  /sapapo/trprod,
  /sapapo/matkey.
TYPES:
  BEGIN OF tx_trprod_new,
    MATID                TYPE /SAPAPO/MATID,     
    matnr               TYPE /sapapo/matnr,
  END   OF tx_trprod_new.
DATA:
  it_trprod_new          TYPE STANDARD TABLE OF tx_trprod_new,
  v_num          TYPE i.
  SELECT /sapapo/trprod~matid
         /sapapo/matkey~matnr
    FROM /sapapo/trprod
         JOIN /sapapo/matkey ON /sapapo/trprod~matid = /sapapo/matkey~matid
    INTO
   TABLE it_trprod_new
   WHERE /sapapo/trprod~matid LIKE 'H%'.

Similar Messages

  • CAN USE SELECT OPTION FIELD IN FOR ALL ENTRIES CONCEPT

    Hi sir/ madam,
    can i write code like this .
    i have data in itab1 .
    select-options : s_matnr like lips-matnr.
    SELECT VBELN VGBEL VGPOS MATNR
        FROM LIPS
        INTO TABLE I_LIPS
        FOR ALL ENTRIES IN ITAB1
        WHERE VBELN = ITAB1-VBELN AND
              MATNR = S_MATNR.
    Thanks & Regards
    Suresh kumar

    Hi Suresh,
    To correct ur code syntactically, repacle the
    =
    operator with
    IN
    . This may be correct but from data consistency point of view this may not be the ideal thing to do.
    You can foolow thw following steps:
    1. Fetch data in ITAB1 using the MATNR in the select-option. I hope you do have
    MATNR in ITAB1.
    2.
    SELECT VBELN VGBEL VGPOS MATNR
    FROM LIPS
    INTO TABLE I_LIPS
    FOR ALL ENTRIES IN ITAB1
    WHERE VBELN = ITAB1-VBELN AND
    MATNR = ITAB1-MATNR.
    This should be correct form data consistency view-point.
    Hope this answers ur query. Please award points if u find the answer helpful.
    Regards,
    Suhas

  • Need to SUM on a  field  with FOR ALL ENTRIES

    Hi All,
       I  need  to  use  something like  this  appearing  below ....but  SUM  is  not  allowed  with  FOR ALL ENTRIES ......Whats   the  efficient  ALTERNATIVE ???
         SELECT  sum( menge )  INTO   TABLE  imseg
                                FROM   mseg
                                FOR ALL ENTRIES IN iresb
                                WHERE  matnr = iresb-matnr
                                  AND  bwart = '281'
                                  AND  aufpl = iresb-aufpl
                                  AND  aplzl = iresb-aplzl.
        Any  help  will  be  rewarded  &  appreciated ...
    Regards
    Jaman

    Hi Karthik,
         Thanx  a   ton....
          How  about   the  below   approach  .....its   allowed  &   working  fine ....also  simplifying  my  work..
              SELECT  matnr  menge  rsnum  rspos
                      INTO  (ws-matnr, ws-menge, ws-rsnum, ws-rspos)
                      FROM   mseg
                      FOR ALL ENTRIES IN iresb
                      WHERE  matnr = iresb-matnr
                        AND  bwart = mvtyp1
                        AND  rsnum = iresb-rsnum
                        AND  rspos = iresb-rspos.
                      imseg2-matnr =  ws-matnr.
                      imseg2-menge =  ws-menge.
                      imseg2-rsnum =  ws-rsnum.
                      imseg2-rspos =  ws-rspos.
                      COLLECT imseg2.
              ENDSELECT.

  • Joins to For All Entries

    Hi ABAP Folks,
    I am extracting a set a values from 5 different tables using FOR ALL statement and consolidating the results of each internal table to form a MASTER INTERNAL TABLE containing fields USERNAME ROLENAME ROLENAMETEXT TCODE TCODETEXT.
    BNAME UNAME->(USERNAME)
    AGR_NAME -> ROLES
    OBJECT,OBJCT->AUTHORISATION OBJ
    If the user input is a group name.
    Select BNAME CLASS From USR02 into LT_USR02 where CLASS IN S_USRGRP
    Select UNAME AGR_NAME into LT_AGR_USERS From AGR_USERS For All entries in LT_USR02 where UNAME = LT_USR02-BNAME
    Select AGR_NAME OBJECT into LT_AGR_1251 From AGR_1251 For All entries in LT_AGR_USERS where AGR_NAME = LT_AGR_USERS-AGR_NAME
    Select AGR_NAME TEXT into LT_AGR_TEXTS From AGR_TEXTS For All entries in LT_AGR_1251 where AGR_NAME = LT_AGR_1251-AGR_NAME
    Select OBJCT TCODE into LT_TSTCA From TSTCA For All entries in LT_AGR_1251 where OBJCT = LT_AGR_1251-OBJECT
    Select TCODE TEXTS into LT_TSTCT From TSTCT For All entries in LT_TSTCA where TCODE = LT_TSTCA-TCODE.
    Resultant ITAB IS User Name, User Group, User Group Texts, Transaction Codes, Transaction Code Text.
    <b>Is it better to go for a join in this case?Will joins be more efficient?Any help welcome and will be rewarded.</b>
    in case yes,Syntax for the above case will be helpful.
    Thanks in Advance.
    <b></b>

    Jayant,
    The joins are helpful when the two tables are related to each other basically VBAK and VBAP would be useful to join on document number but it is not advisable to join vbap and aufo on material number.
    In your case you can join the USER* related data and Transaction* related data via joins.
    Message was edited by: Anurag Bankley
    Message was edited by: Anurag Bankley

  • Better to have outer join or to have for all entries

    Hi Gurus
    I have one select query taking lot of time to retrieve data.
    My question is Is it better to have a outer join or should i go with For all entries.
      SELECT distinct sbukrs skunnr sumskz sgsber sbschl swaers
             sblart szfbdt sgjahr sbelnr sbuzei sbudat
             swrbtr sdmbtr sshkzg crzzrprctr
       APPENDING TABLE gt_data_a
       FROM bsad AS s
                      LEFT OUTER JOIN zcce1a as c  
                        ON  sbukrs = crbukrs               
                       AND  sgjahr = crefryear             
                       AND  sbelnr = cbelnr                
                       AND  sbuzei = cbuzei               
                       AND  sSHKZG = cDRCRK         
                       AND  c~REFDOCCT = 'W'            
                       AND  c~RLDNR = 'Z1'                   
                       AND  c~RVERS = '001'                 
      WHERE
             s~bukrs IN s_bukrs
         AND s~kunnr IN s_kunnr
         AND s~umsks IN s_umsks
         AND s~umskz IN s_umskz
         AND s~augdt IN s_augdt
         AND s~augbl IN s_augbl
         AND s~zuonr IN s_zuonr
         AND s~gjahr IN s_gjahr1
         AND s~belnr IN s_belnr
         AND ( sbudat IN s_budat1 AND sbudat LE p_stida ) 
         AND s~augdt GT p_stida
         AND s~bldat IN s_bldat1
         AND s~cpudt IN s_cpudt
         AND s~waers IN s_waers1
         AND s~xblnr IN s_xblnr
         AND s~blart IN s_blart
         AND s~monat IN s_monat
         AND s~bschl IN s_bschl
         AND s~shkzg IN s_shkzg
         AND s~gsber IN s_gsber
         AND s~mwskz IN s_mwskz
         AND s~dmbtr IN s_dmbtr
         AND s~wrbtr IN s_wrbtr
         AND s~hkont IN s_hkont
         AND s~filkd IN s_filkd
         AND s~zlsch IN s_zlsch
         AND s~zlspr IN s_zlspr
         AND s~mansp IN s_mansp
         AND s~mschl IN s_mschl
         AND s~madat IN s_madat
         AND s~manst IN s_manst
         AND s~maber IN s_maber
         AND s~rstgr IN s_rstgr
         AND s~projk IN s_projk
         AND s~xref1 IN s_xref1
         AND s~xref2 IN s_xref2
         AND s~imkey IN s_imkey
         AND s~fistl IN s_fistl
         AND s~dabrz IN s_dabrz
         AND s~kostl IN s_kostl
         AND s~cession_kz IN s_cessio.
    Moderator message - Please see Please Read before Posting in the Performance and Tuning Forum before posting - post locked
    Edited by: Rob Burbank on Sep 15, 2009 9:52 AM

    Hi  Sandeep Sharma,
    Table BSAD is having below primary key fields...
    BUKRS
    KUNNR
    UMSKS
    UMSKZ
    AUGDT
    AUGBL
    ZUONR
    GJAHR
    BELNR
    BUZEI
    Now the Question is In your selection screen what and all fields you kept mandatory ??
    Try to make some of these above fileds as mandatory which may fit one of the index of BSAD table...
    Different Available Indexes on BSAD is as below...
    Index for logical database
    MANDT
    KUNNR
    BUKRS
    AUGDT
    AUGBL
    GJAHR
    BELNR
    BUZEI
    Index using settlement run (payment cards)
    MANDT
    BUKRS
    CCBTC
    Index for Invoice Reference
    MANDT
    BUKRS
    REBZG
    REBZJ
    REBZZ
    KUNNR
    UMSKS
    REBZT
    Index for Line Item Access
    MANDT
    BUKRS
    BELNR
    GJAHR
    BUZEI
    Index for BW Extract
    MANDT
    BUKRS
    CPUDT
    Also code in both the way... and check the time of execution for the queries...  Actually it(Performance) depends on data as well as selection criteria...
    Hope it will solve your problem..
    Thanks & Regards
    ilesh 24x7
    ilesh Nandaniya

  • For all entries changes the order of the itab

    Hi Experts
                 In the following query i have used two internal tables namely it_first and it_zlist.
                The material inwhich the it_zlist is different sorting order
          After executing this query, the order of the material inwhich the it_first is different from the it_zlist.
                 What could be the reason, pls explain me on this.
    select matnr test zsno ztnam from zmaster1
                into corresponding fields of table it_first
                      for all entries in it_zlist
                      where matnr = it_zlist-matnr.
    Thanks in advance.
    Regards
    Rajaram

    for all entries u should specified all primary key.
    sort by u condition.
    Effect
    If the addition FOR ALL ENTRIES is specified before the language element WHERE, then the components comp of the internal table itab can be used as operands when comparing with relational operators.
    The internal table itab must have a structured line type and the component comp must be compatible with the column col.
    The logical expression sql_cond of the WHERE condition can comprise various logical expressions by using AND and OR. However, if FOR ALL ENTRIES is specified, there must be at least one Comparison with a column of the internal table itab, which can be specified either statistically or dynamically (Release 6.40 and higher). In a statement with a SELECTstatement with FOR ALL ENTRIES, the addition ORDER BY can only be used with the addition PRIMARY KEY.
    The whole logical expression sql_cond is evaluated for each individual line of the internal table itab. The resulting set of the SELECT statement is the union of the resulting sets from the individual evaluations. Duplicate lines are automatically removed from the resulting set. If the internal table itab is empty, the whole WHERE statement is ignored and all lines in the database are put in the resulting set.
    Notes
    In Release 6.10 and higher, the same internal table can be specified after FOR ALL ENTRIES and after INTO.
    The addition FOR ALL ENTRIES is only possible before WHERE conditions of the SELECT statement.
    If the additions PACKAGE SIZE or UP TO n ROWS are specified together with FOR ALL ENTRIES, they are not passed to the database system but are applied instead to the resulting set once all selected rows on the application server have been imported.
    With duplicated rows in the resulting set, the addition FOR ALL ENTRIES has the same effect as if addition DISTINCT were specified in the definition of the selection quantity. Unlike DISTINCT, the rows are not deleted from the database system but are deleted on the application server from the resulting set.
    Addition FOR ALL ENTRIES is only possible for WHERE conditions of the SELECT statement.
    Example
    Exporting all flight data for a specified departure city. The relevant airlines and flight numbers are first put in an internal table entry_tab, which is evaluated in the WHERE condition of the subsquent SELECT statement.

  • Driver table in select for all entries

    anyone please let me what is driver table in select for all entries and when do we go for select for all entries

    Here is something from help
    FOR ALL ENTRIES WHERE
    Syntax
    ... FOR ALL ENTRIES IN itab WHERE ... col operator itab-comp ...
    Effect
    If the addition FOR ALL ENTRIES is specified before the language element WHERE, then the components comp of the internal table itab can be used as operands when comparing with relational operators.
    The internal table itab must have a structured line type and the component comp must be compatible with the column col.
    The logical expression sql_cond of the WHERE condition can comprise various logical expressions by using AND and OR. However, if FOR ALL ENTRIES is specified, there must be at least one Comparison with a column of the internal table itab, which can be specified either statistically or dynamically (Release 6.40 and higher). In a statement with a SELECTstatement with FOR ALL ENTRIES, the addition ORDER BY can only be used with the addition PRIMARY KEY.
    The whole logical expression sql_cond is evaluated for each individual line of the internal table itab. The resulting set of the SELECT statement is the union of the resulting sets from the individual evaluations. Duplicate lines are automatically removed from the resulting set. If the internal table itab is empty, the whole WHERE statement is ignored and all lines in the database are put in the resulting set.
    Notes
    In Release 6.10 and higher, the same internal table can be specified after FOR ALL ENTRIES and after INTO.
    The addition FOR ALL ENTRIES is only possible before WHERE conditions of the SELECT statement.
    Example
    Exporting all flight data for a specified departure city. The relevant airlines and flight numbers are first put in an internal table entry_tab, which is evaluated in the WHERE condition of the subsquent SELECT statement.
    PARAMETERS p_city TYPE spfli-cityfrom.
    TYPES: BEGIN OF entry_tab_type,
             carrid TYPE spfli-carrid,
             connid TYPE spfli-connid,
           END OF entry_tab_type.
    DATA: entry_tab   TYPE TABLE OF entry_tab_type,
          sflight_tab TYPE SORTED TABLE OF sflight
                           WITH UNIQUE KEY carrid connid fldate.
    SELECT carrid connid
           FROM spfli
           INTO CORRESPONDING FIELDS OF TABLE entry_tab
           WHERE cityfrom = p_city.
    SELECT carrid connid fldate
           FROM sflight
           INTO CORRESPONDING FIELDS OF TABLE sflight_tab
           FOR ALL ENTRIES IN entry_tab
           WHERE carrid = entry_tab-carrid AND
                 connid = entry_tab-connid.
    Regards,
    Santosh

  • Alternative for / Problems with: "For all entries in data_package"

    Hi Guys
    I doing some ABAP in a Start Rotine in BW and would like to do the following:
      select * from /BI0/PMATERIAL into table 0mat
      for all entries in DATA_PACKAGE
      where material = DATA_PACKAGE-/bic/zmaterial.
    But I get the following error:
    E:When using the addition "FOR ALL ENTRIES IN itab", the fields "MATERIAL" and "DATA_PACKAGE-/BIC/ZMATERIAL" must have the same type and length. and length.
    ZMATERIAL:
    - Length: 28
    - Type: CHAR - Character String
    ZMATERIAL:
    - Length: 18
    - Type: CHAR - Character String
    According to the error message "For all entries" cannot be used in this case since the lengths are not identical, but is there an alternative way to do what I would like to do?
    Thanks in advance, kind regards,
    Torben

    Hi
    one thing you can try like this define one variable in other itab of same type
    then loop at the first table and assign it to new field and modify the itab
    then use this field with for all entries
    Regards
    Shiva

  • FOR ALL ENTRIES IN is needed or not needed ?

    I have below SELECT stmt in my progam ( actually, I have copied one BW program into R/3 system and created similar tables in R/3 as well ).
        SELECT *
          INTO TABLE t_codei
          FROM ZBIC_CODEI_OHB              " /bic/pcodei_ohb
           FOR ALL ENTRIES IN it_requid
         WHERE gnfldnm   = 'AUDIT_FILE'
           AND destinatn = it_requid-tgt
           AND objvers   = 'A'.
    However in my R/3 program, I had to have comment it_requid internal table which was used in the above SELECT stmt.
    So, if I use selection-screen PARAMETER instead it_requid-tgt, then I am getting syntax error as "WHERE condition does not refer to the FOR ALL ENTRIES table". 
    So what can I do ? Can I Remove "FOR ALL ENTRIES IN it_requid" in the below stmt (how it effects performance)?  Or Build it_requid internal table with p_path value ?
    Or is there any optimal solution ?
        SELECT *
          INTO TABLE t_codei
          FROM ZBIC_CODEI_OHB              " /bic/pcodei_ohb
           FOR ALL ENTRIES IN it_requid
         WHERE gnfldnm   = 'AUDIT_FILE'
           AND destinatn = p_path      " it_requid-tgt
           AND objvers   = 'A'.
    Thanks in advance for your help.

    Hi,
    When you use * For all entries in * , You must inclue at least one fields in where condition.
    but when you used the parameter and not using any fields of for all entries table fields it will give error, so must be include at least one fields in where condition.
    You can include both in following way
    SELECT *
    INTO TABLE t_codei
    FROM ZBIC_CODEI_OHB " /bic/pcodei_ohb
    FOR ALL ENTRIES IN it_requid
    WHERE gnfldnm = 'AUDIT_FILE'
    AND ( destinatn =  it_requid-tgt or destinatn = p_path )
    AND objvers = 'A'.
    Rgds
    Ravi Lanjewar

  • FOR ALL ENTRIES IN with two tables

    Hi Guy's,
    I have two int. tables, gt_likp, gt_lips.
    I need to use "FOR ALL ENTRIES IN" with this two tables.
      SELECT matnr
             vkorg
             vtweg
             ypcogsl
        FROM mvke
        INTO TABLE gt_mvke
    <b>    "FOR ALL ENTRIES IN gt_likp gt_lips"</b>
        WHERE matnr = gwa_liefpos_tab-matnr
        AND vkorg = gt_likp-vkorg
        AND vtweg = gt_lips-vtweg.
    How to do this?
    Please Help.
    Thanks in Advance.

    Hi,
    Fill gt_likp-vkorg values in a range(r_vkorg). Use gt_lips in FOR ALL ENTRIES.
    Basically you can use only 1 internal table with FOR ALL ENTRIES statement.
    SELECT matnr
    vkorg
    vtweg
    ypcogsl
    FROM mvke
    INTO TABLE gt_mvke
    FOR ALL ENTRIES IN gt_lips
    WHERE matnr = gwa_liefpos_tab-matnr
    AND       vkorg in r_vkorg
    AND       vtweg = gt_lips-vtweg.
    - SRao

  • Usage of FOR ALL ENTRIES in SELECT query

    Hi All,
    While writing SELECT query using FOR ALL ENTRIES, in the WHERE condition can we use IN operator on a range table?
    Will this work out.
    Thanks,
    Anil Kumar

    HI,
    Yes you can use the in operator.
    SELECT *
      FROM MARC
      INTO TAB:E i_mARC
        FOR ALL ENTRIES IN I_MARA
      WHERE MATNR EQ I_MARA_MATNR
        AND WERKS IN S_WERKS.

  • What is the machanism for FOR ALL ENTRIES

    HI Eperts,
    Can you please explane how FOR ALL ENTRIES will work.how many times it will visit database .
    For example:I want to get sales item information.and i have 5 header records in internal table H_ITAB.for every header record there are 2 items avalible in database.so  item table I_ITAB will get 10 records.
    how many times Query will visit database when we are using FOR ALL ENTRIES
    Regards,
    Anwar Ali Shaik

    there is a small but mighty difference:
    Select-endselect is alternative for select into table.
    Select for all entries is something else.
    For select-endselect the cursor will open to read/write not every record.
    Records are fetched in a certain block size of about 32K bytes and then looped over.
    That means that especially with small tables there is no difference between select...endselect and select into table.
    It may be more effective even for big selects because it reduces network load because not so many data are fetched from the database in one chunk.
    Regards,
    Clemens

  • What does "into corresponding field" addition used for?

    What does "into corresponding field" addition used for?. I have seen them in open sql statements. Please explain?

    before knowing this you have to know how u write select in ABAP....
    think you have a str./internal table itab with this strucutre:
    data: begin of itab occurs 0,
             vbeln like vbak-vbeln,
             posnr like vbap-posnr,
             netwrt like vbap-netwrt,
           end of itab.
    u have to follow the same order in the select statement...
    select vbeln posnr netwrt
    from vbap
    into table itab
    where......
    Think that u had some concern and coudnt write a select in same order then u write it like this...
    Performance wise its very bad...so ppl generally try to eliminate it..
    select  netwrt posnr vbeln 
    from vbap
    into corresponding field of table itab
    where......
    Award points if helpful

  • Inner join with for-all entries

    Why is the below inner join-for all entries does not result in expected output ?
    REPORT  ZTST3                                   .
    tables : ztst1,ztst2 .
    * table ztst1 has 4 fields : mandt,ebeln,ebelp,etenr,char4. ; ztst2 has
    * 3 fields : mandt,ebeln,ebelp,matnr
    *Entries in ztst1
    * EBELN       EBELP   ETERN  CHAR4
    * 5000000000  00010    0001    abc
    * 5000000000  00010    0002    cbd
    * 5000000000  00010    0003    efg
    *Entries in ztst2
    * EBELN       EBELP   matnr
    * 5000000000  00010    matabc
    *expected itab after inner join
    * EBELN       EBELP   CHAR4  MAtnr
    * 5000000000  00010   abc    matabc
    * 5000000000  00010   cbd    matabc
    * 5000000000  00010   efg    matabc
    data : begin of itab1 occurs 0,
           ebeln type ebeln,
           ebelp type ebelp,
           end of itab1.
    data : begin of itab occurs 0,
           ebeln type ebeln,
           ebelp type ebelp,
           char4 type char4,
           matnr type matnr,
           end of itab.
    start-of-selection.
    itab1-ebeln = '5000000000'.
    itab1-ebelp = '00010'.
    append itab1.
    select ztst1~ebeln
           ztst1~ebelp
           ztst1~char4
           ztst2~matnr into corresponding fields of table itab
    from ztst1 inner join ztst2
    on ztst1~ebeln = ztst2~ebeln and
       ztst1~ebeln = ztst2~ebelp
    for all entries in itab1
    where
    ztst1~ebeln eq itab1-ebeln and
    ztst1~ebelp eq itab1-ebelp .
    * why does it return no entries;
    break-point.

    For example in the bellow case
    *Entries in ztst1
    EBELN       EBELP   ETERN  CHAR4
    5000000000  00010    0001    abc
    5000000000  00010    0002    cbd
    5000000000  00010    0003    efg
    5000000002  00020    0003    efg
    5000000002  00020    0003    efg
    *Entries in ztst2
    EBELN       EBELP   matnr
    5000000000  00010    matabc
    5000000002  00020    abc
    may it will return you 2 records yes, than I think you have under stand the working of u201Cfor all entriesu201D ?
    And the following case I think it will work fine.
    *Entries in ztst1
    key  EBELN       EBELP   ETERN  CHAR4
    1       5000000000  00010    0001    abc
    2       5000000000  00010    0002    cbd
    3       5000000000  00010    0003    efg
    4       5000000002  00020    0003    efg
    5       5000000002  00020    0003    efg
    *Entries in ztst2
    EBELN       EBELP   matnr
    5000000000  00010    matabc
    5000000002  00020    abc
    select  ztst1~key
    ztst1~ebeln
           ztst1~ebelp
           ztst1~char4
           ztst2~matnr into corresponding fields of table itab
    from ztst1 inner join ztst2
    on ztst1~ebeln = ztst2~ebeln and
       ztst1~ebelp = ztst2~ebelp
    for all entries in itab1
    where
    ztst1~ebeln eq itab1-ebeln and
    ztst1~ebelp eq itab1-ebelp .
    Sorry, I donu2019t have system with me right now and I am sending you with out testing but I am sure that it is working the same way.
    Please Reply if any problem
    Kind Regards,
    Faisal

  • Can anyone give me an example of for all entries in case of inner join

    Hi abapers,
    I am trying to replace an inner join with for all entries.
    So kindly give me a demo code so that i can understand the use and apply it.
    And plz tell me in which case it is better to use for all entries and in which case to use inner join so that better performance will occur.
    With Regards
    Ansuman

    Hello Ansuman,
    For example:
    DATA:
      BEGIN OF fs_eket,
        ebeln LIKE ekko-ebeln,             " Purchasing Document Number
        ebelp LIKE ekpo-ebelp,             " Item Number of Purchasing Doc
      END OF fs_eket.                      " fs_eket
    DATA:
      t_eket LIKE                          " Purchase table
    STANDARD TABLE
          OF fs_eket.
    Using joins:
    select ebeln ebelp
    into corresponding fields of table t_eket
    from ekko join ekpo
    on ekkoebeln eq ekpoebeln
    where ebeln in s_sbeln.
    The select statement can be replaced by
    SELECT ebeln
      FROM ekko
      INTO CORRESPONDING FIELDS OF TABLE t_eket
    WHERE ebeln IN s_ebeln.
    IF sy-subrc EQ 0.
      sort t_eket by ebeln.
      SELECT ebeln
             ebelp
        FROM ekpo
        INTO CORRESPONDING FIELDS OF TABLE t_eket
         FOR ALL ENTRIES IN t_eket
       WHERE ebeln EQ t_eket-ebeln.
    The duplicate entries are removed by using FOR ALL ENTRIES. Or else by using the join, you have teh sort the table by key fields and then delete adjacent duplicates.
    Hope it helps you
    Regards
    Indu

Maybe you are looking for

  • Possible Bug?  autotype + wsdl2service generates implementation that does not conform to the WSDL

    Hey folks, I've got some hand crafted, valid, WS-I compliant WSDL + imported XSD that I've been using for awhile now to generate an Apache Axis 1.2 beta Document Literal Web Service implementation. I'm now trying to use the same WSDL to generate a BE

  • HT4906 Iphoto nor Aperture are visible in my mac

    I cannot find iphoto nor aperture on my mac when im sure it was in my doc recently. once i click setting and then click on icloud i see iphoto is there but it doesnt have a check on it like the rest theres a button that says 'learn more' ive lready u

  • How to generate complex reports with JHeadStart?

    I have data from a DataSourceSet process in the infoTable (I use BC4J 9.0.3.10.7, JHeadStart 9.0.3.58, Oracle MVC R.Candidate 2.0, UIX 2.1.9).I need to generate a report with this data in a UIX Table. Actually, I show the data as retrieved from the V

  • AA3 can't read BWF from Reaper -Looks like a bug to me

    wav files made in Reaper (ver 3.11) can have the bext BWF timestamp. These files read just fine in AA (v1.5, ), Sound devices Wave Agent, Widget Pro, SSL ProConvert, Nuendo, Samplitude & Reaper itself. AA3 sees them as being BWF files & there is some

  • How can I drag a widget out onto my desktop

    I used to be able to hold down  a function key and it would allow me to drop a widget onto my desktop as so I could use it anytime. Does anyone know what I'm talking about? If so, do you know what keys I press while I drag the widget out from the app