Join statment is not working

Hello Experts,
I am trying to write a below code where i will be using JOIN statment to select data from 2 table faglflexas and cepct.These two tables have only one field in common(prctr).I would also be getting the value of prctr from the user on selection screen.
But the code syntax is not allowing me to prctr in both the places.
SELECT faglflexapoper faglflexaryear faglflexaprctr cepctktext " FROM faglflexa
INTO CORRESPONDING FIELDS OF TABLE gi_prctr
FROM cepct JOIN faglflexa ON cepctprctr = faglflexaprctr
WHERE poper IN s_period
      AND ryear EQ p_fyear.
      AND prctr in s_prctr.
I am getting error in last line of AND prctr in s_prctr. asking that I prctr is defined in two places in the select query.
please help.
points will be rewarded definately.

Hi,
The code written by you is giving a syntax error as PRCTR field is present in both the tables and you are using a join but in the where clause you are not specifying the field with respect to a table.
try the below syntax:
SELECT faglflexapoper faglflexaryear faglflexaprctr cepctktext " FROM faglflexa
INTO CORRESPONDING FIELDS OF TABLE gi_prctr
FROM cepct JOIN faglflexa ON cepctprctr = faglflexaprctr
WHERE poper IN s_period
AND ryear EQ p_fyear.
AND cepct~prctr in s_prctr.
Thanks.

