SAP B1 Query - assistance needed

Dear Experts,
We are working on cash flow forecasting model, i.e going forward 12 months, which in written in MS Excel. We update it with actual data recorded in SAP B1 (Ver 8.8 PL18)  A manual process.
Was wondering if we can get a single query written which will provide the following data:
Sales and Purchases by BP in a given time (user specified)
BP Code
BP Name
Type of Document (i.e invoice. credit memo)
Date of the document
The value of the document (Gross including any taxes)
Collections and Payments of to/from BP in a given time (user specified)
BP Code
BP Name
Document Type (i.e receipt or payment)
Document number the reciept or payment is related to to i.e the invoice that is being paid or receipted
Date pf payment/receipt
Amount
Thank you in advance.
Regards
Raj

Hi,
Try this:
SELECT distinct T0.[CardCode], T0.[CardName], T0.[DocNum] as Invoice#, T0.[DocDate], T0.[DocTotal], T3.[DocNum] as Credit#, T3.[DocDate], T3.[DocTotal] FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry left join  RIN1 T2 on  T2.[BaseEntry]  = t0.docentry and  T2.[BaseLine]  =  T1.[LineNum] left JOIN ORIN T3 ON T2.DocEntry = T3.DocEntry WHERE T0.[DocDate] between [%0] and [%1]
2. It is not possible to get invoices in single query.
Advice, your sales and purchase process to understand and write query.
Thanks & Regards,
Nagarajan

