Query Change

Hello -
We would like to add two data columns to this Query below -- 1. Foreign Name and 2. BP Properties #1 (all accounts that have BP Properties #1 selected, regardless of transaction). Help?
SELECT T0.CardCode 'Acct #', T0.CntctPrsn, T0.CardName Company, T0.Address
' Address', T0.Block ' Block', T0.City ' City', T0.State1 State, T0.ZipCode
'Billing Zip', T0.Phone1 Phone, T0.Balance ' Balance',
T1.SlpName 'Sales Rep',
T2.PymntGroup Terms, T3.GroupName 'Group', ((SELECT ISNULL(SUM(INV1.LINETOTAL),0)
FROM INV1 INNER JOIN OINV ON INV1.DocEntry = OINV.DocEntry
WHERE OINV.CardCode = T0.CardCode AND Year(INV1.DocDate) = Year(GetDate()))-(SELECT ISNULL(SUM(RIN1.LINETOTAL),0)
FROM RIN1 INNER JOIN ORIN ON RIN1.DocEntry = ORIN.DocEntry
WHERE ORIN.CardCode = T0.CardCode AND Year(RIN1.DocDate) = Year(GetDate()))) [YTD Sales]
FROM OCRD T0
LEFT JOIN OSLP T1 ON T1.SlpCode = T0.SlpCode
LEFT JOIN OCTG T2 ON T2.GroupNum = T0.GroupNum
LEFT JOIN OCRG T3 ON T3.GroupCode = T0.GroupCode
WHERE T0.CardType = 'C'
Thanks!
Mike

Hi,
Check this :
SELECT T0.CardCode 'Acct #', T0.CntctPrsn, T0.CardName Company, T0.CardFName,
T0.Address ' Address', T0.Block ' Block', T0.City ' City', T0.State1 State, T0.ZipCode
'Billing Zip', T0.Phone1 Phone, T0.Balance ' Balance',T1.SlpName 'Sales Rep',
T2.PymntGroup Terms, T3.GroupName 'Group', ((SELECT ISNULL(SUM(INV1.LINETOTAL),0)
FROM INV1 INNER JOIN OINV ON INV1.DocEntry = OINV.DocEntry
WHERE OINV.CardCode = T0.CardCode AND Year(INV1.DocDate) = Year(GetDate()))-(SELECT ISNULL(SUM(RIN1.LINETOTAL),0)
FROM RIN1 INNER JOIN ORIN ON RIN1.DocEntry = ORIN.DocEntry
WHERE ORIN.CardCode = T0.CardCode AND Year(RIN1.DocDate) = Year(GetDate()))) 'YTD Sales', T0.QryGroup1
FROM dbo.OCRD T0
LEFT JOIN dbo.OSLP T1 ON T1.SlpCode = T0.SlpCode
LEFT JOIN dbo.OCTG T2 ON T2.GroupNum = T0.GroupNum
LEFT JOIN dbo.OCRG T3 ON T3.GroupCode = T0.GroupCode
WHERE T0.CardType = 'C'
Regards,
Jitin
SAP Business One Forum Team

