Query IN SAP B1

Hello All,
Please help how I can create consumptiom query in sap B1 , I need to create with fields:
1. Catalog number
2. Description
3. Stock hand (up to day)
4. A single cost
5. Sum of stock (single cost * stock)
6. consumption per month
7. Stock years (stock/consumption (average)12 month)
8. group mane
9. sum of open purchase order
10. sum of open order
Please Help
Best Regards
Diana

Dear,
Create Self defined Logistic Information System,
Regards,
kapil

Similar Messages

  • How to write a SQL query in SAP B1 2007 B with input parameters?

    How to write a SQL query in SAP B1 2007 B with input parameters, on execution of which will ask for some input value from the user and the values will be selected from a list such as item list?

    The syntax like
    SELECT * FROM OITM T0 WHERE T0.ItemCode = '[%0\]'
    Thanks,
    Gordon

  • Error in while running a query in SAP B1

    Hi All,
    I am creating one Q-PLD so i have to run the following query. Query is working fine in SQL Server
    But while running with SAP B1 showing error 'Cant convert into varchar to small int'
    Query is
    Select (select M1.[GroupName] from OCRG M1 where M1.[GroupCode] = T2.[GroupCode]) As 'State',
    T0.[CardCode] AS 'Customer Code',T0.[CardName] AS 'Customer Name',T4.[U_SchNo] As 'Scheme Ref No',
    T1.[U_Itmgrp] AS 'Item Group',T1.[U_TAdvAmt] AS 'Actual Adv',T0.[DocDate] As 'Doc Date',
    T0.[DocNum] AS 'Invoice No.',T1.[U_QtyKgs] AS 'Qty In KG',T1.[U_CAdvRate] AS 'Advance Rate',
    T1.[U_DedAdvA] AS 'Actual Adv. Adj.',T1.[U_BalAdvA]- T1.[U_DedAdvA] As 'Balance'
    from [dbo].[OINV] T0  INNER JOIN [dbo].[INV1] T1 ON T0.DocEntry = T1.DocEntry
    INNER JOIN [dbo].[OCRD] T2 ON T0.CardCode = T2.CardCode
    INNER JOIN [dbo].[OCRG] T3 ON T2.GroupCode = T3.GroupCode
    LEFT OUTER JOIN [dbo].[@CUSTAMT] T4 ON T0.[CardCode] = T4.[U_Custcode]
    And T1.[U_Itmgrp] = T4.[U_Itemgrp]
    Where T0.[DocDate] between '[%0]' And '[%1]' And
    T0.[CardCode] between '[%2]' And '[%3]'
    And T1.[U_Itmgrp]  between '[%4]'  And '[%5]'   ' This line i am getting error
         ' If i this line will remove error will disappear or i will pass parameter directly like 'ItemGrop1'
    And T3.[GroupName] between '[%6]' And '[%7]'
    By
    Firos C

    Hello Firos,
    Now, first I assume that the t1.[U_Itmgrp] refers to the [ItmsGrpCod] in the OITM.
    I have tested this simple query in SAP Business One (Query Generator) as your query uses user defined fields I do not have in any database here.
    If this is the case you need the number associated with the item group name. This is the 'ItmsGrpCod' and you can find it in table OITB, therefore I would suggest to add this table to the query and search for the ItmsGrpNam that is the one that appear in the Item Master Data. E.g.:
    SELECT T0.[ItemCode] FROM OITM T0  INNER JOIN OITB T1 ON T0.ItmsGrpCod = T1.ItmsGrpCod WHERE T1.[ItmsGrpNam] = 'server'
    If this is the wrong assumption please consider CAST, but in this case you would need something similar to this:
    CAST ([U_PriceKG.NUMBER ]AS NUMERIC(19,6))
    Hope this helps, but if it doesn't can you please tell me what kind of values you have in U_Itmgrp and if it is written by the user or there is a formatted search?
    Thank you for your information.
    Marcella Rivi
    SAP Business One Forums Team

  • Select query in SAP SCRIPT

    Dear Experts,
    In printing of MB23n , I need to print STR_SUPPL1 and STR_SUPPL2 from ARDC table. I already have ADDRNUMBER.
    We are using SAP SCRIPT.
    Please guide me how to insert the following query in SAP SCRIPT.
    tables: lfa1, adrc.
    data: begin of it_test occurs 0 ,
    str_suppl1 like adrc-str_suppl1,
    str_suppl2 like adrc-str_suppl2,
    end of it_test.
    select str_suppl1 str_suppl2 into corresponding fields of table it_test from adrc addrnumber = lfa1-adrnr.
    Please hekp me to solve the issue.
    Thanks in advance.
    Regards
    Ankur

    Hi,
    In Script - Page Window -
         PERFORM <form name> IN PROGRAM <Program Name>
         USING &VBDKR-VBELN_VL&
         USING &VBDKR-VBELN_VAUF&
         CHANGING &ADDR_LINE1&
         CHANGING &ADDR_LINE2&
         CHANGING &ADDR_LINE3&
         CHANGING &ADDR_LINE4&
         CHANGING &ADDR_LINE5&
         ENDPERFORM
                         &ADDr_line1&&ADDR_LINE3& &ADDr_line2&
         &ADDR_LINE4&
         PROTECT
         &ADDR_LINE5&
         ENDPROTECT
    In SE38 - Create Prog as Subroutine pool --> Write a Form with same name
    SELECT SINGLE adrnr INTO twlad-adrnr FROM twlad WHERE werks = lips-werks AND
                                                              lgort = lips-lgort.
        IF sy-subrc = 0.
          CALL FUNCTION 'ADDRESS_INTO_PRINTFORM'
            EXPORTING
              address_type            = '1'
              address_number          = twlad-adrnr
            IMPORTING
              address_printform_table = lt_address.

  • Query in SAP don't shows more than 2 decimals

    Hi!
    I'm trying to create a query that shows the Currency for each operation by day, in this case are the payments, the operations. But the problem is that my query get all the payments when the paymeny is by local currency and foreign currency, i mean when is dollars and when is pesos, so even when the payments are in pesos whe need to get the currency of the dollar at these day, so my query get the currency from the table of the currencies when is in pesos and when is in dollars it get the currency from the payments table, so this is my query.
    Reporte de Pagos
    /SELECT FROM OINV T1/
    DECLARE @FECHA AS DATETIME
    /* WHERE */
    SET @FECHA = /* T1.DocDate */ [%0]
    /SELECT FROM OINV T2/
    DECLARE @FECHA2 AS DATETIME
    /* WHERE */
    SET @FECHA2 = /* T2.DocDate */ [%1]
    SELECT DISTINCT T0.[DocNum],T1.[DocEntry],T2.[NumAtCard],T0.[CheckAcct],T0.[DocType],T0.[Canceled],T0.[CardName],T0.[DocDate],
    CASE
    WHEN T0.[DocCurr] = 'USD' THEN T0.[DocTotalFC]
    WHEN T0.[DocCurr] = 'MXP' THEN T0.[DocTotal]
    END AS 'Total'
    CASE
    WHEN T0.[DocRate] = 0 THEN (SELECT CAST(T3.[Rate] AS float) FROM ORTT T3 WHERE T3.[RateDate] = T0.[DocDate])
    WHEN T0.[DocRate] <> 0 THEN CAST(T0.[DocRate] AS float)
    END AS 'T.C.'
    ,T0.[DocCurr],
    (SELECT T4.[SlpName] FROM  OSLP T4 WHERE T4.[SlpCode] = T2.[SlpCode]) AS 'Vendedor'
    FROM ORCT T0 
    INNER JOIN RCT2 T1 ON T0.DocNum = T1.DocNum
    INNER JOIN OINV T2 ON T1.[DocEntry] = T2.[DocEntry]
    WHERE T0.[DocDate] >= @FECHA
    AND T0.[DocDate] <= @FECHA2
    The real problem is that with this, the query just bring me 2 decimals in the currency and i need at least 4 decimal, i don't know what happen because if i run the query in the SQL Management Studio the decimals are correct it brings me more than 4 decimals, but when i run the same query inside SAP Query Manager it brings me just 2 decimals.
    How can i fix that?
    Hope you help me.
    Thanks in advance
    Regards!
    Xavier

    Xavier,
    This is because the decimal place setting in General Settings > Display tab is 2 decimals.  Similar question has been raised a few times on this Forum and I will send you the link when I find it.
    In the meanwhile the hint is to use CAST function.
    Link for the thread  Rounding in Query Generator
    Suda

  • Query in sap

    hi
    is there any application
    in which we can run query as we do in sql
    like if i want to fetch records from two tables as
    select a, b , c from tablea and table b
    where something like that
    can we directly execute any query in sap?
    plz help me with step by step solution

    hi
    go thru the following tutorial on ABAP Query
    http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_FunctionalAreas_WithoutLogicalDB.asp
    <b>reward points for useful ans</b>
    Regards
    Aarti

  • Mapping query in SAP PI

    Hi Experts,
    I have a mapping query in SAP PI. Actually I am mapping the source and target fields, now the problem is.
    The sender filed is subnode of the main node, and I have mapped the two main nodes in the sender and receiver together.
    Now, whether the sender main node comes all the subnode values will come or do we need to do something else for it.
    Both the sender and target main nodes and subnodes can have multiple repetations.
    I think One to One mapping wont do in this case. What needs to be done please help??
    Thanks and regards,
    Aniruddha

    Hi Vijay,
    Thanks a lot.I will try this out. Can you help me in another mapping problem, the req. is that i need to map the source and the target.
    The condition basically is :
    If no value in LIFEX use VBELN to map to a single target field.
    But I wont use UDF in this case.
    Please help.
    Regards,
    Aniruddha

  • We are interested to know how/where to check query runtimes for any Query in SAP BW?

    We are interested to know how/where to check query runtimes for any Query in SAP BW?
    Is there any table or program to get the query run time details per query for a particular day.

    Hello Sravan,
    Bex statics tables would be 'RSDDSTATHEADER','RSDDSTATINFO' & 'RSDDSTATEVDATA'. all these can found in one view 'RSDDSTAT_OLAP'.
    above can give historical statistic.
    For current Query statics : T-code RSRT, and select debug mode select display statistics and then execute.
    Once you get the output press F3(one step back), there you can see statics of the query for that particular execution.
    Thanks,
    Mallikarjuna

  • How to find Tables behind a Custom Query in SAP

    Hi Gurus,
    Can anyone please help me find tables behind a custom query in SAP.
    Regards
    As

    Hi
    Check the name of the programm assigned to transaction, it should be like this:
    AQZZ<user group>=======<query name>======
    or
    AQIC<user group>=======<query name>======
    It depends of the query area is global or cross-client
    So run SQ01, select the quey area, select the quey group and so your query: now you can see the infoset and then you see it by SQ02 transaction
    Max

  • How to search roles by Query in SAP BW?

    how to search roles by Query in SAP BW?

    Use SUIM with option roles with Auth object and put S_RS_COMP or S_RS_COMP1 here u can put the query for which u want role.

  • Advantages of BW Query in SAP Portal when compared to WEB BEx Analyzer

    Hi
    What are the advantages of having a BW Query in SAP Portal when compared to WEB BEx Analyzer
    I had to presention to higher managers of having a SAPPortal for BW report that WEB BEx Analyzer
    can any one please update me with few points (10-20) that will be useful for my presentation
    screen to geethikakrishna->gmail
    Thanks in advance

    Hi Krishna ,
    I think you should highlight the portal role in presentation
    Now a days all organizations using sap portal as their user interface. We can login portal once and we can get all the information from bw,crm...sap systems and non sap systems.
    so no need to login each and every system individually.
    The portal offers a single point of access to SAP and non-SAP information sources, enterprise applications, information repositories, databases and services in and outside your organization—all integrated into a single user experience. It provides you the tools to manage this knowledge, to analyze and interrelate it, and to share and collaborate on the basis of it.
    With its role-based content, and personalization features, the portal enables users—from employees and customers to partners and suppliers—to focus exclusively on data relevant to daily decision-making processes
    For all information on portals refer to help.sap.com->documentation->netweaver->Netweaver2004->English
    IN people integration you will find information on portals
    http://help.sap.com/saphelp_nw04/helpdata/en/19/4554426dd13555e10000000a1550b0/frameset.htm
    check below threads for some information
    easiest way to publish
    Easiest way to post existing BW queries onto portal
    http://help.sap.com/saphelp_nw04s/helpdata/en/43/92dceb49fd25e5e10000000a1553f7/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/9d/24ff4009b8f223e10000000a155106/frameset.htm
    Execution of BW Reports Through Enterprise Portal
    Best Practices for BI Report publishing on Portal - BI 7
    Use of BI's Enterprise Portal
    The web application designer offers rich functionality for creating dashboards. In SAP NetWeaver BI 2004s (aka 7.0), when you publish a template it is automatically created as an iView for the portal.
    SAP NetWeaver 2004s BI - Define your Publishing Strategy Part 1
    Koti Reddy

  • Cannot save query in SAP 2007 Patch 11

    Hi,
    I urgently need assistance here.
    We have created a query in SAP B1 2007 Patch 11.  However, when we save the query, we received the following error.
    'To generate this document, first define the numbering series in the Adminsitration module'.
    To make it slight completed, we copy some queries from another company using Copy Express.
    Your advice is highly appreciated.

    Dear,
       Please give the link to download PL15
    Thanks in advance
    Gauraw

  • ABAP Query and SAP quary

    What is the diff between ABAP Query and SAP quary?

    Balu,
    SAP Query
    Purpose
    The SAP Query application is used to create lists not already contained in the SAP standard system. It has been designed for users with little or no knowledge of the SAP programming language ABAP. SAP Query offers users a broad range of ways to define reporting programs and create different types of reports such as basic lists, statistics, and ranked lists.
    Features
    SAP Query's range of functions corresponds to the classical reporting functions available in the system. Requirements in this area such as list, statistic, or ranked list creation can be met using queries.
    All the data required by users for their lists can be selected from any SAP table created by the customer.
    To define a report, you first have to enter individual texts, such as titles, and select the fields and options which determine the report layout. Then you can edit list display in WYSIWYG mode whenever you want using drag and drop and the other toolbox functions available.
    ABAP Query, as far as I Believe, is the use of select statements in the ABAP Programming. This needs a knowledge of Open SQL commands like Select,UPdtae, Modify etc. This has to be done only by someone who has a little bit of ABAP experience.
    To sum up, SAP queries are readymade programs given by SAP, which the user can use making slight modification like the slection texts, the tables from which the data is to be retrieved and the format in which the data is to be displayed.ABAP queries become imperative when there is no such SAP query existing and also when there is a lot of customizing involved to use a SAP Query directly.
    Check out these links.
    http://help.sap.com/saphelp_46c/helpdata/en/35/26b413afab52b9e10000009b38f974/content.htm
    http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Introduction.asp
    Step-by-step guide for creating ABAP query
    http://www.sappoint.com/abap/ab4query.pdf
    ABAP query is mostly used by functional consultants.
    Kindly reward points by clicking the star on the left of reply,if it helps.Kindly close your previous threads if your problem is solved and reward points for helpful answers.
    Don't forget to reward if useful...

  • Adhoc Query Vs SAP query

    Hi friends,
    Is there any difference between Adhoc query and SAP query.

    ADHOC QUERY:-
    Web item that enables you to create and change ad hoc queries in a Web application. You can use the Web item Ad-hoc Query Designer in the Web Application Designer to design Web applications in which you can create or change queries.
    SAP QUERY:-
    A tool that allows users who have no knowledge of the ABAP programming language to define and execute their own reports.
    To determine the structure of reports in SAP Query, you just have to enter texts, and select fields and options. If necessary, you can edit lists using Drag&Drop and the functions in the available toolbars.
    bye
    Naveen

  • "Error #2032" while trying to import BEx query through SAP Netweaver BW connection in Dasboard

    Hi Team,
    BO server version: 4.1 SP3 Edge edition
    Dasboard Version: 4.1 SP3
    BI Version: NW 7.4 SP7 (ABAP only)
    We are getting Error #2032 while trying to import BEx query through SAP
    Netweaver BW connection in dasboard Xcelsius.
    Please suggest to sovle this error.
    Regards,
    Vinay Shrimali

    There are several notes about this error - please see http://service.sap.com/sap/support/notes/1856691
    http://service.sap.com/sap/support/notes/1801130

