Add a flag column in the Query based on Cancel date

hi Guys,
I have a Characterstic object 0canceldate and it gets the cancellation date of the sales order. Based on that date i need to add a column in the report like if 0canceldate has ahappened or populate then show Yes or No in the coumn like a flag.
Can anybody help me how i can do that?

SELECT d.NAME
      FROM
        (SELECT jta.NAME
          FROM apps.jtf_terr_values_all jtva,
          apps.jtf_terr_qual_all jtqa,
          apps.jtf_terr_all jta ,
          apps.hz_party_sites ps,
          apps.hz_locations hl
        WHERE jtva.terr_qual_id     = jtqa.terr_qual_id
        AND jtqa.terr_id            = jta.terr_id
        AND jtva.low_value_char     = hl.postal_code
        AND jtqa.org_id             = jtva.org_id
        AND jta.org_id              = jtqa.org_id
        AND ps.location_id          = hl.location_id
        AND hl.country             in( 'CA', 'US')) D;
        UNION
        SELECT jta.NAME
          FROM apps.jtf_terr_values_all jtva,
          apps.jtf_terr_qual_all jtqa,
          apps.jtf_terr_all jta,
          apps.hz_party_sites ps,
          apps.hz_locations hl
        WHERE jtva.terr_qual_id     = jtqa.terr_qual_id
        AND jtqa.terr_id            = jta.terr_id
        AND ps.location_id          = hl.location_id
        AND jtqa.org_id             = jtva.org_id
        AND jta.org_id              = jtqa.org_id
        AND hl.country              = 'US'
        AND hl.postal_code BETWEEN jtva.low_value_char AND jtva.high_value_char
        )d;

