Assign a 'Linked Selection' state to a Sequence?

I have two Sequences in a Project. In one of the Sequences I am chopping out bits of both Video and Audio but in the other I want to only chop out bits of Video and leave the Audio alone. Currently I'm having to click on 'Linked Selection' as I switch between the Sequences. Is there a way of assigning a particular state of the 'Linked Selection' with a specific Sequence?
Thanks in advance.

The Linked Sekection button is for the window not the sequence. You could select the clips in the sequence you don't want linked selection and use Cmd-L to unlink video and audio.

Similar Messages

  • Select statement Table Join sequence (Performance)

    Hi,
    I have 3 tables Header (Hdr), Item (Itm) and Schedule Line (Sdl) table. The number of entries is max in Sdl table (Eg: Hdr = 1000; Item = 20000 and Sdl = 200000 records). I need to join these 3 tables in my SELECT statement to fetch the required records.
    Case A:
    Header AS HDR
    JOIN Item AS ITM
    ON HDRORDID = ITMORDID
    AND HDRVRSIOID = ITMVRSIOID
    JOIN ScheduleLine AS SDL
    ON ITMITMID = SDLITMID
    Case B:
    ScheduleLine AS SDL
    JOIN Item AS ITM
    ON ITMITMID = SDLITMID
    JOIN Header AS HDR
    ON HDRORDID = ITMORDID
    AND HDRVRSIOID = ITMVRSIOID
    Questions:
    1) The performance of the Select query is really bad with Case A and very good (really fast) with Case B. Will the number of records in the tables used determine the sequence of join in the Select statement ?
    2) If yes, is this independent of database used ? That is, will the behaviour be the same in all databases (Eg: Oracle, DB2, SQL Server, etc) ?
    Appreciate your help.
    Thanks,
    Karthik

    I believe that the performance discrepancy between the two versions is caused by you not specifying the joins correctly (i.e. not qualifying the header and item at schedule level as I mentioned previously).
    CAse A.
    Header AS HDR
    JOIN Item AS ITM
    ON HDRORDID = ITMORDID
    AND HDRVRSIOID = ITMVRSIOID
    JOIN ScheduleLine AS SDL
    ON ITMITMID = SDLITMID
    reads all 1000 hDRs, joins all 20000 items correctly to these BUT then joins schedule lines only by item id so there will be a very large number of matches. i.e. any item with itemid 10 will match to EVERY SDL with itemid 10. as there are 20000 items and 200000 schedule lines this will be massive!
    Case B:
    ScheduleLine AS SDL
    JOIN Item AS ITM
    ON ITMITMID = SDLITMID
    JOIN Header AS HDR
    ON HDRORDID = ITMORDID
    AND HDRVRSIOID = ITMVRSIOID
    This will not have the same amount of DB traffic as the SDL is now the driving force. It will still match more than you intend but will only be reading the items redundantly trather than the more voluminous schedules.
    Basically, your sql is wrong and should qualify the matches right down to schedule line level as per my earlier post. When you have changed the sql, try the two alternatives again and see if there is any performance differences. I suspect that there will not be, but it will be interesting to find out for sure.

  • Sequence error in select statement

    Does anyone know why I get the following error when I run the code below. If so, how can it be fixed.
    Thanks in advance,
    John C
    ORA-02287 sequence number not allowed here
    INSERT INTO PROMO_STAGE.NAC_OFFER (CMPGN_KEY, OFFER_KEY, CREATIVE)
    SELECT DISTINCT A.CREATIVE,
    B.CMPGN_KEY,
    PROMO_STAGE.SEQ_NAC_OFFER_KEY.NEXTVAL@DSTAGE
    FROM PROMO_STAGE.CAMPAIGN@DSTAGE B,
    ROCEONOF.NACQ0211_2_FINAL@OGD A
    WHERE B.CMPGN_ID = 'NAC_'|| to_char(add_months(SYSDATE,-1),'YYYYMM');

    John
    It is the DISTINCT which is causing the trouble. How about:
    INSERT INTO PROMO_STAGE.NAC_OFFER (CMPGN_KEY, OFFER_KEY, CREATIVE)
    SELECT COL1, COL2, PROMO_STAGE.SEQ_NAC_OFFER_KEY.NEXTVAL@DSTAGE
    FROM
    (SELECT DISTINCT A.CREATIVE COL1, B.CMPGN_KEY COL2
    FROM PROMO_STAGE.CAMPAIGN@DSTAGE B,
    ROCEONOF.NACQ0211_2_FINAL@OGD A
    WHERE B.CMPGN_ID = 'NAC_'|| to_char(add_months(SYSDATE,-1),'YYYYMM'));
    Incidentally, judging by the column names, it appears that the columns in your insert statement are not listed in the same order as in the select statement, which of course they should be.

  • Fields sequence in the select statement

    experts, help needed
    itab has following fields,
    vbeln posnr erdat erzet vkorg vtweg
    kunnr posnr matnr bmeng status.
    i have written like this
    SELECT avbeln aerdat aerzet avkorg a~vtweg
    akunnr bposnr b~matnr
    FROM vbak AS a INNER JOIN vbap AS b
    ON avbeln = bvbeln
    INTO TABLE itab1
    FOR ALL ENTRIES IN itab
    WHERE a~vbeln = itab-vbeln.
    endif.
    but my internal table fields sequence are different. so i changed the posnr field in the select query to the second place.
    SELECT avbeln  bposnr  aerdat aerzet avkorg avtweg
    akunnr bmatnr
    FROM vbak AS a INNER JOIN vbap AS b
    ON avbeln = bvbeln
    INTO TABLE itab1
    FOR ALL ENTRIES IN itab
    WHERE a~vbeln = itab-vbeln.
    endif.
    so in above two select statements which one is right , according to coding standards,?
    in this case do i need to use the into corresponding fields addition because i am not selecting bmeng , status fields into the itab?

    Hi,
    Of the two select statements,
    SELECT a~vbeln b~posnr a~erdat a~erzet a~vkorg a~vtweg
    a~kunnr b~matnr
    FROM vbak AS a INNER JOIN vbap AS b
    ON a~vbeln = b~vbeln
    INTO TABLE itab1
    FOR ALL ENTRIES IN itab
    WHERE a~vbeln = itab-vbeln.
    is the better one. I,e specifyiig the field sequence exactly as you have in the internal table. Even according to standards, this is better.
    If you are chaning the sequence of select fields, then you have to use the INTO CORRESPONDING FILEDS OF TABLE addition, so that the system itself finds the relevant order of fields and fill them automatically.
    This is a additional work which has to be performed by the compiler.
    Thus its better to use INTO CORRESPONDING FILEDS OF TABLE only when you are using select * , or when you are not sure of the field sequence inthe table.
    Regards,
    Vik

  • Dynamically assigning table name in select statement

    how can i assign the table name dynamically in Select statement?
    i tried following code
    create or replace procedure proc1
    as
    x varchar2(100);
    y varchar2(10);
    begin
    x='UNIT_MASTER';
    execute immediate 'select unit_code into y from x where
    rownum=1';
    dbms_output.put_line(y);
    end;
    the procedure is created but when i execute the procedure the
    error is shown in the execute immediate statement

    Do the following :
    Create or replace procedure pro1 as
    x varchar2(100);
    y varchar2(10);
    begin
    x := 'UNIT_MASTER';
    EXECUTE IMMEDIATE 'select unit_code from '||x||' where rownum
    = 1' INTO y;
    dbms_output.put_line(y);

  • Tuning Select Statement . field sequence and where clause

    Hi All
    Are there any general guidelines how to write select < field sequence >where clause < field sequence ? Is that shuld be in order of the field sequence in tables?
    And how to use this when we have a view or a inner - join . Is that separate from normal select statement that is using FOR ALL ENTRIES.
    Please let me know any general guidelines available on this,
    Amol

    Hello Amol,
    I have another hint:
    The statement FOR ALL ENTRIES will package the select statements for every five entries in the internal table. So in comparison to the following code sequence...
    LOOP AT itab.
       SELECT * FROM table WHERE key = itab-key.
    ENDLOOP
    the number of select statements is reduced to 20% with
    SELECT * FROM table INTO TABLE ...
         FOR ALL ENTRIES IN itab
         WHERE key = itab-key
    If I'm expecting a <i>huge</i>  amount of data a go a step further and create my own packages by building a range table with around 100-500 entries and execute a select there...
    LOOP AT itab.
       IF counter < 500.
          APPEND itab-key TO range-tab.   " just code example
       ENDIF.
       IF count >= 500.
          SELECT * FROM table APPENDING TABLE ...
             WHERE key IN range_tab
       ENDIF.
       " adjust and calculate counter
    ENDLOOP.
    * Don't forget last select statement after loop
    Best wishes,
    Florin

  • How to : rownum and order by in select statement

    Say I have a select statement with additional 'order by' clause.
    The result set I want prepended by the rownum column.
    But, and here comes the flaw, I want the rownum for the already ordered result set
    not the unordered.
    An example:
    select firstname, lastname from myTable order by lastname;
    When I add the rownum to the select clause,
    'select rownum, firstname, lastname from myTable order by lastname;'
    I might get something like:
    20 Mike Adams
    13 Nina Bravo
    1 Tom Charlie
    But I want the following result:
    1 Mike Adams
    2 Nina Bravo
    3 Tom Charlie
    I could now
    'Select rownum, lastname, firstname from (select firstname, lastname from myTable order by lastname);
    But I guess there is a better way!?!
    which is the best way to accomplish that?
    Thanks for your advice!

    >
    'Select rownum, lastname, firstname from (select firstname, lastname from myTable order by lastname)
    >
    Well if you ask me there is very little difference between this query and the above query
    select rownum, lastname, firstname from mytable;Because rownum is assigned before the order by. The difference is in your query you are assigning a rownum to an ordered resultset but still there is no guarantee oracle is going to read the data in an ordered fashion. In the second query rownum is assigned to an unordered resultset. Again it is the samething. So if you want to guarantee it then I will go for the following option
    select row_number() over(order by lastname) rn, lastname, firstname from mytable
    order by lastnameAlso check this link.
    http://www.oracle.com/technology/oramag/oracle/07-jan/o17asktom.html
    Regards
    Raj
    Edited by: R.Subramanian on Jan 13, 2009 6:20 AM

  • SELECT statement (urgent!)

    Could you please help me with the following statement?
    The FROM clause is incorrect but i don't know what i should write.
    Thank you in advance.
    Maria.
    DECLARE
    A NUMBER;
    CURSOR C1 IS
    SELECT TABLE_NAME, COLUMN_NAME
    FROM USER_TAB_COLUMNS
    WHERE NULLABLE='N' AND TABLE_NAME LIKE 'P_%';
    BEGIN
    FOR i IN C1
    LOOP
    SELECT COUNT(*) INTO A
    FROM i.TABLE_NAME
    WHERE i.COLUMN_NAME IS NOT NULL;
    END LOOP;
    END;
    /

    FOR-LOOP
    Whereas the number of iterations through a WHILE loop is unknown until the loop completes, the number of iterations through a FOR loop is known before the loop is entered. FOR loops iterate over a specified range of integers. The range is part of an iteration scheme, which is enclosed by the keywords FOR and LOOP. A double dot (..) serves as the range operator. The syntax follows:
    FOR counter IN [REVERSE] lower_bound..higher_bound LOOP
    sequence_of_statements
    END LOOP;
    The range is evaluated when the FOR loop is first entered and is never re-evaluated.
    As the next example shows, the sequence of statements is executed once for each integer in the range. After each iteration, the loop counter is incremented.
    FOR i IN 1..3 LOOP -- assign the values 1,2,3 to i
    sequence_of_statements -- executes three times
    END LOOP;
    The following example shows that if the lower bound equals the higher bound, the sequence of statements is executed once:
    FOR i IN 3..3 LOOP -- assign the value 3 to i
    sequence_of_statements -- executes one time
    END LOOP;
    By default, iteration proceeds upward from the lower bound to the higher bound. However, as the example below shows, if you use the keyword REVERSE, iteration proceeds downward from the higher bound to the lower bound. After each iteration, the loop counter is decremented. Nevertheless, you write the range bounds in ascending (not descending) order.
    FOR i IN REVERSE 1..3 LOOP -- assign the values 3,2,1 to i
    sequence_of_statements -- executes three times
    END LOOP;
    Inside a FOR loop, the loop counter can be referenced like a constant but cannot be assigned values, as the following example shows:
    FOR ctr IN 1..10 LOOP
    IF NOT finished THEN
    INSERT INTO ... VALUES (ctr, ...); -- legal
    factor := ctr * 2; -- legal
    ELSE
    ctr := 10; -- not allowed
    END IF;
    END LOOP;
    Iteration Schemes
    The bounds of a loop range can be literals, variables, or expressions but must evaluate to numbers. Otherwise, PL/SQL raises the predefined exception VALUE_ERROR. The lower bound need not be 1, as the examples below show. However, the loop counter increment (or decrement) must be 1.
    j IN -5..5
    k IN REVERSE first..last
    step IN 0..TRUNC(high/low) * 2
    Internally, PL/SQL assigns the values of the bounds to temporary PLS_INTEGER variables, and, if necessary, rounds the values to the nearest integer. The magnitude range of a PLS_INTEGER is -2**31 .. 2**31. So, if a bound evaluates to a number outside that range, you get a numeric overflow error when PL/SQL attempts the assignment, as the following example shows:
    DECLARE
    hi NUMBER := 2**32;
    BEGIN
    FOR j IN 1..hi LOOP -- causes a 'numeric overflow' error
    END LOOP;
    END;
    Some languages provide a STEP clause, which lets you specify a different increment (5 instead of 1 for example). PL/SQL has no such structure, but you can easily build one. Inside the FOR loop, simply multiply each reference to the loop counter by the new increment. In the following example, you assign today's date to elements 5, 10, and 15 of an index-by table:
    DECLARE
    TYPE DateList IS TABLE OF DATE INDEX BY BINARY_INTEGER;
    dates DateList;
    k CONSTANT INTEGER := 5; -- set new increment
    BEGIN
    FOR j IN 1..3 LOOP
    dates(j*k) := SYSDATE; -- multiply loop counter by increment
    END LOOP;
    END;
    Dynamic Ranges
    PL/SQL lets you determine the loop range dynamically at run time, as the following example shows:
    SELECT COUNT(empno) INTO emp_count FROM emp;
    FOR i IN 1..emp_count LOOP
    END LOOP;
    The value of emp_count is unknown at compile time; the SELECT statement returns the value at run time.
    What happens if the lower bound of a loop range evaluates to a larger integer than the upper bound? As the next example shows, the sequence of statements within the loop is not executed and control passes to the next statement:
    -- limit becomes 1
    FOR i IN 2..limit LOOP
    sequence_of_statements -- executes zero times
    END LOOP;
    -- control passes here
    Scope Rules
    The loop counter is defined only within the loop. You cannot reference it outside the loop. After the loop is exited, the loop counter is undefined, as the following example shows:
    FOR ctr IN 1..10 LOOP
    END LOOP;
    sum := ctr - 1; -- not allowed
    You need not explicitly declare the loop counter because it is implicitly declared as a local variable of type INTEGER. The next example shows that the local declaration hides any global declaration:
    DECLARE
    ctr INTEGER;
    BEGIN
    FOR ctr IN 1..25 LOOP
    IF ctr > 10 THEN ... -- refers to loop counter
    END LOOP;
    END;
    To reference the global variable in this example, you must use a label and dot notation, as follows:
    <<main>>
    DECLARE
    ctr INTEGER;
    BEGIN
    FOR ctr IN 1..25 LOOP
    IF main.ctr > 10 THEN -- refers to global variable
    END IF;
    END LOOP;
    END main;
    The same scope rules apply to nested FOR loops. Consider the example below. Both loop counters have the same name. So, to reference the outer loop counter from the inner loop, you must use a label and dot notation, as follows:
    <<outer>>
    FOR step IN 1..25 LOOP
    FOR step IN 1..10 LOOP
    IF outer.step > 15 THEN ...
    END LOOP;
    END LOOP outer;
    Using the EXIT Statement
    The EXIT statement lets a FOR loop complete prematurely. For example, the following loop normally executes ten times, but as soon as the FETCH statement fails to return a row, the loop completes no matter how many times it has executed:
    FOR j IN 1..10 LOOP
    FETCH c1 INTO emp_rec;
    EXIT WHEN c1%NOTFOUND;
    END LOOP;
    Suppose you must exit from a nested FOR loop prematurely. You can complete not only the current loop, but any enclosing loop. Simply label the enclosing loop that you want to complete. Then, use the label in an EXIT statement to specify which FOR loop to exit, as follows:
    <<outer>>
    FOR i IN 1..5 LOOP
    FOR j IN 1..10 LOOP
    FETCH c1 INTO emp_rec;
    EXIT outer WHEN c1%NOTFOUND; -- exit both FOR loops
    END LOOP;
    END LOOP outer;
    -- control passes here
    Joel P�rez

  • Why would this select statement give an error?

    *LOOKUP Z_HELPER
    *DIM TGT1 : ACCOUNT="AA_1070100"
    *DIM CATEGORY="ACTUAL"
    *DIM TIME="2011.JAN"
    *ENDLOOKUP
    *SELECT(%TGTDEST2%, "[ID]", TARGETDESTINATION, "[UNIQUEIDENTIFIER]"=LOOKUP(TGT))
    UniqueIdentifier is a property of Targetdestination dimension. Here is the error its giving:
    Validation status of executable file: Failed
    - Unclosed quotation mark after the character string '=LOOKUP(TGT'. in:select [ID] from mbrTARGETDESTINATION where [UNIQUEIDENTIFIER]"=LOOKUP(TGT
    Validation status of syntax: Failed
    - Invalid syntax found; see statements in red

    Nilanjan, I changed TGT to TGT1, still same thing.  Here is the big picture outcome I am trying to achieve.
    Reporting App
    Entity   Costcenter    Shipto   Time          Category  Account    Signed data
    ABC        CO1             USA    2011.jan      Actual     ACT123       200
    So data is coming in like this, the business wants to set up rules such as.....when Costcenter is CO1 AND Shipto is USA AND Entity is ABC....Change the shipto from USA to INDIA. These rules have to be able to be updated by a business user, So I cant hardcode these rules. My manager doesnt want to use Stored procedures, so here is what I did....
    Z_Helper App(Non reporting App)
    Entity Costcenter Shipto   signeddata (other required dimensions are just dummy values)
    ABC     CO1            USA       9
    Now how does 9 get linked to INDIA? I created a new dimension called TARGETDESTINATION. it has ID(which is nothing but shipto country values), and a property called UNIQUEIDENTIFIER. Unique Identifier basically just assigned a unique value to that shiptocountry member row.
    So now I need to write a script logic in reporting app that will look up signed data of 9 in this example, and I was thinking use a select statement to pull INDIA from TARGETDESTINATION dimension.
    Let me know if you have any suggestions. thanks.

  • Add select statement in lsmw

    hi expects,
                 whether i can add 'select statement' in lsmw.
                                                                             thank you

    Hi,
    1. Maintain Attributes:
    Here you have to choose the second option and you can do the recording how this should work. Then assign the same to the Batch Input Recording name.
    2. Maintain Source structure:
      Create a structure name
    3. Maintain Source field:
       In this you have to create a structure same as taht of the input file
      eg: name
           age
    4. Maintain structure relations:
       This will link the structure to the input file.
    <b>
    5. Maintain field mapping and conversion rules:
       Here is the place where you can do coding, depending upon the code you have   written or assignment you have done the values will get picked up from the file and get processed.</b>
    6. Maintain field mapping and conversion rules:
       If you have any fixed values you can define here.
    7. Specify files:
       Specify the input file path and type.
    8. Assign files:
        This will assign ur file to the Input file
    9. Read Data:
       This will read ur data from teh file.
    10. Dispaly Read Data:
        You can see the uploaded data
    11. Convert Data
         This will convert the data to the corresponding format for processing
    12. Display Converted data:
    13. Create batch input session
         Here this will create a batch input session for processing
    14. Run Batch Input session:
         By clicking on the session and process the same you can do teh needfu.
    Hope this helps you.

  • Select statement operators in ecc 6.

    Hi Experts,
    I have a small doubt about the '>=' ( greater than or equal to ) operator usage in select statement. Is this operator by any chance perform not as desired in ECC 6.0. Is it a good option to use 'GE' instead of '>='. ?
    It may sound a bit awkward, but still I would like to know. I am facing a situation, which could be related to this. An early response would be highly appreciated.
    I would request,you NOT TO REPLY with links/explanations which says how to use select statement. Only answer if you have the  answers related to this query.
    Regards,
    Sandipan

    >
    Jaideep Sharma wrote:
    > Hi,
    > The only difference is GE will take a little more time than >= as system need to convert the keyword into actual operator when fetching data from Database.
    >
    > KR Jaideep,
    ????? Every Open SQL statements is translated to the SQL slang the underlying database is talking regardless if you type GE or >=
    If the result differs using >= or GE i would open a call at SAP instead of asking in SDN.

  • HOW CAN I  USE MULTIPLE INNERJOINS IN A SINGLE SELECT STATEMENT?

    HI,
    I AM SHABEER AHMED,
    I AM GETTING AN ERROR WHILE I ATTEMPT TO EXECUTE A SELECT STATEMENT WITH MULTIPLE INNER JOINS . BECOZ I WANT TO FETCH ITEM DATA, PARTNER DATA  BASED ON HEADER DATA .
    THEN OF COURSE I HAVE FETCH DATA FROM VBAK VBAP VBKD SO LZ SEND ME THE SOLUTION.
    BYE

    Hi,
    1.Just see this:
    SELECT * INTO CORRESPONDING FIELD OF TABLE itab
    FROM t1 INNER JOIN t2 ON t1f4 EQ t2f4
    INNER JOIN t3 ON t2f5 EQ t3f5 AND
    t2f6 EQ t3f6 AND
    t2f7 EQ t3f7.
    2.But better to use for all entries.It increases the performance.
    FOR ALL ENTRIES
    Tabular Conditions
    The WHERE clause of the SELECT statement has a special variant that allows you to derive conditions from the lines and columns of an internal table:
    SELECT ... FOR ALL ENTRIES IN <itab> WHERE <cond> ...
    <cond> may be formulated as described above. If you specify a field of the internal table <itab> as an operand in a condition, you address all lines of the internal table. The comparison is then performed for each line of the internal table. For each line, the system selects the lines from the database table that satisfy the condition. 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.
    The internal table <itab> must have a structured line type, and each field that occurs in the condition <cond> must be compatible with the column of the database with which it is compared. Do not use the operators LIKE, BETWEEN, and IN in comparisons using internal table fields. You may not use the ORDER BY clause in the same SELECT statement.
    You can use the option FOR ALL ENTRIES to replace nested select loops by operations on internal tables. This can significantly improve the performance for large sets of selected data.
    Example for ALL ENTRIES
    DATA: TAB_SPFLI TYPE TABLE OF SPFLI,
    TAB_SFLIGHT TYPE SORTED TABLE OF SFLIGHT
    WITH UNIQUE KEY TABLE LINE,
    WA LIKE LINE OF TAB_SFLIGHT.
    SELECT CARRID CONNID
    INTO CORRESPONDING FIELDS OF TABLE TAB_SPFLI
    FROM SPFLI
    WHERE CITYFROM = 'NEW YORK'.
    SELECT CARRID CONNID FLDATE
    INTO CORRESPONDING FIELDS OF TABLE TAB_SFLIGHT
    FROM SFLIGHT
    FOR ALL ENTRIES IN TAB_SPFLI
    WHERE CARRID = TAB_SPFLI-CARRID AND
    CONNID = TAB_SPFLI-CONNID.
    LOOP AT TAB_SFLIGHT INTO WA.
    AT NEW CONNID.
    WRITE: / WA-CARRID, WA-CONNID.
    ENDAT.
    WRITE: / WA-FLDATE.
    ENDLOOP.
    INNER JOINS
    In a relational database, you normally need to read data simultaneously from more than one database table into an application program. You can read from more than one table in a single SELECT statement, such that the data in the tables all has to meet the same conditions, using the following join expression:
    SELECT...
    FROM <tab> INNER JOIN <dbtab> AS <alias> ON <cond> <options>
    where <dbtab> is a single database table and <tab> is either a table or another join expression. The database tables can be specified statically or dynamically as described above. You may also use aliases. You can enclose each join expression in parentheses. The INNER addition is optional.
    A join expression links each line of <tab> with the lines in <dbtab> that meet the condition <cond>. This means that there is always one or more lines from the right-hand table that is linked to each line from the left-hand table by the join. If <dbtab> does not contain any lines that meet the condition <cond>, the line from <tab> is not included in the selection.
    The syntax of the <cond> condition is like that of the WHERE clause, although individual comparisons can only be linked using AND. Furthermore, each comparison must contain a column from the right-hand table <dbtab>. It does not matter on which side of the comparison it occurs. For the column names in the comparison, you can use the same names that occur in the SELECT clause, to differentiate columns from different database tables that have the same names.
    The comparisons in the condition <cond> can appear in the WHERE clause instead of the ON clause, since both clauses are applied equally to the temporary table containing all of the lines resulting from the join. However, each join must contain at least one comparison in the condition <cond>.
    Example for INNER JOINS
    REPORT demo_select_inner_join.
    DATA: BEGIN OF wa,
    carrid TYPE spfli-carrid,
    connid TYPE spfli-connid,
    fldate TYPE sflight-fldate,
    bookid TYPE sbook-bookid,
    END OF wa,
    itab LIKE SORTED TABLE OF wa
    WITH UNIQUE KEY carrid connid fldate bookid.
    SELECT pcarrid pconnid ffldate bbookid
    INTO CORRESPONDING FIELDS OF TABLE itab
    FROM ( ( spfli AS p
    INNER JOIN sflight AS f ON pcarrid = fcarrid AND
    pconnid = fconnid )
    INNER JOIN sbook AS b ON bcarrid = fcarrid AND
    bconnid = fconnid AND
    bfldate = ffldate )
    WHERE p~cityfrom = 'FRANKFURT' AND
    p~cityto = 'NEW YORK' AND
    fseatsmax > fseatsocc.
    LOOP AT itab INTO wa.
    AT NEW fldate.
    WRITE: / wa-carrid, wa-connid, wa-fldate.
    ENDAT.
    WRITE / wa-bookid.
    ENDLOOP.
    Regards,
    Shiva Kumar(Reward if helpful).

  • Using a view instead of a select statement

    Greetings Abapers
    Ive got a problem. Im writing a program and one of the things i do is i use 2 select statements which are as follows:
    Read all organisational relationships for all business partneru2019s linked to sales codes for all date ranges
      select * from hrp1001 into table lt_hrp1001  " Get all external business partners
         where plvar   eq '01'
          and  sclas   eq 'BP'
          and  relat   eq '008'
          or   relat   eq 'Z40'.
      select * from hrp1001 appending corresponding fields of table lt_hrp1001       "Get all employees
        where plvar eq '01'
        and   sclas eq 'BP'
        and   relat eq '291'
        and   otype eq 'S'.
    I have however been told that i can use the database view HRVPADIC since the hrp1001 table is giving me duplicats which i dont want. Can anyone tell me how to use this view i.e. syntax and logic. I would really appreciate it.

    Well, I don't see how using the view would be better. Why don't you just get all of the data at once:
    SELECT * FROM hrp1001 INTO TABLE lt_hrp1001
      WHERE     plvar EQ '01'
        AND     sclas EQ 'BP'
        AND ( ( relat EQ '008'
         OR     relat EQ 'Z40' )
         OR     relat EQ '291'
        AND     otype EQ 'S' ).
    (I didn't test this so check it.)
    Rob

  • How build where clause in select statement in FM for Virtual provider

    Hi
    I looking for example of FM for Virtual provider where I find code how assign to select statement "where" clause value from query variable.
    In following code how build t_r_custtype range and how assign value to it.
    CODE********************************
    TYPE-POOLS: abap.
    initialize
      CLEAR: e_t_data, e_t_msg.
    this is specific to infoprovider VIRTPROV
      CHECK i_infoprov = 'VIRTPROV'.
      FIELD-SYMBOLS: <l_s_sbook> TYPE sbook,
                     <l_s_data>  TYPE ANY.
      DATA: l_t_component TYPE abap_compdescr_tab,
            l_t_sbook     TYPE TABLE OF sbook.
    initialize
      CLEAR e_t_data.
    Data selection / only Business Customer
      SELECT * FROM sbook
        INTO CORRESPONDING FIELDS OF TABLE l_t_sbook
        WHERE custtype in t_r_custtype.
    ENDCODE********************************
    Thanks a lot
    Adam

    Hello,
    Would you like fill the ranges in Customer exit for BEx..? 
    If Yes. please refer the attachment for the whole code...
    "Sample code in Customer Exit in BEx"
    IF i_step = 2.
    CASE i_vnam.
    WHEN 'ZDAY_CX'.
    LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZDAY_IN'.
    CLEAR: l_s_range.
    ZT_DT1 = loc_var_range-low.
    ZT_DT2 = loc_var_range-HIGH.
    CALL FUNCTION 'DATE_CREATE'
    EXPORTING
    ANZAHL_JAHRE = 0
    ANZAHL_KALTAGE = 0
    ANZAHL_MONATE = '-1'
    ANZAHL_TAGE = 0
    DATUM_EIN = ZT_DT1
    DATUM_EIN_ULT = ' '
    ULTIMO_SETZEN = ' '
    IMPORTING
    DATUM_AUS = ZFIDAY .
    E_TT =
    E_ULTKZ =
    CALL FUNCTION 'DATE_CREATE'
    EXPORTING
    ANZAHL_JAHRE = 0
    ANZAHL_KALTAGE = 0
    ANZAHL_MONATE = '-1'
    ANZAHL_TAGE = 0
    DATUM_EIN = ZT_DT2
    DATUM_EIN_ULT = ' '
    ULTIMO_SETZEN = ' '
    IMPORTING
    DATUM_AUS = ZLSDAY.
    E_TT =
    E_ULTKZ =
    l_s_range-low = ZFIDAY .
    l_s_range-high = ZLSDAY .
    l_s_range-sign = 'I'.
    l_s_range-opt = 'EQ'.
    APPEND l_s_range TO e_t_range.
    ENDLOOP.
    *****************************************End*************************************
    **To get the From date (For Text Variable) as per the user input date interval range**
    WHEN 'ZR_S'.
    LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZDAY_IN'.
    CLEAR: l_s_range.
    ZT_DT1 = loc_var_range-low.
    ZT_DT2 = loc_var_range-HIGH.
    CALL FUNCTION 'DATE_CREATE'
    EXPORTING
    ANZAHL_JAHRE = 0
    ANZAHL_KALTAGE = 0
    ANZAHL_MONATE = 0
    ANZAHL_TAGE = 0
    DATUM_EIN = ZT_DT1
    DATUM_EIN_ULT = ' '
    ULTIMO_SETZEN = ' '
    IMPORTING
    DATUM_AUS = ZFIDAY .
    E_TT =
    E_ULTKZ =
    l_s_range-low0(2) = ZFIDAY6(2).
    l_s_range-low+2(1) = '.'.
    l_s_range-low3(2) = ZFIDAY4(2).
    l_s_range-low+5(1) ='.'.
    l_s_range-low6(4) = ZFIDAY0(4).
    l_s_range-sign = 'I'.
    l_s_range-opt = 'EQ'.
    APPEND l_s_range TO e_t_range.
    ENDLOOP.
    *****************************************End*************************************
    Please let me know if any clarification required..
    Rinku..

  • Runtime error at select statement in RFC_READ TABLE FM

    Dear All,
       I have copied the standard FM RFC_READ_TABLE to incorporate the customer needs. Below is the select query which I have written in this FM.
    SELECT (po_search_text-column_text) INTO <wa> FROM ekko
          INNER JOIN ekpo ON ekko~ebeln = ekpo~ebeln
          INNER JOIN eket ON ekpo~ebeln = eket~ebeln AND ekpo~ebelp = eket~ebelp
          INNER JOIN lfa1 ON ekko~lifnr = lfa1~lifnr
          INNER JOIN lfm1 ON ekko~lifnr = lfm1~lifnr AND ekko~ekorg = lfm1~ekorg
          INNER JOIN lfb1 ON ekko~lifnr = lfb1~lifnr AND ekko~bukrs = lfb1~bukrs
          INNER JOIN t024 ON ekko~ekgrp = t024~ekgrp
          INNER JOIN zatscsng_status ON eket~ebeln = zatscsng_status~po_number
          AND   eket~ebelp = zatscsng_status~po_line
          AND   eket~etenr = zatscsng_status~po_sched_line
          INNER JOIN adrc ON zatscsng_status~delivery_addr = adrc~addrnumber
          WHERE (po_search_text-cond_text)
          ORDER BY (po_search_text-sort_text).
    Here, posearch_text-column_text_ will have the fields to be selected at runtime and posearch_text-cond_text_ is the where condition. It is running fine in this case.
    But when I try to select Item Category ( EKPO-PSTYP), if data is present for this category, it is returning the values but if data is not there for the particular item category in the where clause, it is giving a RUNTIME ERROR at the select statement.
    Here is the ERROR ANALYSIS:
    An exception occurred that is explained in detail below.
    The exception, which is assigned to class 'CX_SY_DYNAMIC_OSQL_SEMANTICS', was
      not caught in
    procedure "ZATSCSNG_RFC_READ_TABLE" "(FUNCTION)", nor was it propagated by a
      RAISING clause.
    Since the caller of the procedure could not have anticipated that the
    exception would occur, the current program is terminated.
    The reason for the exception is:
    The current ABAP program has tried to execute an Open SQL statement
    which contains a WHERE, ON or HAVING condition with a dynamic part.
    The part of the WHERE, ON or HAVING condition specified at runtime in
    a field or an internal table, contains the invalid value "<L_LINE>-PSTYP".
    Edited by: Rob Burbank on Mar 17, 2010 5:09 PM

    Now that's what I call a join statement...
    You probably have a bug in how you build po_search_text-cond_text, the content must be a syntactically correct where clause. It seems that in your example there is just "<L_LINE>-PSTYP" without a condition, so try omitting it altogether.
    Debug the content of po_search_text-cond_text before it hits the select statement.
    Thomas

Maybe you are looking for

  • Illustrator objects missing when placed in InDesign

    I created an Illustrator file that has text converted to outlines. Some of it is white and some of it is other colors. When I save the file as eps, pdf or export as jpg and then place the files in InDesign, the white outlined text doesn't show up. Ad

  • Cannot find server - iweb

    I am new to iweb but was able to create and publish a site. All was well, people viewed it. My husband changed what was called "Site2" on the site to our family name. Once he published, you can no longer connect to the site. I click to "announce" the

  • Question about repeating in the process chain

    Hello Gurus,         my DTP is set as "valid records update, no reporting (request red)", and put into a process chain. the process chain goes wrong on this DTP due to some erroneous records.  my questions are:    (1) based on DTP configuration, all

  • How to delete a folder?

    When I right click on a folder and click delete, Lightroom correctly deletes all pictures in the folder, removes the folder from the library, but leaves empty folder in the file system. Is there a way to make Lightroom delete the folder? I'm not dele

  • DTO and JDO Versioning

    I am sending DTOs between Client and Server instead of using attach/detach and send the persistent objects back and forth between presentation tier and business tier. Since persistent objects has JDOVersion, do I also need to add version to DTOs? Is