Maybe you are looking for

  • "The ipod "ipod" cannot be updated because ......

    I am unable to update my ipod nano and get the message "The ipod "ipod" cannot be updated because there is not enough free space to hold all of the songs in the selected playlists." Huh? I have the 4GB nano and currently have 3.55GB used and 181MB fr

  • Ntsc hi8 to fce1, shot in pal

    Has anyone had problems with capturing Hi 8 (SP) video on Final Cut Express? I seem to be able to pull the video up in the capture window but its lke jerky but looks ok on a external switchable monitor, it's a Samsung HI 8 SCL 700 NTSC 8mm, in the me

  • Debugging: How can I find out what fires "Login-prompt"

    Hello! I'm writing an applet which reads 2 files on the server. The files are "above" .htaccess, and I don't have to enter username/password to read them. However, I DO get promptet for u/p when the applet loads. How can I possibly find out what gene

  • Duplicate TIFF files when using "Edit in PS CS5"

    Hello there, I'm using LR 4.3 and CS5, with ACR 6.7 installed. Whenever I'm using "Edit in PS CS5" comand inside LR, automatically I'm getting a duplicate TIFF file added to my LR catalog. How can I avoid this? Thank you for your time!

  • Many problems installing Quicktime+iTunes

    (Keep in mind I have windows 7 64 bit) I need the firmware update for my iPhone 3g, which normally I avoid because I always seem to have a problem with quicktime installing properly. But since a couple up my apps needed to work, I gave in. When I tri