Item groups query

Hi all experts.
I'm wondering if anyone could be so kind to help me with a query.
I would very much like to se total sales amount (based on OINV) for each item group in my database. I'm fully able to get some figures by doing this query:
SELECT distinct T0.[DocNum], T3.[ItmsGrpNam], T0.[DocTotal]
FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry
INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode
INNER JOIN OITB T3 ON T2.ItmsGrpCod = T3.ItmsGrpCod
WHERE T0.[DocDate] >=[%0]
GROUP BY T0.[DocNum], T3.[ItmsGrpNam], T0.[DocTotal]
ORDER BY T3.[ItmsGrpNam]
However, in this query I'm missing totals for each grup - is this possible to achieve?
Thanks and regards, Runar Wigestrand
Edited by: Runar Wigestrand on Nov 3, 2008 11:15 AM

hi runar,
SELECT T3.[ItmsGrpNam],Sum(T0.[DocTotal] )
FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry
INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode
INNER JOIN OITB T3 ON T2.ItmsGrpCod = T3.ItmsGrpCod
WHERE T0.[DocDate] >= '[%0] '
GROUP BY T3.[ItmsGrpNam],T0.[DocTotal]
ORDER BY T3.[ItmsGrpNam]
Jeyakanthan

Similar Messages

  • Sales Analysis query per item group summarized per BP Group

    Dear experts,
    My client is requiring me to create a query that when i select a certain item group it returns a sum/total of sold items in that group per BP group
    format:
    parameter: Item Group A
    BP Group A    1,000
    BP Group B    2,000
    BP Group C   1,000
    I have managed to get total sales per BP Group but i cant seem to figure how to break it down per Item Group
    here is my query:
    SELECT T2.[GroupCode], SUM(ISNULL(T0.Debit,0) - ISNULL(T0.Credit,0)) as "Amount(LC)" FROM JDT1 T0  INNER JOIN OJDT T1 ON T0.TransId = T1.TransId and T0.TransType IN (13,14)
    INNER JOIN OCRD T2 ON T2.CardCode = T0.ShortName
    WHERE T1.[RefDate]  BETWEEN [%0] and [%1]
    GROUP BY T2.[GroupCode]
    how can I link Item Groups to JDT1?

    Hi Carlo
    Try This
    SELECT t5.ItmsGrpNam AS ItemGroup,
       t7.GroupName AS BPGroup,
       SUM(ISNULL(T0.Debit,0) - ISNULL(T0.Credit,0)) AS "Amount(LC)"
    FROM JDT1 T0
    INNER  JOIN OINV T1 ON T0.transid = T1.transid
    LEFT OUTER JOIN INV1 T3 ON T1.docentry = T3.docentry
    LEFT OUTER JOIN oitm T4 ON t4.itemcode = T3.itemcode
    LEFT OUTER JOIN oitb T5 ON T4.ItmsGrpCod = T5.ItmsGrpCod
    INNER  JOIN ocrd T6 ON T0.ShortName = T6.CardCode
    INNER JOIN OCRG T7 ON t7.GroupCode=t6.GroupCode
    WHERE T1.DocDate BETWEEN [%0] AND [%1]
    GROUP BY t5.ItmsGrpNam,
       t7.GroupName
    Rgds

  • Query to generate a report for incoming pending payments as per Item Group!

    Dear All,
    I need a Query to generate a report for incoming pending payments through Item Group.
    Please provide me the same.
    Thanks in advance..........................
    Edited by: Param Deshwal on Nov 22, 2011 7:11 AM

    Hi
         try this
    SELECT T0.[DocNum] as 'Invoice Number', T0.[DocDate] as 'Invoice Date', T0.[CardName], T0.[DocTotal] as 'Invoice Amount', T0.[PaidToDate] as 'Paid Amount',(T0.[DocTotal]-T0.[PaidToDate]) as 'Pending Amount',T3.[ItmsGrpnam] FROM OINV T0 Inner join inv1 t1 on t0.docentry=t1.docentry inner join oitm t2 on t2.itemcode=t1.itemcode inner join oitb t3 on t3.[ItmsGrpcod]=t2.[ItmsGrpcod] where T3.[ItmsGrpnam]=[%0] 
    Regards,
    sudhir B.
    Edited by: B.sudhir on Nov 22, 2011 7:28 AM

  • List item - Record Group Query - Alignment improper Order

    Dear All,
    When am trying to concatenate two columns using record group query and displaying in the list item, the alignment is not in proper order.
    E.g; Below is the columns and data's used in process:
    CODE_VALUE     SHORT_DESC     DESCRIPTION
    ROLL1     Customer - Non accidental     Production, booking with other carrier, bad projection.
    ROLL2     Customer - Accidental     L/C, B/L draft, Customs, Samples, AMS, LAR.
    ROLL3     ABC - Lack of empty     Lack of empty units.
    ROLL4     ABC CDE - Roll over     AGR RRR decision.
    ROLL5     ABC XXX - Accidental     IMO or OOG refused, operational problems, Cut & Run.
    ROLL6     ABC YYY - Fictive booking     Equipment buffer, dummy booking.
    Below is the record group query used in forms:
    PROCEDURE p_when_new_form_instance
    IS
    GROUP_ID recordgroup;
    list_id item := FIND_ITEM ('BLK_CONTROL.LI_ROLL_REASON');
    rg_name VARCHAR2 (20) := 'LI_ROLL_REASONS';
    status NUMBER;
    l_query VARCHAR2 (4000);
    BEGIN
    l_query :=
    'SELECT rpad(short_desc,50,'' '')||'' | ''||description description, code_value code_value FROM codes WHERE code_value IN (''ROLL1'', ''ROLL2'', ''ROLL3'',''ROLL4'',''ROLL5'',''ROLL6'')';
    GROUP_ID := CREATE_GROUP_FROM_QUERY (rg_name, l_query);
    status := POPULATE_GROUP (GROUP_ID);
    POPULATE_LIST (list_id, GROUP_ID);
    EXCEPTION
    WHEN OTHERS
    THEN
    pl_common.when_others;
    END;
    Moreover i have my list item font property by default as ""MS SANS SERIF" and when i run in Forms Builder am getting the alignment as below.
    Result:
    ====
    DESCRIPTION     CODE_VALUE
    Customer - Non accidental | Production, booking with other carrier, bad projection.     ROLL1
    Customer - Accidental | L/C, B/L draft, Customs, Samples, AMS, LAR.     ROLL2
    ABC - Lack of empty | Lack of empty units.     ROLL3
    ABC CDE - Roll over | AGR RRR decision.     ROLL4
    ABC XXX - Accidental | IMO or OOG refused, operational problems, Cut & Run.     ROLL5
    ABC YYY - Fictive booking | Equipment buffer, dummy booking.      ROLL6
    Above order is not the expected result as all the |(pipe) symbol should display in proper order as below.
    Expected Result:
    ==========
    DESCRIPTION     CODE_VALUE
    Customer - Non accidental | Production, booking with other carrier, bad projection.     ROLL1
    Customer - Accidental | L/C, B/L draft, Customs, Samples, AMS, LAR.     ROLL2
    ABC - Lack of empty | Lack of empty units.     ROLL3
    ABC CDE - Roll over | AGR RRR decision.     ROLL4
    ABC XXX - Accidental | IMO or OOG refused, operational problems, Cut & Run.     ROLL5
    ABC YYY - Fictive booking | Equipment buffer, dummy booking.      ROLL6
    I tried with RPAD and LPAD still the alignment issue is there; i know the issue is because of invariable length of the font.
    But is there any solution to override this it will be of great help.
    So please help!!!!!!!!!!!!!!!!!
    Thanks..................
    Regards,
    Sunil.G

    Hi Francois,
    Thanks for your reply. I have tried changing the font to "Courier(Western)" it is working fine.
    But as per the standards defined, it should be "Ms Sans Serif" nothing apart from that.So that is where the problem lies. :(
    Regards,
    Sunil.G

  • Query Problem- trying to group by Item Group

    Hi All
    I am creating a report which details the Item code, Item Description, In stock amount, Commited amount and the Price one particular price list.  I want this to be grouped by the Item Group.  The query below is the one I have created.  It works well until i add anything into the Group by section. 
    SELECT T1.[ItemCode],
    T1.[ItemName],
    T2.[OnHand],
    T2.[IsCommited],
    T0.[Price]
    FROM ITM1 T0  INNER JOIN
    OITM T1 ON T0.ItemCode = T1.ItemCode
    INNER JOIN OITW T2 ON T1.ItemCode = T2.ItemCode
    INNER JOIN OITB T3 ON T1.ItmsGrpCod = T3.ItmsGrpCod
    INNER JOIN OPLN T4 ON T0.PriceList = T4.ListNum
    WHERE T4.[ListName] = 'Selling Prices GBP'
    GROUP BY T3.[ItmsGrpNam]
    I receive the following error when exectued:
    Column 'OITM.ItemCode' is invalid in the select list because it is not contained in either an aggregate function or the GOUP BY clause
    Can anyone help?
    Thanks in advance
    Gail
    Edited by: Gail Patterson on Apr 3, 2008 1:32 PM

    Hi,
    Can u use this query
    SELECT T3.ItmsGrpNam, T1.ItemCode, T1.ItemName, T2.OnHand, T2.IsCommited, T4.ListName, T0.Price
    FROM ITM1 T0 INNER JOIN
    OITM T1 ON T0.ItemCode = T1.ItemCode
    INNER JOIN OITW T2 ON T1.ItemCode = T2.ItemCode
    INNER JOIN OITB T3 ON T1.ItmsGrpCod = T3.ItmsGrpCod
    INNER JOIN OPLN T4 ON T0.PriceList = T4.ListNum
    WHERE T4.ListName = 'Selling Prices GBP'
    It can help u.
    Thanks
    SAGAR

  • Is it possible to list out CATALOG ITEMS GROUP in a Query Result of a Request Offering??

    Hi Experts,
    Is it possible to list out  CATALOG ITEMS GROUP as a result of Query Result in Request Offering ?? Because each and every Catalog Items Groups are being created as a SingleTon Child Class of System.CatalogItemGroup. i.e., Each CatalogItemGroup instance
    will have its own singleton class.
    Is it possible to list out all CatalogItemGroup Instances consolidatedly in the QueryResult Window??
    Though the System.CatalogItemGroup class is an Abstract class, I tried to list out the Classinstances via powershell command as below, which lists all catalog group instances, Note: Actually these are instances of SingleTon
    Child Classes
    "Get-SCClassInstance -Class (Get-SCClass -Name System.CatalogItemGroup)"
    But when I configured the QueryResult window with the "System.CatalogItemGroup" class, it doesn't list out any Group instances in the Porta.......
    Am I missing anything, Any suggestions please???
    Thanks and Regards, Narayana Babu

    Thanks Anton, I already tried that too... But it doesn't list out any Group instances in the Portal.
    Since each Catalog Groups are individual Single ton Class instances derived from "System.CatalogItemGroup" class. Therfore If I specify the internal ID of the abstract class "System.CatalogItemGroup" in the tag below, it doesn't list any in the
    Portal.... But if I specify ID of any one of the derived singleton class, it does displays the one instance of that particular class..
    Thanks and Regards, Narayana Babu

  • Record Group Query - item block

    I need to calculate a Record Group Query using a block item value, but when a use the query below the query didn't return rows:
    SELECT OID_SIIB_FINALIDADE_TED
         , F.COD_FINALIDADE || ' - ' || F.DES_FINALIDADE DES_FINALIDADE
      FROM SIIB_FINALIDADE_TED F
          , ( SELECT P.TP_PARAMETRO
                FROM SIIB_PARAMETROS_GERAIS P  
              WHERE P.NM_PARAMETRO = 'TIPO_' || :BLOCK.ITEMX ) PAR -- using the :BLOCK.ITEMX the query did'nt return data
    WHERE PAR.TP_PARAMETRO = F.TPO_FINALIDADEBut if a use a static query the Record Group( changing :BLOCK.ITEMX for 'STR0005' ) return the desired values.
    This Record Group is used to pupulate a LOV.
    Edited by: user5914526 on Feb 15, 2012 9:26 AM
    Edited by: user5914526 on Feb 15, 2012 9:26 AM
    Edited by: user5914526 on Feb 15, 2012 9:29 AM

    No, it doesn't .
    And return the message: "There aren't data in the List of Values"
    And the block item is not empty or null.
    Edited by: user5914526 on Feb 15, 2012 10:13 AM

  • Hide Particular Item Group from Selection Criteria of Sales Analysis Report

    Hello Experts,
    Is this possible to Hide Particular Item Group from Selection Criteria of Sales Analysis Report?
    I have one Item Group as 'Special Items'.
    Now, when I open  Item wise sales analysis report, I want to hide above mentioned group from selection criteria.
    Thanks in advance.
    Best Regards,
    Pankit Sheth

    Hi,
    1. Not possible to put validation for selection criteria windows.
    2. In standard, I don't think it is possible to hide only one item group.
    3. Alternatively don't give authorization to user for running sales reports. If still need create customized query and ask user run every month.
    Thanks & Regards,
    Nagarajan

  • Open Items List Query.

    Hi all,
    Could you please advise if itu2019s possible to run a query in SAP based on the Open Items List in the reporting area that can detail the following;
    Both AR Invoices and Credit Notes and show additional fields, taken from the AR invoice u2013 Account Manager, Item Group and Project Code?
    The  Project Code and Item Group can be taken from the Item Line however the Account Manager field is located below the item line area on the contents tab.
    Would someone have a query which might enable us to do this or at least give us a directing to go in ?
    Thank you,
    MB

    Hi Matthew,
    You can try this one.
    It will check if the document is open on document level. The query is written so that it will give a result for every line in the document so you might have a problem if there are many line per document. For the account manager I used Sales person, I am not sure if that is what you mean.
    select
    'AR Invoice'+' '+(convert(varchar (10), t0.docnum)) as 'Document',
    (select t7.slpname from oslp t7 where t7.slpcode = t0.slpcode) as 'Account Manager',
    (select itmsgrpnam from oitm t5 inner join oitb t6 on t5.itmsgrpcod = t6.itmsgrpcod
    where t5.itemcode = t1.itemcode) as 'Item Group',
    t1.project
    from
    oinv t0 inner join inv1 t1 on t0.docentry = t1.docentry
    where t0.docstatus = 'o'
    union
    select
    'AR Credit'+' '+(convert(varchar (10), t0.docnum)) as 'Document',
    (select t7.slpname from oslp t7 where t7.slpcode = t0.slpcode) as 'Account Manager',
    (select itmsgrpnam from oitm t5 inner join oitb t6 on t5.itmsgrpcod = t6.itmsgrpcod
    where t5.itemcode = t1.itemcode) as 'Item Group',
    t1.project
    from
    orin t0 inner join rin1 t1 on t0.docentry = t1.docentry
    where t0.docstatus = 'o'
    Let us know if it works out.
    Jesper

  • Sales and Closing Stock By Item Group

    Dear all,
    Can anybody give me modified query for the following code. I need Item Group wise sales & Stock.
    As of this query data values are not getting perfect,opening stock and  Closing stock values are not getting prefect.
    Some items are not getting,which item code is starting form 5%.
    *Start of the Query *
    select * from ( SELECT T0.Itemcode, min(T0.Dscription) as 'Item Description', W1.Whscode,
    (isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate<@FromDate and O1.transtype in (59,20,18,16,14,67,-2)),0) - isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate<@FromDate and O1.transtype in (21,19,60,15,67,-2,13)),0)) as [Opening Stock],
    (isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.inqty>0 and o1.Price >0 and O1.transtype in (20,18)),0))-(isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.outqty>0 and o1.Price >0 and O1.transtype in (19)),0)) as [Purchase Quantity],
    (isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.inqty>0 and o1.Price = 0 and O1.transtype in (20,18)),0))-(isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.outqty>0 and o1.Price = 0 and O1.transtype in (19)),0)) as [Purchase FOC Qty],
    ( isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.outqty>0 and O1.Price>0 and O1.transtype in (13,15)),0)) as [Sale Qty],
    (isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.inqty>0 and O1.Price>0 and O1.transtype in (14,16)),0))as [Return Qty],
    ( isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.outqty>0 and O1.Price>0 and O1.transtype in (13,15)),0))- (isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.inqty>0 and O1.Price>0 and O1.transtype in (14,16)),0))as [NetSale Qty],
    (isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.outqty>0 and O1.Price=0 and O1.transtype in (13,15)),0))-(isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.inqty>0 and O1.Price=0 and O1.transtype in (14,16)),0))as [FOC Quantity],
    (isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.inqty>0 and O1.transtype in (59)),0)) as [StockIN Quantity],
    (isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.outqty>0 and O1.transtype in (60)),0)) as [StockOUT Quantity],
    (isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate<=@ToDate and O1.transtype in (59,20,18,16,14,67,-2)),0) - isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate<=@ToDate and O1.transtype in (21,19,60,15,67,-2,13)),0)) as [Closing Stock]
    FROM OINM T0 INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode INNER JOIN OITW T2 ON T1.ItemCode = T2.ItemCode INNER JOIN OITB B1 ON T1.ItmsGrpCod=B1.ItmsGrpCod INNER JOIN OWHS W1 ON T2.WhsCode = W1.WhsCode INNER JOIN OLCT C1 ON W1.Location=C1.Code and T0.ItemCode Like '5%' and W1.WhsCode not in ( 'WH-DEMO', 'WH-AHM-R','WH-MUM-R','WH-NDL-R')
    Group by T2.MinStock ,T1.itemcode, T0.Itemcode, W1.WhsCode, C1.Location) a
    End of the Query*

    Hi,
    Starting Query ****
    select * from ( SELECT T0.Itemcode, min(T0.Dscription) as 'Item Description', W1.Whscode,
    (isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate<@FromDate and O1.transtype in (59,20,18,16,14,67,-2)),0) - isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate<@FromDate and O1.transtype in (21,19,60,15,67,-2,13)),0)) as [Opening Stock],
    (isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.inqty>0 and o1.Price >0 and O1.transtype in (20,18)),0))-(isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.outqty>0 and o1.Price >0 and O1.transtype in (19)),0)) as [Purchase Quantity],
    (isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.inqty>0 and o1.Price = 0 and O1.transtype in (20,18)),0))-(isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.outqty>0 and o1.Price = 0 and O1.transtype in (19)),0)) as [Purchase FOC Qty],
    ( isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.outqty>0 and O1.Price>0 and O1.transtype in (13,15)),0)) as [Sale Qty],
    (isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.inqty>0 and O1.Price>0 and O1.transtype in (14,16)),0))as [Return Qty],
    ( isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.outqty>0 and O1.Price>0 and O1.transtype in (13,15)),0))- (isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.inqty>0 and O1.Price>0 and O1.transtype in (14,16)),0))as [NetSale Qty],
    (isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.outqty>0 and O1.Price=0 and O1.transtype in (13,15)),0))-(isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.inqty>0 and O1.Price=0 and O1.transtype in (14,16)),0))as [FOC Quantity],
    (isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.inqty>0 and O1.transtype in (59)),0)) as [StockIN Quantity],
    (isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.outqty>0 and O1.transtype in (60)),0)) as [StockOUT Quantity],
    (isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate<=@ToDate and O1.transtype in (59,20,18,16,14,67,-2)),0) - isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate<=@ToDate and O1.transtype in (21,19,60,15,67,-2,13)),0)) as [Closing Stock]
    FROM OINM T0 INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode INNER JOIN OITW T2 ON T1.ItemCode = T2.ItemCode INNER JOIN OITB B1 ON T1.ItmsGrpCod=B1.ItmsGrpCod INNER JOIN OWHS W1 ON T2.WhsCode = W1.WhsCode INNER JOIN OLCT C1 ON W1.Location=C1.Code and T0.ItemCode Like '5%' and W1.WhsCode not in ( 'WH-DEMO', 'WH-AHM-R','WH-MUM-R','WH-NDL-R')
    Group by T2.MinStock ,T1.itemcode, T0.Itemcode, W1.WhsCode, C1.Location) a
    End Query ************
    This is correct and complete query i using for reporting
    Thanks & Regards,
    Rajeev

  • Commision based on item group & customer group

    Dear all,
    Does anyone have an idea about how to get commission based on item group & customer group sales?
    My customer wanted commission report based on item group or customer group & based on payment collection dated.
    Example
    Term given for customer A is 30 days.
    12/3/09 Inv 1000   RM 10,000   30 days payment
    20/4/09 Inv 2000  RM    5,000   60 days payment
    The term given is 30 days of the invoice month.
    Salesman will get commission if get the collection at May'09 for Inv 1000, & July'09 for iinv 2000 based on the invoice date month.
    The salesman get commission at any date of the month May'09. More longer collection, less commission they will get.
    Example:
    Salesman A
    Customer Group             1st of the month, 2nd of the month, 3rd of the month, 4th of the month
    Normal Dealer                         1.5%         ,  0.75%,              0.00%                   ,    -0.25%
    Sub Distributor                       0.5%         ,  0.25%,               0.00%                  ,    - 0.25%
    Any idea?
    Thanks in advance?
    Regards,
    Eric Tan

    Hi Eric
    SAP does not calculate commissions, but merely provide a mechanism to report on it. The multi level calculation you require can be achived with a custom query linked to a report layout. Standard SAP will not provide this type of calculation. You will need to look at the open transactions such as invoices and link to the relevant payment transaction to get the payment date. Then compare this date to the invoice due date to determine if the terms were adhered to or not. If not payment date - due date in number of days will be needed to calculate the effective commission percentage.
    Kind regards
    Peter Juby

  • Warehouse report in Item group wise

    Dear Experts,
    In Warehouse report i need the breakup in item group wise.
    Now Warehouse report show all item's and item's details. But now i need all group along with that group item details.
    Ex:
    Group 1
    Item A - 50
    Item B - 70
    Item C - 120
    Item N - 100
    Group 2
    Item AA - 50
    Item BB - 70
    Item CC - 120
    Item NN - 100
    Group 2
    Item AA - 50
    Item BB - 70
    Item CC - 120
    Item NN - 100
    How to get this report. any solution
    Thanks and Regards,
    Chandru

    Try the following query as you will not be able to manipulate or change the standard warehouse report to your requirements:
    SELECT T2.[ItmsGrpNam], T0.[WhsCode], MAX(T0.[ItemCode]) AS [ItemCode], MAX(T1.[ItemName]) AS [Item Name], SUM(T0.[OnHand]) AS [OnHand] FROM OITW T0  INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode INNER JOIN OITB T2 ON T1.ItmsGrpCod = T2.ItmsGrpCod GROUP BY T2.[ItmsGrpNam], T0.[WhsCode] ORDER BY T2.[ItmsGrpNam], T0.[WhsCode]
    Kind regards
    Peter

  • Pricing on item group

    Hi All,
    We require item prices to be mentioned on item group level rather than on the item level. is there some workaround without having to add user table.
    Thanks
    Rahul Jain

    U can Create a UDF at Item Group Level from Tools --> User-Defined Fields --> Manage User Fields --> Master Data , items Group of type Price.
    and do a FMS at Item master data Price Field to retrieve this price.
    May ur query be like this,
    SELECT T0.U_UDFprice From OITB T0 Where
    T0.[ItmsGrpCod] = $[OITM.ItmsGrpCod]
    Hope this may help u,
    Regards,
    Dhana.

  • PO DETAILS ( WITH ITEM GROUP)

    Folks
    I have a requirement from my client on PO which includes Item Group wise segregation.
    Project - PO # - PO Date - Vendor Name - Due Date - Item Group(1) (in Rs) -  Item Group(2) (in Rs) -  Item Group(3) (in Rs) -
    Freight - Discount - Excise - Vat - Cst - Total of PO
    All the details should be Document Level & not line items.
    Request you to kindly help me on this.
    regards
    KARTHIK

    Rahul
    Yes absolutely .   The query should throw group wise value in a particular PO.
    Project - PO # - PO Date - Vendor Name - Due Date - Item Group(1) (in Rs) - Item Group(2) (in Rs) - Item Group(3) (in Rs) -
    PROJ1     1        11/7/11          XXX             12/7/11          5000                             2000                                 1000
    Freight - Discount - Excise - Vat - Cst - Total of PO
    100                           100        50             8250.00
    In this all the values should be doc level & not line items value.
    regards
    KARTHIK

  • HOW TO SET ITEM MASTER IN ITEM GROUP AUTHORIZATION

    Hello,
    Using Sap Business One 2007 B how to solve this item master authorization issue.
    Kind regards,
    Karunagaranjanani.

    Hi,
    Try this,
    Create 1 Mendatory UDF field in Item Master Header.
    ->> Choose Tools on menu bar.
    ->> User Defined fields. -> Manager User Fields.
    ->> Open the Manager User Fields Window.
    ->> Master Data.
    ->> Items. -> Items.
    and Click Add button in bottom right then add the UDF Title & Description.
    put the Tick mark of Set Default value for Field and put the value of 0.
    then, put the Tick mark of Mendatory Value and add the UDF.
    Assign the below FMS in UDF.
    ->> Open the Item Master and ShiftAltF2 in UDF then put the Saved Query.
    put the Tick mark of AutoRefresh and select the Item Group,
    put the Tick mark of Display saved values.
    Try assign the below FMS in UDF(Mendatory field).
    for example: Item Group -> (100) -> Item.
    Item Group -> (101) -> Accessories. Item Group -> (102) -> Hardware.
    USer sign 1 -> Manager. USer sign 2 -> Admin.
    SELECT ' ' FROM OITM T0
    WHERE
    $[OITM.ItmsGrpCod] in ('100', '101', '102')
    AND
    $[OITM.UserSign] in ('1', '2', '3')
    Regards,
    Madhan.

Maybe you are looking for

  • Windows vista laptop won't recognise ipad 2 for setup

    my laptop has identified that I plugged an Ipad 2 in and found the drivers (aparently) but ITunes does not show that the ipad is connected???? I need to set up via ITunes......any ideas???

  • Summary Report ... % not Diplayed in Chart

    Dear AdobeFormCentral Users, I have a Problem. In the Summary Report there are some Charts, where the deatiled discription (example 12% (44))  is lost if i choose "Data as percentage" and "Data as an actual count" in the options. If i choose only one

  • Payment using F110 in Mexico

    Hi, I am looking for documentation / advice on how to generate files in SAP for the electronic payments for a mexican company code using F110. Thank you in advance Sanjiv

  • How to pass dynamically generated string value as array name in TestStand?

    Hi All,           I have a string variable which holds an array name as its value. The string value is a dynamically generated one. Now my problem is how to retrieve the values within the array where as the array name is stored in a string variable.

  • IBook G4 12'' 1.33Ghz; RAM question

    I have 1 GB DDR SDRAM, can a 12 inch iBook handle more than 1 GB? I just forget what its maximum is.