Similar Messages

  • Modify statment is not working.

    Hi Experts,
    I have a small query, modify statment is not working properly, Maybe my syntax wrong. Kindly suggest me.
          DESCRIBE TABLE it_marc1 LINES count.
          IF count = 1.
            LOOP AT it_marc INTO wa_marc where sernp ne space.
              READ TABLE it_stpo INTO wa_stpo WITH KEY idnrk = wa_marc-matnr.
              IF sy-subrc = 0.
                wa_stpo-potx2 = c_primary.
                MODIFY table it_stpo FROM wa_stpo TRANSPORTING potx2.
              ENDIF.
            ENDLOOP.
          ENDIF.
    Mohana

    Hello,
    Add the index addition and check
    DESCRIBE TABLE it_marc1 LINES count.
          IF count = 1.
            LOOP AT it_marc INTO wa_marc where sernp ne space.
              READ TABLE it_stpo INTO wa_stpo WITH KEY idnrk = wa_marc-matnr.
              IF sy-subrc = 0.
                wa_stpo-potx2 = c_primary.
                MODIFY table it_stpo FROM wa_stpo TRANSPORTING potx2 INDEX sy-index.  " here
              ENDIF.
            ENDLOOP.
          ENDIF.
    Vikranth

  • Outer join (with (+)) does not work

    I started with a working SQL statement:
    SELECT DISTINCT username, r.granted_role
    FROM dba_users u, dba_sys_privs s, dba_tab_privs t, dba_role_privs r
    WHERE u.username = s.grantee
    AND u.username = t.grantee
    AND u.username = r.grantee
    ORDER BY username, r.granted_role;
    Fine, now I want to add two columns which indicate which of the users have SYSDBA and SYSOPER privileges.
    As in another post told this can be achieved by:
    SELECT * FROM V$PWFILE_USERS;
    When I want to merge these two SQL statements I need an outer join but the following does not work:
    SELECT DISTINCT u.username, r.granted_role, v.SYSDB, v.SYSOP
    FROM dba_users u, dba_sys_privs s, dba_tab_privs t, dba_role_privs r, V$PWFILE_USERS v
    WHERE u.username = s.grantee
    AND u.username = t.grantee
    AND u.username = r.grantee
    AND u.username = v.username(+)
    ORDER BY u.username, r.granted_role;
    I got an error message:
    SELECT DISTINCT u.username, r.granted_role, v.SYSDB, v.SYSOP
    ERROR at line 1:
    ORA-06553: PLS-306: wrong number or types of arguments in call to 'V'
    Why?

    Run this
    SELECT DISTINCT u.username, r.granted_role, v.SYSDBA, v.SYSOPER
               FROM dba_users u,
                    dba_sys_privs s,
                    dba_tab_privs t,
                    dba_role_privs r,
                    v$pwfile_users v
              WHERE u.username = s.grantee
                AND u.username = t.grantee
                AND u.username = r.grantee
                AND u.username = v.username(+)
           ORDER BY u.username, r.granted_role;- - - - - - - - - - - - - - - - - - - - -
    Kamran Agayev A. (10g OCP)
    http://kamranagayev.wordpress.com

  • Left Outer Join & IS NULL Not Working

    In a Data Flow Query element I am using a Left Outer Join to correlate two tables. In order to eliminate rows in which the Left Outer Join found a match with the Right table I am using IS NULL in the Where clause. Unfortunately IS NULL doesn't seem to return true when the NULL is caused by a lack of a match on a Left Outer Join. Has anybody been able to work around this?

    Use not is NULL in next query after the join.
    A source 1 ---
                           C (join query) ----- D (filter condition IS NULL)
    B source 2 ---

  • Update or modify  statment is not working in the method for workflow

    hi friends,
    i am facing with a problem.
    one of my requiremetn is i need to update the ztable with update or modify statement in the method.
    when i run  by manually it is wokring fine(updating the ztable ) and  binding every thing is fine. however the table is not updateing.
    can you please let me know what i am missing.
    Thanks in advance.
    ~ysr

    Hello,
    I understand you have to close some questions when you reach more than 10; if that wasn't the case then hardly anybody would ever close a thread.
    What I'm saying is that you should give a more useful follow-up than "self". If your question was answered then say what the correct answer was. If it wasn't answered then say that.
    The purpose here is to share knowledge, not just solve your problems.
    regards
    Rick Bakker
    hanabi technology

  • Select statment is not working for field TOAOM-connection

    Hi,
    I am not able to execute the below code in my System ERP2004.
    tables: toaom,TOACO.
    data lv_connection like toaom-connection.
    data OBJECTTYPE like toaom-SAP_OBJECT.
    data DOCUMENTTYPE like toaom-AR_OBJECT.
    data it_toaom like toaom occurs 0 with header line.
    select single connection from TOACO into lv_connection
                                   WHERE SAP_OBJECT = OBJECTTYPE
                                     AND AR_OBJECT  = DOCUMENTTYPE
                                     and ar_status  = 'X'.
    It gives a message that "ToAOM is is not expected"

    Hi lijo,
    1. use like this.
    2.
    REPORT abc.
    *TABLES: toaom,toaco.
    DATA : toaom LIKE TABLE OF toaom WITH HEADER LINE.
    DATA : toaco LIKE TABLE OF toaco WITH HEADER LINE.
    DATA lv_connection LIKE toaom-connection.
    DATA objecttype LIKE toaom-sap_object.
    DATA documenttype LIKE toaom-ar_object.
    DATA it_toaom LIKE toaom OCCURS 0 WITH HEADER LINE.
    SELECT * FROM toaom
    *iNTO lv_connection
    INTO TABLE toaom
    WHERE sap_object = objecttype
    AND ar_object = documenttype
    AND ar_status = 'X'.
    regards,
    amit m.

  • Select query not working in Dev but working in QA and PRD

    Hi All,
    I have a select query with inner join which is not working in the DEV but working in QA and PRD. Anyone has any idea why is it happening, I think it to be a basis issue. Just want to confirm if anyone has any other idea.
    Thanks in advance,
    Barjinder Singh.

    Hi Barjinder Singh,
    In development you can't find the records for the table.
    In testing system only you can test even the program(report).
    If it is the DEV system you can't get the data.
    Go and see into the table wether it has records or not(in DEV system).
    It doesn't has the records in DEV system.
    Regards,
    Balakrishna.N

  • Left Outer Join Not working in BI 7.0 Infoset

    Hi All,
    I am working on BI 7.0. I have to create a report where I have to display the Target values from a target DSO against the transactional data (Operational data).
    I have a DSO where for a “subteam” value target has been set up on different KPIs.
    In the Info Cube, I have transactional data on daily basis per “subteam”. I have to show the actual and target values.
    I have created an Info Set using Target DSO and Daily operational cube, so that I should able to compare the target and actual values of KPIs, for all the “subteam” values (From DSO, irrespective of whether the data is available in cube for those sub team).
    I have used Outer Left Join in the Info set (DSO on left side), but I am unable to see the desired results. It is working just like an inner join.
    Any Idea why the Outer Left Join is not working? The DSO has only one fey field called “subteam” on which I have set outer left join.
    Regards,
    Amit

    Hi,
    did you solve your problem? because I have the same issue right now: the left outer join doesn't seem to do its job.
    Let me know if you have found a solution, it would be appreciated.
    have a nice day,
    Dominic

  • Link for BUT000 table and ADRC in CRM and inner join is not working in PCUI

    Hi Gurus,
       Please tell me the link btween BUT000 and ADRC table. and i wrote one inner join between BUT000 and BUT0id table but it not working. I m in CRM 4.0 version working with PCUI.
    select but000partner but000name_org1 but000name_org2 but000bus_sort1 but0id~parnter1
          but0ididnumber from but000 inner join but0id on but0idpartner = but000~parnter
    into corresponding fields of table it_result where partner in s_partner.
    It is giving error as partner unknown from but000 table. I delcared everything and tried with alias names also.
    please clarify me.
    regards,
    Ramakrishna.

    Hi Frederic,
       thanks a lot. But is inner join between BUT000 and BUT0ID will work. for me it is not working. plesae see this code.
    tables : but000,
             but0id,
             crmm_but_custno,
             adrc.
    types : begin of typ_but000,
            partner type bu_partner,
            name_org1 type BU_NAMEOR1,
            name_org2 type BU_NAMEOR2,
            bu_sort1  type BU_SORT1,
            idnumber type BU_ID_NUMBER,
            partner1 type bu_partner,
            end of typ_but000.
    data: lt_but000 type table of typ_but000,
          ls_but000 like line of lt_but000.
    *select-options : s_partnr for but000-partner.
    start-of-selection.
          select but000partner but000name_org1 but000name_org2 but000bu_sort1 but0id~parnter1
                    but0id~idnumber into corresponding fields of table lt_but000 from  but000
                    inner join but0id on but0idpartner = but000parnter. " where partner in s_partner.
    it is giving error as but000-partner is not know or but0id-partner not known.
    So, i think if it not works then i should write two select stmts.
    please clarify me.
    i gave u rating.
    thanks
    ramakrishna.

  • Two report join not working

    I have two reports: Lead History(registered reciepents) and Campaign Reciepents History(email click-thru reciepents) with columns Full Name, Company/Account Name, and Job Title. I want to do a join that pull out the click-thru's that registered. Union and Union All gives me everything, Minus gives me just the click-thru's, and Intersect gives me nothing. What complicated join can I do to make this possible?

    Thank you, Barney-15E and Nerowolfe.
    First, you are right - I am using the 17" MacBook Pro (but not the ltest version).
    Second, I looked in the Library folders and found Sidetrack in the Startup items. I deleted it (although I had already removed it from the Startup items in the System Preferences.
    Third, I reset the PRAM.
    However the 2-finger scrolling is still not working. I did notice (and I don't know if this is something new) that the cursor is now immobile when trying to use two fingers although it is fine with one finger. It as though the trackpad recognizes that two fingers are different from one, but it doesn't know what to do with two-fingers.
    On a more general note, thank you all for your interest and quick responses. But...what should I try next? Apple suggests resetting the Power Management.

  • LEFT Join not working

    Hi guys,
    I am not sure why the left join is not working.. when I try to use the and condition out of the left join condition. The database is relational but the requirement is for reporting. I have 2 user inputs and I should get the query results as explained below..
    Let me explain with the sample data.
    Table 1: PRTYPE (P)
    TYPEID CLASSID
    T001 CLS001
    T001 CLS002
    T001 CLS003
    T002 CLS002
    T003 CLS001
    Table 2: EMPLOYEE (E)
    EMPID NAME
    E001 Joe
    E002 Mark
    E003 Lucy
    Table 3: DETAILS (D)
    EMPID CLASSID STATUS
    E001 CLS001 NEW
    E001 CLS002 DONE
    E002 CLS001 NEW
    E002 CLS004 NEW
    Report1:
    Input: PRTYPE.TYPEID = T001, EMPID = E001
    Output:
    E.NAME E.EMPID P.TYPEID A.CLASSID D.STATUS
    JOE EMP001 T001 CLS001 NEW
    JOE EMP001 T001 CLS002 DONE
    JOE EMP001 T001 CLS003 BLANK
    Report2:
    PRTYPE.TYPEID = T003, EMPID = E003
    E.NAME E.EMPID P.TYPEID A.CLASSID D.STATUS
    LUCY E003 T003 CLS001 BLANK
    LUCY E003 T003 CLS004 BLANK
    When I use and condition in left join itself, it works but when I take it to the end of the sql using where p.typeid= T001 and E.EMPID = E001 I am not getting the left join results... It looks like Oracle doesn't like the condition at the end. I hope I am clear on explaining. Please share your experience on how to get it working..
    Thank you

    Hi,
    Welcome to the forum!
    user12118328 wrote:
    I am not sure why the left join is not working.. when I try to use the and condition out of the left join condition. The database is relational but the requirement is for reporting. I have 2 user inputs and I should get the query results as explained below..
    When I use and condition in left join itself, it works but when I take it to the end of the sql using where p.typeid= T001 and E.EMPID = E001 I am not getting the left join results... It looks like Oracle doesn't like the condition at the end. I hope I am clear on explaining. Please share your experience on how to get it working..I'm not sure what you mean. Why don't you post your query? You know, it will be easier for someone to tell you what you're doing wrong if they know what you're doing.
    Are you saying that you get the correct results when you have a cerain condition in an outer join, but that you get the wrong results if you put the exact same condition in the WHERE-clause?
    If so, keep the condition where it does what you want.
    You can usually move INNER join conditions around like that, but never OUTER join conditions.
    As Alex said, if you want help, post executable statement to create and populate your tables with a little sample data, as well as the output you want from that sample data, and your best attempt at a query.

  • I bought yesterday my macbook pro and I want to join the FaceTime and I just can´t... It said that is not working and try it later... but since yesterday said that .. What should I do?

    I bought yesterday my macbook pro and I want to join the FaceTime and I just can´t... It said that is not working and try it later... but since yesterday said that .. What should I do?

    Here's a previous discussions that seems to have solved a similar issue in the past:
    https://discussions.apple.com/message/12209861#12209861

  • TS1398 when i update my software to 6.1.3(10B329)to I phone 4s the wifi is not working and not auto join the network that i have already connected to

    when i update my software to 6.1.3(10B329)to I phone 4s the wifi is not working and not auto join the network that i have already connected to

    First, grow up.  Just because YOUR phone isn't working, doesn't mean Apple put out bad software.  I've not had any difficulty, nor has anyone else I know.  And just how is Apple risking lives with Bluetooth kits not working?  It's YOUR decision to talk on the phone or text and drive.  Not Apple's.
    We're users here, volunteering our time to help others.  Posts like yours, which are whiny and ranting, simply means we're likely to ignore you and not provide you with any help.  Not to mention, it makes you look absolutely foolish.
    Further making you look foolish is the fact that you haven't even asked a technical support question, nor have you provided anyone here with any troubleshooting steps you might have taken, including those recommended in the user guide.
    Good luck getting help.
    GDG

  • Outer join not working

    Hello everybody,
    I have a folder based on materialized view (Detailed folder). There is another folder which is based on a table (master folder). i have created a jooin and select option as "outer join on master folder". The join is not working properly. Am i doing asomething wrong. Discoverer version is 10.1.2 and database version is 10.2.0.3. i have been creating outer joins among folders based on tables but i am not sure about whats wrong this time??? materalized view defination is as follows:
    CREATE MATERIALIZED VIEW MW
    BUILD IMMEDIATE
    REFRESH FORCE
    START WITH SYSDATE
    NEXT TRUNC(SYSDATE+1)+1/4
    WITH PRIMARY KEY
    AS
    SELECT * FROM VIEW
    Thanx for your help
    Regards,
    Najeeb

    So, let me see if I got this...
    You have a table and a materialized view. There is a join between the two, where the table is the master, and the MV is the detail. The join is set to be an outer join on master. Ultimately, you want to see the values in the MV where the join condition is NULL.
    What boggles me is that you say the query runs fine in the database, but not in Disco. This could mean that there is a condition in the BA or in the worksheet. But, if that were the case, the condition should show up in the SQL generated by Disco.
    It looks like the where clause is the problem. NULL is never equal to anything, so when APPROVEDBY is null, the where clause should fail and no data returned. This explains Disco's behavior, but not SQL's.
    Something to try: Create a calculation in the materialized view folder of the business area like:
    NVL(APPROVEDBY, -1)
    I am assuming that all of your IDs are positive. Then modify the join to use the calculated column. This should convert the NULLS to values, and the report should work.

  • Outer join not working when filters are applied from Prompts

    Hi,
    Without values being selected from the dashboard prompts, my outer join is working fine with all the rows and all the columns showing up( as per requirement). But as soon as I select values in the prompts, only certain rows and columns show up.
    BTW, I have 2 prompts Year and Quarter. I put Year is Prompted or is null in the criteria. It works. BUT as soon as I also put in quarter numbers, it does not work.
    Is there a workaround for this?
    Thanks,
    Dan
    Edited by: Danny on Apr 26, 2013 12:10 PM

    I just experimented by adding is null to not only the year and quarter but to the row and column too and it worked!
    Thanks,
    Dan

Maybe you are looking for

  • How can I downgrade my iPhone 4 from 5.1.1 to 5.1.0

    Hey there, I had to restore my iPhone and thereby I accidentally updated from 5.1.0 to 5.1.1 Now I cannot use my backups any more and therefore I lost all my mindmaps, documents in Quickoffice ... it's a disaster!!!!!! Is there anybody who can help?

  • IS THERE A WAY I CAN GET MY PURCHESES BACK

    i lost all data is there a way to get it back

  • This accessory is not made... error

    Greeting folks, My iPhone has been wacky! Out of nowhere it shut itself down whiel in the middle of a song. Then after I plugged it in for a while it finally came back on. However, now every few minutes or so the "This accessory is not made to work w

  • Question about timeline navigation and the display list-

    I've got a movieclip called "rotatorProxy" that spans the entire timeline. I've got nav buttons that jump to various frames on that timeline. I need to get the display depth of rotatorProxy each time the nav buttons move the playhead. The AS3 code is

  • Poker game logic(again)

    i think that this will be the last thread that i will start on the subject of poker. if you have not looked at the other poker game logic threads, it might help. if figured out ways to check for repeaded cards(2,3,4,2&2,2&3) and how to do the flush.