Similar Messages

  • Query Assistance Needed - Please

    Monthly Training Table
    >> monthly_training.record_id (int)
    >> , monthly_training.trng_year (int)
    >> , monthly_training.trng_month (int)
    >> , monthly_training.trng_title (varchar)
    >> , monthly_training.trng_code (varchar)
    >> , monthly_training.trng_narrative (longtext)
    Training Completed Table
    >> training_completed.record_id (int)
    >> , training_completed.recorded_by (varchar)
    >> , training_completed.emp_id (varchar)
    >> , training_completed.trng_year (int)
    >> , training_completed.trng_quarter (int)
    >> , training_completed.trng_month (int)
    >> , training_completed.trng_date (date)
    >> , training_completed.trng_category (varchar)
    >> , training_completed.trng_sub_category (varchar)
    >> , training_completed.trng_code (varchar)
    >> , training_completed.trng_start_time (time)
    >> , training_completed.trng_stop_time (time)
    >> , training_completed.trng_hours (decimal)
    DB = MySQL -- CF8
    emp_id = B1200 < stored in cookie at login
    Scenario –
    Monthly Training Table - contains scheduled training for an
    entire year. This training is displayed on a page per the month the
    training should be completed in.
    Training Completed Table – contains the information of
    what training was completed per individual.
    Task At Hand – I would like to display the monthly
    scheduled training for the current year and cross reference the
    completed training table and if the individual has completed the
    training further display something next to the training title, to
    signify completed.
    Example:
    Computer Training – Outlook
    * Off. Dev. – Emergency Scene Safety
    Fire Suppression – Salvage
    I have tried many methods of querying this but have not been
    able to achieve the goal. Perhaps I am making this harder than it
    needs to be. Hopefully someone in the forum can shed some light on
    what I should be doing. Assistance would be greatly appreciated.
    Leonard

    yes, i see it now - the WHERE clause makes sure only
    completed training
    of that employee are selected... my bad - i should have
    changed that
    after you told me that emp_id field was in tc table, not
    mt...
    ok, here we go... this will be a little more complicated...
    try this beast:
    <cfquery name="rs_trng_ck" datasource="#datasource#">
    SELECT mt.trng_title, mt.trng_month, mt.trng_code,
    tcsq.completed
    FROM monthly_training mt
    LEFT JOIN
    (SELECT tc.trng_code AS completed
    FROM training_completed tc
    WHERE tc.emp_id = <cfqueryparam cfsqltype="cf_sql_varchar"
    value="#emp_id#">) AS tcsq
    ON
    mt.trng_code = tcsq.completed
    WHERE mt.trng_year = YEAR(NOW())
    ORDER BY mt.trng_month, mt.trng_title
    </cfquery>
    basically, what this does is uses a sub-query in the FROM
    clause to
    pre-select only those records from tc table where emp_id
    field equals
    the #emp_id# value, and only then left-joins the mt table to
    this
    sub-query recordset, which should result in ALL records from
    mt table
    and only those from tc table where emp_id is correct
    the <cfoutput ...> part shoudl stay the same as before.
    hope this one works :)
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com

  • UCCX SQL query assistance needed.

    Hello,
    I am working on a SQL query that does a lookup of the calling number and the last four digits entered by the customer.  If I hard code the lastFourGC variable I am able to return a successful result.  If I use $lastFourGC I get the following error.
    $callingNumber  - Is exactly that, the calling number.
    $lastFourGC - Is the last four digits collected from the customer.
    SELECT * FROM GiftCardFulfillment WHERE Phone=$callingNumber and Right (GiftCard16DigitNumber, 4)=$lastFourGC

    Tanner,
    I had tried that with single and double quotes and it didn't work.  I did end up getting it to work by rearranging the order.  I'm not sure why that worked, but this is what the query looks like now and it works.
    SELECT * FROM [leads].[dbo].[GiftCardFulfillment]   
             WHERE Right (GiftCard16DigitNumber, 4)=$lastFourGC and Phone=$callingNumber

  • Query assistance needed

    Hi experts,
    I am trying below query to find out all columns which are present more than once i.e which are all common in tables.
    select a.column_name,b.table_name from
    (select column_name, count(*) from sys.all_tab_columns
    group by column_name
    having count(*)>1) a, sys.all_tab_columns b
    where
    a.column_name=b.column_name
    and owner = 'CP'
    order by a.column_name i am getting results.. but i require result something like below:
    column_name    Table_name
    col1           Table1   
                   Table2
    col2           Table1
                   Table4
    col3           Table1
                   Table2
                   Table4Regards
    asp

    select  case row_number() over(partition by a.column_name order by b.table_name)
              when 1 then a.column_name
            end column_name,
            b.table_name
      from (
            select  column_name,
                    count(*)
              from  sys.all_tab_columns
              group by column_name
              having count(*)>1
           ) a,
           sys.all_tab_columns b
      where a.column_name=b.column_name
        and owner = 'CP'
      order by a.column_name,
               b.table_name
    /For example:
    SQL> select  case row_number() over(partition by a.column_name order by b.table_name)
      2            when 1 then a.column_name
      3          end column_name,
      4          b.table_name
      5    from (
      6          select  column_name,
      7                  count(*)
      8            from  sys.all_tab_columns
      9            group by column_name
    10            having count(*)>1
    11         ) a,
    12         sys.all_tab_columns b
    13    where a.column_name=b.column_name
    14      and owner = 'SCOTT'
    15    order by a.column_name,
    16             b.table_name
    17  /
    COLUMN_NAME                    TABLE_NAME
    ACTIVE                         PRODUCTS
                                   TBL_ERRLOG
    ADDRESS                        ADDRESSBOOK_EXT
    ADJ_SALARY                     TESTME
                                   TESTME2
    ARTNO                          ARTICLE
                                   MUTATIONS
    ATTRIBUTE1                     TYPE2_TABLE
    CHANGE_VECTOR$$                MLOG$_EMP
                                   RUPD$_EMPSY.

  • I need to know the user who has created/modified a SAP Bex Query and WAD

    Hi!
    I need to know the user who has created and modified a SAP Bex Query and SAP  Web Application Designer. Does it possible to know this information by a table or view?
    Best Regards
    Ramon Sanchez

    Hi,
    In BEx query, when you click "Queries" to open the query, the list of queries are displayed. Highlight the query, click on the "Properties On/Off' icon(right most on the top), you would see all the details.
    In WAD, before opening the template, click on "Properties On/Off'" icon to see the details.

  • Crystal Report Missing SAP InfoSet, SAP BW Query Connector

    Hi,
    I have installed SAP GUI  for Windows 7.2 (Compilation 2) and Crystal Report 2008 SP2 then following by installed SAP Integration Kits 3.1 SP3 on my workstation. However, when i launch my Crystal Report designer, it do shows SAP toolbar however when i click on one of the icon (eg: Setting) the entire CR will hung and prompt me error and exit automatically.
    Beside that, i could not find any connector for SAP (Eg: SAP InfoSet, SAP BW Query and etc) when i create a new blank report by click on the New Connection.
    Appreciated anyone know this could assist on this.
    Thank You.
    Regards,
    CK

    Hi Ingo,
    Thanks for your prompt reply. I will sort it out and ensure the release version will be the same as Inter Kits.
    By the way, i saw your post regarding the Integration Kits installation and configuration. However, i still need some clarification; appreciated you could assist me on this.
    I have installed SAP BOXI3.1 SP3 on an LINUX machine (Redhat Enterprise 5) and the server was running fine without connecting to BW or SAP eCIBS.
    Now, i have to establish the connectivity to BW (InfoCuve and BW Query) and SAP eCIBS system. As my customer requirement was required to using WEBI, CR and Xcelsius for connecting to BW for getting the data and then using scheduler in BOE for performing report distribution. Some of the report will connecting to SAP eCIBS directly and that will using our Client's machine for creating the report (using CR2008) and then publish to the BOE platform for report scheduling and distribution.
    My question, i wish to install SAP Inter Kits and downloaded Inter. Kits for SAP Solution 3.1 SP3 from service market place. When i refer to the document from help.sap.com; there are couple of section but i wish to know which are the perquisite section that i wish to install and configure?
    Eg: System Requirement which are installing SAP RFC SDK and SAP JCO SDK into my BOE server, then following my create a logon token. How to to that? It also require to install SAP Java Connector and SAP GUI, does these two available for LINUX OS as well?
    The steps in doc was confuse, appreciated your kind help.
    THanks.
    Regards,
    CK.

  • Error While Run the WebI Report on SAP BW Query

    Hi
    I have build the universe on SAP BW Query . I built the same universe on the SAP BW DEV and SAP BW Test
    When I tried to run the WEBI Report on the Universe which is built on the SAP BW Test
    WebI Report is prompting for the below values
    Calendar Year
    Profit Center
    Profit Center Hierarchy
    Version.
    Here I can see the List of values for the Calendar Year and Profit Center. Its giving me below error when I look  for list of values for the  Profit Center and Profit  Center Hierarchy.
    u2018Database error: [SOFA Driver] : The operation completed successfully.. Contact your Business Objects administrator or database supplier for more information. (Error: WIS 10901)u2019
    My Questions:
    1.     Why I am getting this error. Because of authentication or configurations set on the Profit Center and Profit Center Hierarchy objects? If so , please let me know what I need to set?
    When I tried to run the same WEBI Report  on universe which build on  SAP BW Dev Query. I can see list of values for the Calendar Year, Version, Profit Center, Profit Center Hierarchy.
    But when I selected the values and tried to run the report. I got below error.
    u2018Query 1 - P&L Structure Monthly_Devtst
    Database error: [SOFA Driver] : The MDX query SELECT NON EMPTY HIERARCHIZE( {[Measures].[4CEX5LZ5571LCZHJBK0L0360P],[Measures].[4CEX5MM6Q2UPWV3VT27LU9261]} )  DIMENSION PROPERTIES PARENT_UNIQUE_NAME ON COLUMNS , NON EMPTY HIERARCHIZE(  { [0CALMONTH].[LEVEL00].MEMBERS }  )  DIMENSION PROPERTIES PARENT_UNIQUE_NAME ON ROWS FROM [ZFIGLPCBM/ZZFIGLPCBM04_Q011] SAP VARIABLES [!V000001] INCLUDING =[0PROFIT_CTR                   1000HCICONS08] [!V000002] INCLUDING =2 [!V000003] INCLUDING =2008 [!V000004] INCLUDING =000 failed to execute with the error Value "0000000002" for variable "Profit Center" is invalid. Contact your Business Objects administrator or database supplier for more information. (Error: WIS 10901)u2019
    My Questions :
    1.     What is this error? Please suggest the solution to run the report successfully.
    Also I am attaching Print Screens of  DEV and Test  reports Prompts and Errors.
    Here I am using Business Objects XI R2 SP4
    I am sorry if I confused you with elaborated explanation, I have very less knowledge of BO and SAP BW .. 
    Please help me with your valuable suggestions.
    Thanks,
    Anitha

    Hi Ingo,
    - the BI Query in the Test system is running correct and all the variables do work ?
         Yes, BI Query is working fine in the Test System and I can see all the variables too
    In BI Query I can see values for  Calendar Year, Version, Profit Center, Profit Center Hierarchy
    - the Universe has all the variables ?
      Yes, Universe has all the variables.
    - do you see values in the Web Intelligence prompts when you run the report ? 
       No,
       I can only see values for the Calendar Year & Version  in the Web Intelligence Prompt.
    When I try to see values for the Profit Center & Profit Center Hierarchy in the Web Intelligence Prompt, its showing below error.
    u2018Database error: [SOFA Driver] : The operation completed successfully.. Contact your Business Objects administrator or database supplier for more information. (Error: WIS 10901)u2019
    I can send you the Print Screens of Prompts & Errors, but i don't know how to attach the file here.
    Thanks,
    Anitha

  • Unable to use SSO with universe connection on top of SAP BW query

    Hi,
    We're creating a universe on top of a SAP BW query by using universe designer.
    We logon to universe designer by using SAP credential.
    When creating the connection, we set the option "Use Single Sign On when refreshing reports at view time" in order to logon to BW server. But when clicking next, an error arises:
    "DBD: Unable to connect to SAP BW server Incomplete logon data"
    The strange thing on this is that there is one laptop which is able to set up this kind of connection, while all other workstations are not able to set it because they recieve that error (we all work against the same BO server). So this looks like an installation issue.
    We reinstalled SAP Integration Solutions on those workstations, but problem is still the same.
    I found thread: Universe Connection Authentication on SAP BW which talks about the same issue, but solution involves uninstalling Xcelsius. But we do need Xcelsius!
    Any suggestions?
    Thanks,
    David.

    >
    Ingo Hilgefort wrote:
    > Hi,
    >
    > - how did you enter the SAP credentials when logging on ?
    username/password with sap authentication
    >
    > - are you using a application server or a message server for the connection ?
    Application server
    >
    > - SAP GUI is installed ?
    SAP GUI 710 patch 11
    >
    > - SAP Integration Kit is installed ? is it a full keycode or a temp keycode ?
    SAP Integration Solutions with temp keycode
    >
    >
    > thanks
    > Ingo

  • SAP BW QUERY AND BOBJ , QUERY VARIABLES

    I have a SAP BW QUERY which Iu2019m trying to get through to BOBJ 4.0 AND CONTINUE TO GET THIS error "getDocumentInformation exception Error WRE 99998.........database error The MDX QUERY SELECT {...} ON CLOUMNS, NON EMPTY UNORDER, DIMESION PROPERTIES ON ROWS from SAP VARIABLES FAILED TO EXECUTE WITH ERROR for characteristic 0FISCYEAR, enter year in specified format(IES10901)
    We using BOBJ 4.0 AND IDT TO CREATE connections to query...
    In SAP BEX ANALYZER the query runs and returns results without any issues, but in u201CQUERY AS A WEB SERVICEu201D and u201CWEB SERVICEu201D we get THE above error ....
    so i removed the variables from the row section and included it in the filter section of query and still i get errors in bobj (This is after going to Transaction RSRT checking the properties TAB and selecting "Use Selection of Structure Elements" and then generating query in SAP BW,
    SOME queries you need to assign variable inputs for certain characteristics to restrict specific data ACCORDINGLY...
    is there a way to come around this?
    are there some docs available that simply describes the method of using a variable input/prompt in a SAP BW QUERY and how to use it in BOBJ?
    Any help would be greatly appreciated
    Thanks in Advance

    personal experience the variables doesnt work properly from query to bobj, remove any calculations in yoru query and variables, you could only use filters in query.. when you bring them in webi then brring the values to the report then create vraibles in it there.
    i keep my query from filtering as well then do everything in webi or xcelsius ..

  • Create SAP B1 Query with Optional User Input Fields

    Hi All... any help is greatly appreciated, I am new to this forum and hope to contribute in the near future once I become more of an expert with B1.
    I have a query I need to build that will search about 10 UDF's. The problem is, I don't know how to make the user input fields optional within the query. Currently, I have the following queries as testing searching 2 UDF"s:
    SELECT T0.[ItemCode], T0.[ItemName], T0.[OnHand] FROM OITM T0 WHERE T0.[U_Quality] = [%0] OR T0.[U_LengthFT] =[%1]
    This query works when leaving one of the user input fields blank. However, the values it provides are wrong because it is an OR statement which will show item codes with a certain quality OR a certain size.
    The following query is the same as above but switched the OR to AND:
    SELECT T0.[ItemCode], T0.[ItemName], T0.[OnHand] FROM OITM T0 WHERE T0.[U_Quality] = [%0] AND T0.[U_LengthFT] =[%1]
    This query provides me with the correct values but will not work if one of the user defined fields is not filled out.
    How do I go about getting the results I want and not having the user fill out all the UDF's for the query to execute properly?

    I think I figured it out
    SELECT T0.ItemCode, T0.ItemName, T0.OnHand
    FROM OITM T0
    WHERE (T0.U_Quality = '[%0]' OR '[$0]' = '0') AND (T0.U_LengthFT ='[%1]' OR '[%1]' = '0')
    SAP must be defaulting empty user input field values to "0"
    I tried the above query and it worked!!!
    Is there anything you can add if I am missing something?
    Thanks, Alec.

  • Connection xcelsius sap bw query

    Hello,
    I am trying to create a connection between xcelsius and a sap bw query. I created a new connection and defined a place for the result of the query but I don't get any data in xcelsius - how do i get data into xcelsius?
    thanks

    Hi Margit,
    In Direct SAP BW Netweaver connectivity , You do not see the data in the spread sheet of Xcelcius.
    Data comes only at runtime.
    You can check wheteher data is coming are not by Mapping a label or any other component and check if it is showing the value correctly when u publish it.
    You cannot preview data using SAP BW Netweaver connectivity.
    You will have to publish it and then Launch it.
    Note :Check the "Refresh befor Components are loaded"  in the Usage Tab.
    Please let me know if you need any further help in this.
    Regards,
    Bhargava Bommidi

  • WebElements with SAP BW Query

    Hi,
    I am trying to use WebElements with SAP BW Query. I need to pass few variables including date. The date variable on SAP side is a standard SAP object that starts with 0. Seems like WebElements is not recognising it, if I use SAP customer defined variable starts with Z then it works fine with Webelements.
    Is there is a way to use SAP standards objects in Webelements?
    Thanks,
    Sajjad Qureshi

    hello,
    you could be experiencing an issue with opendocument and the sap integration kit.
    let us know what happens when you do this:
    A
    1) change the numeric webuilder parameter to 3 (where 3 gives you an alert box showing the opendocument url that is being created)
    2) write down the url
    3) paste the url into a new browser window...
    do you still get the same error / issue?
    B
    1) on your report right click on any object and go to Format > Hyperlink and then use the enterprise hyperlink wizard to create a hyperlink to the same target report
    2) ensure that in the hyperlink wizard that you include a default value to all of the parameter values in the target report
    3) save the report in your enterprise environment and try the hyperlink out
    do you still get the same error / issue?
    jamie

  • Join SAP BW Query with SAP BW Table

    Hello guys,
    we would´need to join a SAP BW Query with information of an SAP BW Table like it is explained in the following example:
    The result of the query is:
    ID         Quantity    Revenue
    4711    10              20
    4713    20              40
    4714    30              30
    The table will look like this:
    ID         Category
    4711    A
    4712    B
    4713    C
    4714    A
    The result should be:
    ID        Category    Quantity    Revenue
    4711    A               10              20
    4713    C               20              40
    4714    A               30              30
    We would like to use the current SAP Business Objects 4.0 or 3.1 environment.
    Is it possible to join these data sources in the universe Designer or in Crystal reports?
    Regards,
    Markus

    Hello Markus,
    the Information Design Tool is able to create a relational Universe on top of InfoProvider which will show the tables from the cube, but the Information Design Tool in the current release is not able to show the tables from the ERP system.
    regards
    Ingo Hilgefort

  • SAP BEx query's Conditions and Exceptions on BO Universe

    We are planning to create Conditions and Exception on SAP BEx Query. And provide this query to BO team for their development
    Could anyone tell me in what form will these BEx objects be visible in BO-Universe ....as detail objects...or query filters and a.s.o?
    Will they be Invisible? If invisible will they be atleast applied to BO-Universe.
    For e,g: I know that, BEx Query filter will be applied to the underlying query but are not visible in OLAP universe.
    - Anil

    Hi,
    Conditions and Excpetions are not supported by OLAP BAPI tehrefore they are not generated in universes or consumed at query level.
    You have to create conditions on measures in universes (except top end bottom exceptions that are not supported).
    Exceptions need to be done at cliient level (Webi, XCelsius, etc).
    I BOE CI 4.0 conditions will be supporte by the Semantic Layer direct acces with BICS but exceptions will continue to be created at client level.
    Didier

  • Prompt List of Values in WebI - SAP BI Variable - SAP BI Query -BI Infoset

    Hi,
    We have a Multiprovider built on an Infoset. SAP BI Infoset is built using 2 DSOs.
    There is a SAP BI Query on top of this Multiprovider.
    Multiple-Single Values type Optional Variables are created for some of the Objects of this SAP BI Query.
    Universe is created on top of this SAP BI Query, using SAP Integration kit.
    WebI is created on top of this Universe.
    Prompts are created on some of the Universe Objects, for the WebI report.
    We are facing a typical problem.
    When a WebI prompt is created on one particular object, (which also has a Multiple Single Value type Optional Variable in SAP BI Query), its List of Values is showing up only first three values in WebI. The SAP BI Variable in BEX Analyzer shows up all the 8 values for the List of Values, for the same object.
    The Output WebI report has more values for the object than shown up in the List of Values & this is the problem.
    We tried to keep the settings in Info-object, DSO, Infoset, Multiprovider = Values in Master Data (for the List of Values).
    Similar objects and similar variables for the same query / webi show all the List of Values.
    Any guidance on aspects to be checked would be helpful.
    regards,
    Rajesh K Sarin

    Problem :
    If an SAP BI Infoset is used in data modelling, and a restricted key
    figure is created in the SAP BI Query; the resultant WebI Object Prompt
    for the Info-object, only shows up LOVs which have been used for the
    restricted Key Figure. Both the things are not related except for the
    fact that some of the values for the same object are used for the
    restricted key figure.
    Details :
    We have a Multiprovider built on an SAP BI Infoset.
    SAP BI Infoset is built using 2 DSOs.
    There is a SAP BI Query on top of this Multiprovider.
    There is a restricted key figure in the sap bi query. KeyFigure "Number
    of Records" is restricted for 3 of the relevant Info-object "Meter
    Reading Status" values.
    Universe is created on top of this SAP BI Query, using SAP Integration
    kit. WebI is created on top of this Universe.
    Prompt is created on the Universe Object for Meter Reading Status, in
    the WebI report.
    List of Values is showing up only the three values in WebI (which were
    used in the Restricted Key Figure calculation).
    SAP BI Variable in BEX Analyzer for the same Info-object Meter Reading
    Status shows up all the 8 values for the List of Values.
    The Output WebI report has more values for the object than shown up in
    the List of Values & this is the problem.
    We have kept the settings in Info-object, DSO, Infoset,
    Multiprovider, Query = Values in Master Data (for the List of Values).
    When we delete the "Restricted Key Figure" from the SAP BI Query, the
    refreshed Universe and Webi have a complete set of List of Values
    applicable.   
    Steps for Reconstruction    
    1. Create Infoset
    2. Create SAP BI Query on Infoset
    3. Create Restricted Key Figure for Number of Records and few of the
    values for a characteristic info-object "X".
    4. Create BO Universe on SAP BI Query
    5. Create Webi on BO Universe
    6. Create a Prompt on the characteristic info-object "X".
    7. Check List of Values for the characteristic info-object "X" in SAP
    BI Query and WebI.
    8. LOVs in WebI are equal to the values used for restriction in the
    restricted key figure.
    9. Delete the restricted key figure from SAP BI Query.
    10. Refresh Universe
    11. Webi prompt shows all the values for the prompt on "X".

Maybe you are looking for