Similar Messages

  • How to call structure in query change mode

    Hi Gurus,
    How to call created structure in query change mode?
    Is there any other methods?
    Thanks in advance
    Ramu

    HI Ramu,
    If ur structure is global then it will be available in the left panel in the structure tree, Just drag and drop into the rowns or colums. Make sure that the structure is saved as global.
    Thanks
    Khaja

  • Query changes are not reflecting in the Workbook.

    Hi All,
    I have modified the query by adding attributes. But the changes are not reflecting in the workbook.
    Do i need to insert the query again in the workbook or is there any option that will reflect the changes in the workbook
    Thanks in Advance,
    Suneel.

    Hello Suneel,
    if you insert the query again, it will work, but it is not the best way to delegate the query changes to the workbook.
    Just open your query from within your workbook (BEx menu 'change global definition') and use the green button at the top left in order to transfer the new query structure to the workbook. The query will be executed and you should see the changes.
    Don't forget to save the workbook afterwards.
    Regards,
    Kirill

  • How to get bex query changes reflected in webi.

    Hi expert,
             I am using sap bex query in WEBI by BICS connection, but I have done some change in bex query, how can I get those changed reflected in webi.
    Many Thanks,

    Hi Zhang,
    Please review following link which would help you to understand the impacts of changes in the BEx Query to associated universes and webi reports.
    http://wiki.scn.sap.com/wiki/display/BOBJ/Impact+of+a+BEx+query+change+to+universes+and+WebI+documents
    Regards,
    Veer

  • How To Guide : Impact of a BEx query change to universes and WebI document

    Ever wondered about the impact of a BEx query change to your universes and Intelligence documents ? "If I change this, will I need to refresh the universe structure ? will my Web Intelligence documents break ?". This article aims at clarifying these questions for Web Intelligence documents that use OLAP Universe(s) based on BEx query(ies). More specifically, it clarifies which BEx query change does impact Universes and Web Intelligence documents and which one is transparent to them.
    The first part of this article provides a summary table. The second part explains what to do to make the universe and Web Intelligence documents reflect the BEx query change. And finally, it covers each change scenario in details with more explanation and screen shots.
    [http://wiki.sdn.sap.com/wiki/x/0wt9DQ|http://wiki.sdn.sap.com/wiki/x/0wt9DQ]

    Hi Rajesh J Salecha,
    What I understood is like :
    You have two queries and both gives same results but one of the query having a parameter.
    You have one report which is using query1.  Now you want that report to be copied as Report2 and use Query2 instead of Query1.
    If the this is the issue, then you copy Report1 as Report2 and go in Database and change the Data source location to Query2.
    Hope this will help you.  If my understanding is wrong then give us the work flow.
    Thanks,
    Sastry

  • Query changes logs.....

    Hi,
       How to check the logs for query changes. Means which user has done what change.In properties we get the last user only.
    Is there any way to check the full history of changes.
    Bye,

    I guess that is not possible,  every element wise in the query , you can see last changed by , but detailed log is not possible.

  • Do I need to transport webtemplate when I send query changes?

    Hai All,
       I have moved my new query, web template for the query and the role to test from dev some time ago. Now I made some changes to query. Do I need to send all these 3 again to BWT? , OR,  just sending the query changes will be ok?.
    Thanks In Advance,
    Vijay.

    Vijay,
    to delete a query - open a TR for the query and delete it in BeX and transport it through to PROD.
    Otherwise you can go to SE09 and see the transport objects ( locked objects ) the same would have a trashcan icon against the query elements in the lock overview.
    Also even if you create a new query using the same technical name - you will have to update the web template and transport it again to PROD - this is because the queries are stored as 32 character GUIDS which will not be repeated even if the query technical name is the same.
    Arun

  • Howto Refresh SAP BW Query Changes for roles (User menu)

    Hi All,
    I have apply new changes for combine hierarchy. However I have tested in Query Designer/web and its works ok hence the user cant see the change.
    Howto Refresh SAP BW Query Changes for roles (User menu)
    Below is the setup we do have (sap bw 3.5)
    1. User run query from User menu (They logon to bw backend and run query by click on the icon on thier user menu.
    Changes.
    1.Apply combine hierarchy (Rows in Query Designer)
    2. I have display query on the web and its work as expect
    Issue
    1. Query not refresh in user menu (Roles) Users run the query through user menu
    Regards Jon

    thank you

  • Web Template not impacted after query changed and Transported

    Hi. All.
                        We have modified the query and transported to production But query changes not been
    impacted on Standard web teplate. But it works fine in Bex Analyzer.
                       Issue is there was a description was truncated earlier we used initially as short description.
    Later we mapped to Medium description and modified the entire flow and loaded. It works fine.
                      Only in production we are not seeing correct description in web report and it works fine with Analyzer. So we need to ask the user as after executing the report he needs to change characterstic property from Standard to Medium.
    But it would be bit inconvenience to users.
                So how can we solve this problem and why the query changes are not impacting on Web template.
    Please provide your views on this issue.
    Thanks & Regards
    Vijay

    Hi Vijay,
    one reason might be if you use the option "personalization" within the web template. If users can personalize the templates changes will not be visible and have to be deleted at the time a new version of the query is provided. There are background tables for the personalization as well where you can delete all objects for this template at once if necessary.
    Brgds,
    Marcel

  • Query changes not visible in Crystal Reports

    Hello
    I'm building a report on top a BI query. To solve some design problems I had to change my query in Query Designer. But I can't see those changes in Crystal Reports. The fields are the same as before, even when I click on 'Regenerate' in the context menue in Field Explorer.
    Do I really have to build a complete new report to see these changes in Crystal Reports?
    - Crystal Reports 2008, V1
    - SAP Integration Kit 3.1
    - Query designed Business Explorer 3.5 and 7.0 (effect appears with both versions)
    - SAP GUI 710, Patch 11
    Thank you for you help!
    phil

    After some more digging in this forum I found a solution to my problem in a totally different thread. It apparently needs two clicks:
    1. Menue Report -> Verify Database
    2. Menue Report -> Regenerate Data (freely translated from german CR)

  • Query change from 11i to R12

    Hi,
    Please help me out from the below query.....
    In 11i we are using the below Query.
    SELECT a.AE_HEADER_ID,a.AE_LINE_NUMBER,
    a.AE_LINE_ID, a.AE_LINE_TYPE_CODE,a.CODE_COMBINATION_ID,
    a.CURRENCY_CODE,a.ENTERED_DR,a.ENTERED_CR,a.ACCOUNTED_DR,a.ACCOUNTED_CR,a.SOURCE_TABLE,
    a.SOURCE_ID,a.LAST_UPDATE_DATE FROM
    AP_AE_LINES_ALL a,
    AP_AE_LINES_Local_table e, ap_invoice_distributions d
    WHERE a.source_table = 'AP_INVOICE_DISTRIBUTIONS'
    AND a.source_id = d.invoice_distribution_id AND
    a.last_update_date -(sysdate - 10) > 0
    AND a.AE_LINE_ID = e.AE_LINE_ID(+)
    I need to change this query related to R12 changes.
    Please help me whether i need to use xla_ae_lines table from R12. if yes there are AE_LINE_ID, AE_LINE_TYPE_CODE columns are not there in xla_ae_lines table. Pls let me know where to refer the AE_LINE_ID, AE_LINE_TYPE_CODE columns in R 12.

    Hi,
    In R12 ae_line_id replaced with ae_line_num,
    Pls. find the sample query.
    SELECT a.ae_header_id, a.ae_line_num, a.accounting_class_code,
    a.code_combination_id, a.currency_code, a.entered_dr, a.entered_cr,
    a.accounted_dr, a.accounted_cr, a.source_table, a.source_id,
    a.last_update_date
    FROM xla_ae_lines a, apps.ap_invoice_distributions_all d
    WHERE a.source_table = 'AP_INVOICE_DISTRIBUTIONS'
    AND a.source_id = d.invoice_distribution_id

  • Terms user query Changes in unit price in purchase order and a/p invoice

    Dear sir
         please give me a term user query for , if any changes in unit price in purchase order and a/p invoice

    Hi,
    Try this:
    SELECT  Distinct ' true'
    FROM adoc T2
    JOIN ado1 T0 ON T2.docentry = T0.docentry AND T2.Objtype = '22'
    JOIN por1 T1 ON T1.docentry = T0.docentry AND T1.Linenum=T0.Linenum
    WHERE  $[$38.14.number] != T0.Price
    Thanks & Regards,
    Nagarajan

  • Possible Bug? SQL query changing the Cursor Type from Scrollable to non Scrollable in a ResultSet

    Hi all,
    I've been beating my head against this for a few days now, and while
    there is a workaround, I haven't found out what's causing this to
    happen.
    Every other SQL query except for this one particular query works fine
    and returns a scrollable result set. That one query on the other hand,
    returns a non-scrollable result set.
    Here's the code which is calling the query:
    sqlStatement = getSQLFromFile();
    debug("SQL statment = " + sqlStatement);
    stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    debug(sqlStatement);
    rst = stmt.executeQuery(sqlStatement);
    debug("The type is " + rst.getType());
    rst.last();
    For most queries, the output is "The type is 1004" - which means the
    resultset is scrollable - as it should be.
    For one particular query, the output is "The type is 1003" which means
    that the result set is of type forward-only.
    Of course, calling rst.last() fails in the second case.
    If the difference between the queries was drastic, I might have
    something to go on. I've tested this out with different size queries,
    but the switch between having the type incorrectly changed is the
    deletion of a 0x0a 0x0d on the first line.
    I.E. this means the failing query reads :
    "select
    from........."
    and the query which works reads
    "select *
    from........."
    I've looked at the failing query in it's binary format, and that's the
    only difference I can discern.
    To further confuse things, there are other queries which have a
    similar format - and which work.
    I've read about a bug in Weblogic 5.1 SP9 which ignores the setting of
    the Statement to return a ResultSet with a scrollable cursor, and
    while this seems to be a bug, it doesn't seem the same bug at all -
    besides, I'm using Weblogic 6.0 with SP1 on a W2K system.
    Does anyone have any ideas as to what might be causing this? I'm
    stumped..

    Ryan D'Silva wrote:
    Hi Joe,
    I'm using the Oracle thin driver -
    oracle.jdbc.driver.OracleDriver - version #8.1.6.0.0
    and the DBMS is
    "Oracle9i Enterprise Edition Release 9.2.0.2.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.2.0 - Production"
    Does that help?Yes. Two things: TYou should probably upgrade the oracle thin
    driver, by downloading the latest appropriate one from their site,
    and make sure it's ahead of all weblogic jars in the classpath the
    server builds for itself. Also, let's see how simple we can make the
    problem. Would you please repeat the JDBC that demonstrated the problem,
    in a small standalone java program that uses a direct thin driver connection,
    getting weblogic out of the picture? (The problem does sound like
    and oracle driver issue).
    Joe
    >
    >
    Thanks,
    - ryan
    You don't say what DBMS and what JDBC driver you're using for the pool.
    That is likely to be the issue. Let me know.
    Joe
    Here's the code which is calling the query:
    sqlStatement = getSQLFromFile();
    debug("SQL statment = " + sqlStatement);
    stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    debug(sqlStatement);
    rst = stmt.executeQuery(sqlStatement);
    debug("The type is " + rst.getType());
    rst.last();
    For most queries, the output is "The type is 1004" - which means the
    resultset is scrollable - as it should be.
    For one particular query, the output is "The type is 1003" which means
    that the result set is of type forward-only.
    Of course, calling rst.last() fails in the second case.
    If the difference between the queries was drastic, I might have
    something to go on. I've tested this out with different size queries,
    but the switch between having the type incorrectly changed is the
    deletion of a 0x0a 0x0d on the first line.
    I.E. this means the failing query reads :
    "select
    from........."
    and the query which works reads
    "select *
    from........."
    I've looked at the failing query in it's binary format, and that's the
    only difference I can discern.
    To further confuse things, there are other queries which have a
    similar format - and which work.
    I've read about a bug in Weblogic 5.1 SP9 which ignores the setting of
    the Statement to return a ResultSet with a scrollable cursor, and
    while this seems to be a bug, it doesn't seem the same bug at all -
    besides, I'm using Weblogic 6.0 with SP1 on a W2K system.
    Does anyone have any ideas as to what might be causing this? I'm
    stumped..

  • Dynamic Query Change in WAD

    Hi All,
    We have a requirement where we need to display different queries based on current date.
    If the month is having 30 days, one query needs to be picked dynamically and if month is having 31 days, one more query needs to be picked up.
    Similarly for months with 28 and 29 days.
    Please let me know  whether we can do any changes in WAD to pick up queries dynamically or any other procedure to achieve this.
    Thanks,
    Gayathri

    Hi,
    Why you need 4 queries just for a days change ? what is the business requirement ? It could be solved in a simpler way.
    Sankar Kumar

  • BEX Query Changes are not Reflecting in WAD

    Hello SDN Experts,
    I'm  Facing a Typical Weird Issue. We got an Requirement to Create a New Variable in a Exisitng BEX Query. Assume that we have already a Variable on 0VENDOR. So I have Removed that Variabale and Added new Variable which was created by myself. So when I execute the Query I;m gettign displayed the new Variable wihch is working fine.
    But the problem is with WAD. WAD is showing both the old and new Variables. So in selection paramater it is displaying two 0VENDOR variables instead of showing one.
    Could you please Guide me how can the BEX Changes will get reflected in WAD report as well ???
    Your advice are highly appreciated
    Regards,
    Aluri

    Hello Hemanth,
    This issue may be because you only removed variable but didn't change the 'input ready' settings of it.
    Steps, go back to removed variable -- properties --- details -- then deselect 'variable is ready for input' -- save and exit -- try WAD report..
    Hope this will help.
    Thanks.

  • Query changes are not reflecting

    Hi All,
    Scenario: We have changed in Query from Query Designer in BED system and moved to Quality system but the changes are not reflecting. After checking tables RSRREPDIR and RSZCOMPDIR, we found out the information as below:
    Note: Production System - BEP
    Quality - BEQ
    Development - BED
    We have 2 issues with Queries in different systems as below:
    Issue 1: Query name: T01
    Issue 2: Query name: T02
    Issue1:
    Table - RSRREPDIR
    BEP -
    COMPUID : 4U2P65LLZVYUZLGQFYPVZ1R2M   (also present in table - RSZCOMPDIR)
    GENUNID : 4U2QC61SREY9HKJFVEHM894CU
    BEQ -
    COMPUID : 4T6BTKW1X3RYN7H2UO4WMLWLQ   (also present in table - RSZCOMPDIR)
    GENUNID : 4T6BUM0LKCPAO5H71ZG983P72
    COMPUID : 4U2P65LLZVYUZLGQFYPVZ1R2M   (also present in table - RSZCOMPDIR)
    GENUNID : 4U2QC61SREY9HKJFVEHM894CU
    BED -
    COMPUID : 4T6BTKW1X3RYN7H2UO4WMLWLQ   (also present in table - RSZCOMPDIR)
    GENUNID : 4T6BUM0LKCPAO5H71ZG983P72
    COMPUID : 4U2P65LLZVYUZLGQFYPVZ1R2M   (not present in table - RSZCOMPDIR)
    GENUNID : 4U2QC61SREY9HKJFVEHM894CU
    Issue2:
    Table - RSRREPDIR
    BEP -
    COMPUID : 4U18JA5FD2PB9ZB1RS0PWS5E6   (also present in table - RSZCOMPDIR)
    GENUNID : 4U188U6N2623QPCTMC43MFOZY
    BEQ -
    COMPUID : 4T6MDKABLUBC46HOKZMC0K6KU   (also present in table - RSZCOMPDIR)
    GENUNID : 4T6MEWPZ6178KB4LDKDREY34E
    COMPUID : 4U18JA5FD2PB9ZB1RS0PWS5E6   (also present in table - RSZCOMPDIR)
    GENUNID : 4U188U6N2623QPCTMC43MFOZY
    BED -
    COMPUID : 4U18JA5FD2PB9ZB1RS0PWS5E6   (not present in table - RSZCOMPDIR)
    GENUNID : 4U188U6N2623QPCTMC43MFOZY
    but in Table - RSZCOMPDIR
    BED -
    COMPUID : 4T6MDKABLUBC46HOKZMC0K6KU  
    GENUNID : 4T6MEWPZ6178KB4LDKDREY34E.
    Please suggest which query element and from which table we should remove to have a sync with all systems.
    Thanks in advance!!
    Regards,
    Niranjan Chechani

    If possible can u Compare  Bex queries in All 3 systems Using RSRTQ tcode, Either they are matching or not?
    How to compare using RSRTQ  u can Refer Below :
    Compare Bex Queries in Different Client /System.
    Regards,
    Seshu.P

Maybe you are looking for

  • Acrobat Pro 9 freezes when trying to edit preferences

    I have Acrobat Pro 9.3.4 When I try to Edit-> Preferences, the application locks up.  It eventually goes to 'not responding" and I have to kill it using Task Manager. I found this problem when I was troubleshooting a customer's issue where he could n

  • Using CORR function with sub-queries

    I need to compute the correlation of two datasets, however here is my problem: The table stores responses to a questionnaire, with these columns: RESPONSE_ID, QUES_ID, ANS_CD What my query needs to get is the Correlation of 2 sets of ANS_CD, one with

  • BW load - support Spanish characters

    Hi, Our ECC system supports English and Spanish languages. We have a situation when Mexican vendor (created in English on ECC)  has Spanish character   ó    in the field name (LFA1-NAME1). This record failed on BW side saying u201CVersion 'RADIOMÓVIL

  • Is the standard C++ library provided in Solaris 9 thread-safe?

    Hi, I cannot find any documentation anywhere that says that the standard C++ library in Solaris 9 (provided by Rogue Wave) is thread safe. I have seen evidence that makes me think it is not - however, I was wondering if anyone could provide any insig

  • New page in smart forms

    Hi,        I have requirement of displaying each record of an internal table on individual pages.When iam trying to include command line inside the main of table its giving error saying explicit page breaks not allowed.Any pointers regarding this plz