Similar Messages

  • I have to add support company column to the query based on city,location id,country can you please any one help me on this

    select fu.user_id,
          fu.user_name,
          hcp_phone1.phone_number primary_phone_number ,
          hcp_phone1.last_update_date cnts_last_update_date,
          fu.last_update_date user_last_update_date,
          (select hcp_phone2.phone_number
          from ar.hz_contact_points hcp_phone2
          where hcp_phone2.contact_point_type(+) = 'PHONE'
          and hcp_phone2.status(+)               = 'A'
          and hp.party_id                        =hcp_phone2.owner_table_id(+)
          and hcp_phone2.owner_table_name(+)     ='HZ_PARTIES'
          and hcp_phone2.primary_flag            = 'N'
          and rownum                             = 1
          ) secondary_phone_number,
        (select hcp_email.email_address
        from ar.hz_contact_points hcp_email
        where hcp_email.contact_point_type(+) = 'EMAIL'
        and hcp_email.status(+)               = 'A'
        and hp.party_id                       =hcp_email.owner_table_id(+)
        and hcp_email.owner_table_name(+)     ='HZ_PARTIES'
        and hcp_email.primary_flag            = 'Y'
        ) email_address,
        hp.person_first_name ,
        hp.person_middle_name ,
        hp.person_last_name ,
        hp.party_name,
        hp.person_title ,(
      nvl(hp.address1,' ') ||
      nvl(hp.address2,' ') ||
      nvl(hp.address3,' ') ||
      nvl(hp.address4,' ')
    ) address1,
       hp.city,
        hp.state ,
        hp.country ,
        hp.postal_code,
      ' ' industry_group,
        from fnd_user fu,
        ar.hz_parties hp,
        fnd_user_resp_groups furg,
        fnd_responsibility_tl frt,
        ar.hz_contact_points hcp_phone1
      where hp.party_id                      =fu.person_party_id
      and furg.user_id                       =fu.user_id
    -- and ( to_date(fu.last_update_date,'dd-mm-yyyy') > to_date(nvl(p_in_date,sysdate),'dd-mm-yyyy')
    -- or to_date(hcp_phone1.last_update_date,'dd-mm-yyyy')> to_date(nvl(p_in_date,sysdate),'dd-mm-yyyy') 
      and furg.responsibility_id             = frt.responsibility_id
      and frt.responsibility_name            = 'EMR IBE Customer PSG US'
      and frt.language                       = 'US'
      and hcp_phone1.contact_point_type(+)   = 'PHONE'
      and hcp_phone1.status(+)               = 'A'
      and hp.party_id                        =hcp_phone1.owner_table_id(+)
      and hcp_phone1.owner_table_name(+)     ='HZ_PARTIES'
      and hcp_phone1.primary_flag            = 'Y';

    SELECT d.NAME
          FROM
            (SELECT jta.NAME
              FROM apps.jtf_terr_values_all jtva,
              apps.jtf_terr_qual_all jtqa,
              apps.jtf_terr_all jta ,
              apps.hz_party_sites ps,
              apps.hz_locations hl
            WHERE jtva.terr_qual_id     = jtqa.terr_qual_id
            AND jtqa.terr_id            = jta.terr_id
            AND jtva.low_value_char     = hl.postal_code
            AND jtqa.org_id             = jtva.org_id
            AND jta.org_id              = jtqa.org_id
            AND ps.location_id          = hl.location_id
            AND hl.country             in( 'CA', 'US')) D;
            UNION
            SELECT jta.NAME
              FROM apps.jtf_terr_values_all jtva,
              apps.jtf_terr_qual_all jtqa,
              apps.jtf_terr_all jta,
              apps.hz_party_sites ps,
              apps.hz_locations hl
            WHERE jtva.terr_qual_id     = jtqa.terr_qual_id
            AND jtqa.terr_id            = jta.terr_id
            AND ps.location_id          = hl.location_id
            AND jtqa.org_id             = jtva.org_id
            AND jta.org_id              = jtqa.org_id
            AND hl.country              = 'US'
            AND hl.postal_code BETWEEN jtva.low_value_char AND jtva.high_value_char
            )d;

  • How to add a Description Column in the Content Panel (Bridge CS5)

    Hi,
    Is it possible to add a Description Column in the Content Panel. If so, how?
    I'm talking about the Description from the IPTC Core data and I'm using Bridge CS5.
    Thanks in advance,
    Frank

    This is the screenshot of the Metadata Workspace with the Content Panel (not Metadata Panel). As you can see it shows Name, Label, Keywords etc. but it's not possible to show Description in that list as a column.
    I still agree that it would be a big bonus if you could alter this workspace with description field (even with more lines etc) but what Curt shows you might be an alternative. I couldn't help noticing that you have not created your own custom workspaces.
    Try and play with this. You have the option to divide the window in 3 columns max but you can create different panels as a row in 1 column.
    Grabbing a tab and move it to a new location until a single blue line appears (between the borders, a bit tricky). A vertical blue line means as a column and a horizontal line means a row. A surrounding blue line means same panel but adding as a tab. You can rearrange the tabs by dragging to left or right. under the menu window you can select which panels are visible or use right mouse click menu on top of a panel to choose.
    Sadly enough only 3 columns and only one panel of it's kind per workspace, but you can resize the panels also to your own workflow needs.
    In Bridge preferences you can change the colors for background in the general tab and in the metadata tab you can select what info to view in certain sections. Personally I have set my IPTC to view only description, keywords, date created and a few other subjects.
    That is the nice thing about Bridge, creating custom workspaces, save them and being able to recreate them without problems :-)
    I attach some screenshot of my daily workflow (with the luxury of having a 30' screen) but there are plenty of other options possible, don't forget to name and save your workspace.

  • I can't add any more columns. The option is suddenly greyed out.

    I can't add any more columns. The option is suddenly greyed out.

    Allen,
    Actually, there is a TRANSPOSE Function, but no Command or Tool for that. It's one of the more useful and popular omissions in Numbers. Perhaps because it falls into the "didn't plan ahead so now I need a tool" category of features, it didn't make the cut.
    Use of the Transpose Function is described in the Function Browser, the Help feature and in the Functions of Formulas User Guide PDF. It involves using the INDEX function to read out the array created by the Transpose function. Another way to do this is to use the OFFSET function in an expression and by exchanging the row and column references.
    Yvan Koenig has written an Applescript that will automate the transposition for data and for certain simple expressions. You can get it from his Box Account, on this page.
    Jerry

  • RPD - Cannot obtain number of columns for the query result :Working with MS SQL 2012 schema

    Hi All,
    I have created my warehouse in MS SQL 2012.
    For management purpose, I have created different schemas in SQL database
    In RPD, Physical layer, when i view data > I get error as
    [nQSError:16002] Cannot obtain number of columns for the query result.
    [nQSError:16001] ODBC error state : S0002 code : 208 message: [Microsoft][ODBC SQL Server Driver][SQL Server] Invalid object name 'tbl'..
    [nQSError:16001] ODBC error state : S0002 code : 208 message: [Microsoft][ODBC SQL Server Driver][SQL Server] Statements could not be prepared..
    I have already browsed : OBIEE 11g Strange ODBC Driver Error with SQL Server : Total Business Intelligence ... did not help me
    please help!!!

    Hi All,
    After all R&D it is been found that Oracle business administrator( RPD) needs default dbo schema. It doesn't accept custom schema for pulling data.
    If anybody have other views please share.!!
    Thank you

  • Displaying dynamic columns in the query output.

    Hello,
    Depending on current quarter output of the query would vary.
    If current quarter is 'Q1'
    O/p : InvQ1  Del  BackQ1  BackQ2  BackQ3  BackQ4
    If current quarter is 'Q2'
    O/p : InvQ1  InvQ2  Del  BackQ2  BackQ3  BackQ4
    If current quarter is 'Q3'
    O/p : InvQ1  InvQ2  InvQ3  Del  BackQ3  BackQ4
    If current quarter is 'Q4'
    O/p : InvQ1  InvQ2  InvQ3  InvQ4  Del  BackQ4
    So, out of 9 columns, 6 columns would display at any given time depending on the current quarter.
    Invoice of 4 quarters, Deliquency and Backlog of 4 quarters.
    I am not getting any way how to display dynamic columns or hide unwanted/blank columns.
    For the time being I have added all 9 columns in the query, and in the output unwanted columns shows blank.
    Can anybody please suggest me how to display only 6 columns in the output depending on current quarter.
    Thanks and Regards
    Shilpa

    Hello,
    This shouldn't be too difficult. Assuming you have a variable with the selected quarter, you may choose to display Inv (whatever that is) for quarters 1 through variable, Del, and Back for quarters variable through 4. You also need a drilldown on quarter in the columns (after the key figure structure). You would probably need to restrict 'Del' on the variable as well if you haven't already done it.
    Best regards,
    Christoffer

  • Need to add 2 new columns to the existing table control of C223 transaction

    Hi ABAP Gurus,
    I have to do a screen enhancement for transaction C223.
    Below is the requirement:
    need to add 2 new columns to the existing table control of C223 transaction.
    there is no customer exits, screen exit or user exit present for this transaction C223, i have found one enhancement spot for this transaction.
    i dont have any idea how to do this in standard transaction C223, the table control in C223 saves the data to MKAL table and the table control uses the structure MKAL_EXPAND in the screen program.
    i have created an append structure for  the 2 fields to the standard table MKAL.
    Can anyone please suggest me how this can be done in standard screen C223, will the enhancement spot can be used to do this....
    please sugest...
    Thanks & Regards

    Hi Santosh,
    Thanks for the reply. I have looked into this Enhancement Spot CPFX_SCREEN_SET , inside this there is only one method INPUT_DISABLED having below parameters
    IM_MKAL     Importing     Type     MKAL                                                                                Production Version
    EX_MSGID     Exporting     Type     SY-MSGID                                                                                Messages, Message
    EX_MSGTY     Exporting     Type     SY-MSGTY                                                                                Messages, Message
    EX_MSGNO     Exporting     Type     SY-MSGNO                                                                                Messages, Message
    EX_MSGV1     Exporting     Type     SY-MSGV1                                                                                Messages, Message
    EX_MSGV2     Exporting     Type     SY-MSGV2                                                                                Messages, Message
    EX_MSGV3     Exporting     Type     SY-MSGV3                                                                                Messages, Message
    EX_MSGV4     Exporting     Type     SY-MSGV4                                                                                Messages, Message
    EX_INPUT_DISABLE     Exporting     Type     CHAR1                                                                                Display Only if X Was Set
    the BADI definition present here is a SAP internal so we cant implement the BADI , but we can created a enhancement spot implementation for this. as per my understanding on this the enhancement spot is only for making the table control fields display / change .  i dont think this can be used to add two new coloumns to C223 table control.
    I am not sure thats why seeking your help/valuable sugestion on this.
    Please provide your sugestion on this , so that i can come to conclusion on this issue.
    Thanks & Regards
    Siddhartha Mishra

  • Query based on a date range

    I want to query based on a date range. I wrote the following EJB QL:
    "select object(a) from ActionItems as a where a.dueDate
    between ?1 and ?2"
    But when I deployed the application to Oracle's EJB server, I got the following error:
    Auto-deploying biogen.jar (No previous deployment found)... Invalid type for expression (a.dueDate BETWEEN ?1 AND ?2)
    EJB QL statement : 'select object(a) from ActionItems as a where a.dueDate between ?1 and ?2'
    EJB QL method : public abstract java.util.Collection ActionItemsLocalHome.findByDueDateRange(java.sql.Date,java.sql.Date) throws javax.ejb.FinderException
    at com.sun.ejb.ejbql.parser.EjbQLParser.parse EjbQLParser.java:218)
    at com.sun.ejb.ejbql.EjbQLDriver.parse(EjbQLDriver.java:86)
    at com.sun.ejb.sqlgen.SQLGenerator.generateSQLForEjbQLQueries(SQLGenerator.java:704)
    It works fine for a number range, but does not work for a date range.
    Any one has an idea on how to write a correct EJB QL for a query based on date range?
    Thanks.
    Jingzhi

    Re-posted. Please help!

  • -To add column in the Query desinger

    Hello Colleagues
    I have column 'C' in the Query desinger. Logic to get value for C is C = A + B. As soon as I open the report, getting the value for Column 'C' .
    Here, my questions are
    1. I should have the flexibility to drill the column C down to display columns A and B (column C is also present)
    2. In the initial view (start of report), displaying column C alone is enough.
    Eg: Column C shows value as 100. When I drill the column ( using arrow mark for column C), found that two more columns A and B displayed with values 40 and 60.
    Initial run should show column as below.
    Col 'C'
    100
    If drilled on Column C (where arrow mark is pressed to get as below)
    Col 'C'     Col 'A'     Col 'B'
    100     40     60
    To achieve above scenario, please guide me the tasks I have to carry out in Query desinger/Anlayzer/view.
    Regards,
    Ningaraju

    Hi Bhanu
    Tks for the reply. Followed the steps below
    1. Created keyfigures A,B,C separately
    2.On the context menu of structure, checked for 'Dispaly as hierarchy'
    3.Tried to drag A and B under C.
    Unfortunately, A and B can't be draged under C. Rather, they are placed up or below it.
    Could you guide me the correct steps.
    Regards,
    Ningaraju

  • Add a new column and the value

    I want to add a new column to a table with a single value for all rows of this column. for example, add a new column called 'sid' with the value of 'dbp'. can I use this statement?
    alter table ... add sid varchar(8) 'dbp';
    or I have to add first then update?

    SQL> alter table blah add (sid varchar2(8) default 'dbp');
    Table altered.
    SQL> select * from blah;
                    COL1 SID
                       1 dbp
                       2 dbp
                       3 dbpMessage was edited by: SomeoneElse
    (used OP's column name)

  • Need to add a new column in the extended VO

    Hi
    I have an urgent requirement like i need to add a new column in one of the extended VO.Can anyone give the procedure to do that..
    Please do the needful.
    Thanks
    Preeti

    Hi Gaurav,
    For example...
    Consider seeded VO is XXXVO and we added a new column to the XXX by extending XXCHRXXXVO(extended VO).and the we gone thru the full substitution process..
    Now new requirement came as add a new column to extended VO - XXCHRXXXVO.Can you please tell in this example scenario? It will be good if you provide the inputs...
    Thanks
    Preeti

  • Variables in the query based on infoset

    Dear all,
       I defined a variable on an infoObject in the query designer. However, when this infoObject was used in the infoSet, the variable I defined could not be seen. So in the infoset how can I use the variable I defined in other query not based on infoset? Please advise. Thanks.
    Jin Ming

    I have the same problem:
    I created an Infoset where I am using an Infoobjet that is used in a Cube.
    I have defined variables on this Infoobjet but one of them cannot be used in the new Infoset even if in the new Infoset the links between infoobjets are the same as in the Cube.
    Thank you for any help.
    Stanislas

  • Data Error in the Query/Report after selective data deletion for infocube

    Hi Experts,
    Please advise what i was missing and what went wrong...
    I got a Query (Forecast) on a Multicube...which is based on 2 Infocubes with Aggregates...
    As i identified some data discrepency..yesteraday i performed selective data deleation on one of the Infocube
    and executed report yesteraday and the results in the query are correct...
    When today i executed the same report i am getting different results..
    When i compared the results of the report with that of data in cube they are not matching
    The report is not displaying the data in cube..for some rows it is displaying the data in the cube but for some rows it is just displaying same as the above row
    there is no data loaded into info cube after selective deleation
    Do i need to perform request compression and fill the aggregated after selective deleation
    Please advise what went wrong

    Hi Venkat,
    No i haven't done anything on aggregates before or after selective delete
    As there is not data load after the selective delete according to SAP Manual we don't need to perform any thing on aggregates...as selective data deletion on cube will delete data from aggregates as well
    Please update how to identify error

  • Run the query with previous weeks date automatically

    Hi Guyz,
    I need to  dynamically populate the previous weeks  date value every week,
    i.e Run the query every Monday automatically, with previous weeks date value .
    Is there any SAP Exit which I can use ??
    Regards,
    Ravi
    Edited by: Ravi Srinivas on Aug 4, 2009 1:40 PM
    Edited by: Ravi Srinivas on Aug 4, 2009 1:52 PM

    Ravi,
    If you are thinking of re-running the previous week's queries automatically in the front-end, then U. Tummers is correct.  You can create new columns alongside your existing query if you so wish and use your restrictions with an offset sepending on how far back you'd like to go.
    Best,
    Philips

  • How to update the price based upon PGI date

    Hi
            I have issue of updation of the Prices and freight based on PGI date in the billing we are using the two billing types for the excsies and tax invoice creation .And in the copy control pricing type is maintained Aas "C" for the billing types with single delivery but someHow MRP in the excise billing has been picked from the condition record thats validity is ended and in Tax invoice it picks up the correct prices
    Both pricing condition types has pricing type "B" from Billing date and in the freight we have maintained as "A" SRD
    But for the some cases specially for the excise related part that is based upon the MRP we are facing this issue
    Pricing date is some how coming from sales document
    Please find the problem details in the attachment

    Hi,
    if you see two condition tabs snap shots you can understand clearly because that two invoices has been created in two different dates and you have maintained the pricing date C-billing date ( KOMK-FKDAT).Due to this,the price of ZMRP is coming differently.After you creation of first invoice then you would have changed ZMRP amount.Now while you are creating second invoice ,system has taken new price of ZMRP in billing level.
    Note:While creating second invoice, PGI date might have come into billing level but someone would be changed billing date manually at header level of billing document.Please check that one also.
    Kindly let me know if you need further help on this.
    Thanks,
    Naren

Maybe you are looking for

  • Photoshop Elements 11 restore has duplicated all my pictures

    I recently upgraded my computer from Windows XP to Windows 7 installing a new hard disk in the process. Before starting I used PSE 6 to backup the catalogue. I installed Windows 7 on the new disk and copied all my data files (including pictures) from

  • LG 1780U (Flatron Slim)

    I bought the mini-dvi to dvi adapter to use on my iMac (20" Intel) with my LG 1780U as a second monitor. For some reason the 1780U is recognized by the mac but it immediately goes into "digital power saving mode" and displays no image regardless of w

  • Busines Partner Tyes

    Sorry to ask you this stupid question ? can any one tell / guide me about Business Partner types and how can we use this in CRM ?   thanks in advance. Rakesh

  • Downgrade safari from v6 to v5?

    Can this be done I am running OS 10.8 and safari v6 keeps crashing on me and I never had issues with v5.

  • Software to capture screen to make tutorials?

    Hello, Does anybody know of any software that captures whats going on my screen? I am trying to make some tutorials for my website and I also need the videos to end up being smallish files so that they can be quickly downloaded. Thanks.