Join PCH1 with POR1

Is it possible to join the table PCH1 directly to POR1?
Or have I to use PDN1 in between?
What is then the correct query?
Thanks in advance,
Frits

You are right. I placed PDN1 in between and it seems now ok. The idea was to create a query with less tables and the same result. Thanks for checking.
SELECT "PCH1"."ItemCode", "PCH1"."Quantity", "PCH1"."Price", "OPOR"."DocNum", "OPCH"."DocNum", "POR1"."Dscription"
FROM   ((("Veenstra_Template"."dbo"."PDN1" "PDN1" INNER JOIN "Veenstra_Template"."dbo"."PCH1" "PCH1" ON ("PDN1"."DocEntry"="PCH1"."BaseEntry") AND ("PDN1"."LineNum"="PCH1"."BaseLine")) INNER JOIN "Veenstra_Template"."dbo"."POR1" "POR1" ON ("PDN1"."BaseEntry"="POR1"."DocEntry") AND ("PDN1"."BaseLine"="POR1"."LineNum")) INNER JOIN "Veenstra_Template"."dbo"."OPOR" "OPOR" ON "POR1"."DocEntry"="OPOR"."DocEntry") INNER JOIN "Veenstra_Template"."dbo"."OPCH" "OPCH" ON "PCH1"."DocEntry"="OPCH"."DocEntry"
ORDER BY "OPCH"."DocNum"
Best regards,
Frits

Similar Messages

  • How to join GRPO with AP invoice thru query ?

    hi all,
    How to join GRPO with AP invoice in sql query ?
    Jeyakanthan

    Hi Jeyakanthan
    Are you using query in SAP Business One or outside the system? If you select the tables in SAP Business One as OPCH and OPDN then no inner join will appear, as the links sit on the line level. You will need PCH1 and PDN1. The link can be found in both directions, but bear in mind that 1 AP Invoice could be based on more than 1 Goods Receipt PO. For this reason the best approach is to start at the AP Invoice line level and use the BaseType and BaseRef fields to view which lines were pulled from which Goods Receipt PO's.
    Kind regards
    Peter Juby

  • How can i join PO with GRPO

    Hi,
    I make query as belown to join PO with GRPO.I wnat to calculate Quantity from PO to GRPO but in my query it show duplicate record i also use distinct but useless.My query as below.
    SELECT T1.DocNum [PO No], T1.DocDate [PO Date], T3.ItemCode, T3.Dscription, T3.U_CostCentre, T3.DocEntry [GRN No], T0.DocDate [GRN Date],T3.Quantity'GRIR Quantity',T2.Quantity 'PO Quantity',
    T3.Quantity-T2.Quantity 'Balance Quantity'
    FROM OPDN T0 , OPOR T1, POR1 T2, PDN1 T3
    WHERE T1.DocEntry = T2.DocEntry
    and T0.Docnum = T3.Docentry
    and T3.BaseRef  =  T1.DocNum
    and T2.ItemCode = T3.ItemCode
    and T3.DocDate between [%0] and [%1]
    Can any body help in this regards.
    Sohail Anwar Ali

    Hi Sohail,
    As i understand, you want to know till now how much of quantity stills needs  to be delivered, in that case instead of trying joining two tables i would suggest to try this query which gives you
    Purchase Order Document No,
    Purchase Order Date,
    Vendor Name,
    Item Code,
    Item Description,
    Ordered Quantity,
    Received Quantity,
    Open Quantity.
    as the filed OpenQty stores the Quantity yet to receive for that particular Purchase Order. As this approach is much more flexible
    Query
    SELECT T0.DocNum, T0.DocDate, T0.CardName, T1.ItemCode, T1.Dscription, T1.Quantity,
    (T1.Quantity-T1.OpenQty) as "Recevied Quantity",
    T1.OpenQty FROM OPOR T0  INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry WHERE T0.DocDate >=[%0] and
    T0.DocDate <=[%1]
    I hope this helps out your issue
    regards,
    Shreyas

  • Does INNER JOIN work with Oracle 8i ? (ORA-00933)

    hi,
    I try to execute the sql:
    SELECT
    A0.FULL_NAME,A0.MANAGER_ID,A0.DEPT_NO,A0.TOP_DEPT
    FROM
    HR_ORG A0
    INNER JOIN
    HR_EMP A1
    ON
    A0.MANAGER_ID=A1.EMP_NO
    WHERE
    A1.NAME = 'michael'
    but I caught an exception:
    java.sql.SQLException: ORA-00933: SQL...(message in
    chinese)
    Does INNER JOIN work with Oracle 8i ?
    thanks.

    INNER JOIN syntax is introduced in 9i, it does not exists in 8i. You can rewrite your statement:
    SELECT
    A0.FULL_NAME,A0.MANAGER_ID,A0.DEPT_NO,A0.TOP_DEPT
    FROM
    HR_ORG A0
    , HR_EMP A1
    WHERE
    A0.MANAGER_ID=A1.EMP_NO
    AND
    A1.NAME = 'michael'

  • Can I join Structure with Z table ?

    Can I join Structure with Z table?
    If yes...plz explain me with an example.
    PLease provide me with an example to join a structure with a Ztable...
    Any help would be appreciated...
    Regards,
    Krishna Chaitanya

    Hi Chitanya,
      It is possible to add fields in the form of structure to a Z table.it can be done in the form of Include or Append structure.There are no other ways to join structure to the table upto my knowledge.
    if it useful, reward points.
    Thank u,
    Prasad G.V.K

  • How can I join PRPS with DRAD?

    Hi,
    I would like to join the table PRPS and DRAD in order to see all documents linked to a certain PSP. I tried to join DRADOBJKY with PRPSPSPNR but it doesn't work since the OBJKY is different from the psp-number. If I'm doing this with MARA~MATNR it works. Strange. can someboy help me?
    Thanks

    Hello,
    Can you check if PRPS-OBJNR = DRAD-OBJKY ?
    If this is not successful, then use the conv. exit  CONVERSION_EXIT_ABPSP_INPUT, pass the PRPS-OBJNR get the internal number.
    Now check that this internal number matches with DRAD-OBJKY.
    Plz revert back.
    BR,
    Suhas

  • Can we join table with structure

    Hi
    i have taken fields from Plaf table and some fields from structures so now i want to join that how can i join.
    Is there any option?
    regards

    Hi,
    structure dont have any data base table associated with them so they dont have any data.
    that's why we cannot join structure witha table but we can include a structure within any table.
    Sytex to include structure in ztable:
    fieldname     data element.
    .include        struname
    hope it will ans ur query.
    Thanks
    Rajesh Kumar

  • Join table with additional data

    Hi,
    I'm new to JPA (Toplink Essentials) and I'd like to know how to handle this situation:
    I have ORDER table, ITEMS table and "join table" ORDER_ITEMS which holds refernces to ordered items with quantity of each oredered item.
    Many thanks

    I did mapping as shown in listing. It works for reading, but for writing JPA returns error. Can somebody help?
    Thanks
    [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Column name 'idexpedice' appears more than once in the result column list.
    Error Code: 264
    Call: INSERT INTO vklad_expedice (IDEXPEDICE, IDVKLAD, VAHA, idexpedice, idvklad) VALUES (?, ?, ?, ?, ?)
    bind => [null, null, 0, 4411, 2]
    @Entity
    public class Expedice implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer idexpedice;
    @Temporal(TemporalType.DATE)
    private Date datum;
    @OneToMany(fetch = FetchType.EAGER, mappedBy="expedice", cascade = CascadeType.ALL)
    private List<ExpediceVklad> vklady;
    @Entity
    public class Vklad implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer idvklad;
    private String nazev;
    @Entity
    @Table(name = "vklad_expedice")
    @IdClass(ExpediceVkladId.class)
    public class ExpediceVklad implements Serializable {
    @Id
    private Integer idexpedice;
    @Id
    private Integer idvklad;
    private Integer vaha;
    @ManyToOne
    @JoinColumn(name = "idexpedice")
    private Expedice expedice;
    @ManyToOne
    @JoinColumn(name = "idvklad")
    private Vklad vklad;
    public class ExpediceVkladId {
    @Id
    private Integer idexpedice;
    @Id
    private Integer idvklad;
    SQL tables
    EXPEDICE
    idexpedice
    datum
    VKLAD
    idvklad
    nazev
    VKLAD_EXPEDICE (this is the join table with additional column)
    idexpedice
    idvklad
    vaha
    Edited by: user10933983 on 31.3.2009 13:47

  • Join parent with child on nested object table

    We made a nested table in Oracle 8i with two object types and collection type.
    We manipulating with it - no problem.
    However trying to join parent with the child cause the problem in PL/SQL
    This sintax is OK for Oracle SQL and returns right result:
    select
    matl.barcode_id,
    matl.LAST_MOD_TSP,
    dtl.matl_nbr,
    bmm.matl_dsc,
    dtl.asn_qty,
    dtl.mfg_dt
    from
    asn_barcode_matl_ot matl,
    table(matl.asn_barcode_matl_dtl) dtl,
    wms_brwy_matl_mstr bmm
    where
    matl.rcpt_seq_id = 1
    and matl.brwy_cd = bmm.brwy_cd
    and dtl.matl_nbr = bmm.matl_nbr;
    But stored procedure with this statement doesn't compile and giving the error:
    PLS-00201: identifier 'MATL.ASN_BARCODE_MATL_DTL' must be declared
    Looks like a bug? What is wrong?

    It is not possible. You can do this with trigger code, or preferably by adjusting your delete procedure api. A delete of the master record will often fail because other children records exists, so you have to catch that exception and do something that is useful to you in this situation.
    Regards,
    Rob.

  • Can we join Ztables with SAP std. tables in SQVI ?

    Dear All,
    Can we join Ztables with SAP std. tables in SQVI ?
    How to use "left outer join" in SQVI ?
    What r the rules/steps to be followed for creating right SQVI/query ?
    Sometimes it gives error / we do not get any output ....
    Pl' give examples.

    hi
    good
    1- Yes
    3-Check this example for SQVI Query.
    It is possible to generate a complete list of purchase document releases with the purchase document number (requisitions and orders), releaser, release date and release time.
    First, create an Infoset using transaction SQ02 directly reading from table CDPOS and create an additional table: CDHDR. If you are releasing purchase requsitions at the item level, it is convenient to create an additional field (PURPS LIKE EBAN-BNFPO) to capture the item number. Once the field is defined add the following code to it:
    PURPS = CDPOS-TABKEY+14(5).
    Once created, make sure to assign your Infoset to the user groups.
    Second, create an SAP Query (SQ00) or QuickViewer (SQVI) based on the Infoset you created previously. Set CDPOS-OBJECTID, PURPS (additional field), CDHDR-USERNAME, CDHDR-UDATE & CDHDR-UTIME, CDPOS-TCODE, CDPOS-VALUE_NEW, and CDPOS-VALUE_OLD as list fields (display screen).
    Set CDPOS-OBJECTCLAS, CDPOS-OBJECTID, CDPOS-TABNAME, CDPOS-FNAME, CDPOS-CHANGIND, CDHDR-USERNAME, CDHDR-UDATE & CDHDR-UTIME as the selection fields (selection screen).
    Finally, execute your query. For filtering purchase requisition releases set:
    Object class='BANF'
    Table Name='EBAN'
    Field Name='FRGKZ'
    Change type='U'
    For filtering purchase order releases set:
    Object class='EINKBELEG'
    Table Name='EKKO'
    Field Name='FRGKE'
    Change type='U'
    Make sure to specify username, dates or purchase document number (object value) in order to reduce run times.
    thanks
    mrutyun^

  • New airport: can't get my macbook or my imac to join my wireless automatically, my other stuff still joins without problems but i have to join manually with the book and the imac ?? I've tried all the settings and every thing else I can think of.....

    new airport: can't get my macbook or my imac to join my wireless automatically, my other stuff still joins without problems but i have to join manually with the book and the imac ?? I've tried all the settings and every thing else I can think of.....
    Running on Lion, never had a problem before until the old airport died and I replaced it.

    try connecting the device in _*recovery mode*_, then restore from your backup.
    also, make sure [_*Apple Mobile Device Service*_|http://support.apple.com/kb/TS1567] is installed and started.
    JGG

  • Modify Query with POR1

    I have a query that works fine......but i need add by item the sum of purcharse order (PO) in a same query....another column.
    I try for a while but i can not make it work.....
    The query give me sum per month of sales (in queantity) by item, then sum of qty in last 6 months, 3 months,etc.
    Anyone can helpme with this?
    this is the query:
    select ItemCode, ItemName, ItmsGrpNam,
    SUM(Jan) As Jan, SUM(Feb) As Feb, SUM(Mar) As Mar, SUM(Apr) As Apr, SUM(May) As May,SUM(Jun) As Jun,SUM(Jul) As Jul,SUM(Aug) As Aug,SUM(Sep) As Sep,SUM(Oct) As Oct,SUM(Nov) As Nov,SUM(Dec) As Dec,
    (SUM(Jan6M)+SUM(Feb6M)+SUM(Mar6M)+SUM(Apr6M)+SUM(May6M)+SUM(Jun6M)+ SUM(Jul6M)+SUM(Aug6M)+SUM(Sep6M)+SUM(Oct6M)+SUM(Nov6M)+SUM(Dec6M)) As 'Vtas6M',
    ((SUM(Jan6M)+SUM(Feb6M)+SUM(Mar6M)+SUM(Apr6M)+SUM(May6M)+SUM(Jun6M)+ SUM(Jul6M)+SUM(Aug6M)+SUM(Sep6M)+SUM(Oct6M)+SUM(Nov6M)+SUM(Dec6M)))/6 As PromVtas6M,
    (SUM(Jan3M)+SUM(Feb3M)+SUM(Mar3M)+SUM(Apr3M)+SUM(May3M)+SUM(Jun3M)+ SUM(Jul3M)+SUM(Aug3M)+SUM(Sep3M)+SUM(Oct3M)+SUM(Nov3M)+SUM(Dec3M)) As 'Vtas3M',
    ((SUM(Jan3M)+SUM(Feb3M)+SUM(Mar3M)+SUM(Apr3M)+SUM(May3M)+SUM(Jun3M)+ SUM(Jul3M)+SUM(Aug3M)+SUM(Sep3M)+SUM(Oct3M)+SUM(Nov3M)+SUM(Dec3M)))/3 As Promvtas3M,OnHand AS StockGlobal,
    ((SUM(Jan6M)+SUM(Feb6M)+SUM(Mar6M)+SUM(Apr6M)+SUM(May6M)+SUM(Jun6M)+ SUM(Jul6M)+SUM(Aug6M)+SUM(Sep6M)+SUM(Oct6M)+SUM(Nov6M)+SUM(Dec6M))/180) AS 'PromDiario6M',
    CASE WHEN ItmsGrpNam = 'AC CINTAS' and OnHand  <= (((SUM(Jan6M)+SUM(Feb6M)+SUM(Mar6M)+SUM(Apr6M)+SUM(May6M)+SUM(Jun6M)+ SUM(Jul6M)+SUM(Aug6M)+SUM(Sep6M)+SUM(Oct6M)+SUM(Nov6M)+SUM(Dec6M))/180)*50)  then 'PEDIR'
    WHEN ItmsGrpNam = 'AC ADHESIVOS' and OnHand  <= (((SUM(Jan6M)+SUM(Feb6M)+SUM(Mar6M)+SUM(Apr6M)+SUM(May6M)+SUM(Jun6M)+ SUM(Jul6M)+SUM(Aug6M)+SUM(Sep6M)+SUM(Oct6M)+SUM(Nov6M)+SUM(Dec6M))/180)*50)  then 'PEDIR'
    WHEN ItmsGrpNam = 'CN POLISOCIANURATO' and OnHand  <= (((SUM(Jan6M)+SUM(Feb6M)+SUM(Mar6M)+SUM(Apr6M)+SUM(May6M)+SUM(Jun6M)+ SUM(Jul6M)+SUM(Aug6M)+SUM(Sep6M)+SUM(Oct6M)+SUM(Nov6M)+SUM(Dec6M))/180)*25)  then 'PEDIR'
    WHEN ItmsGrpNam = 'HV NOMAGUARD' and OnHand  <= (((SUM(Jan6M)+SUM(Feb6M)+SUM(Mar6M)+SUM(Apr6M)+SUM(May6M)+SUM(Jun6M)+ SUM(Jul6M)+SUM(Aug6M)+SUM(Sep6M)+SUM(Oct6M)+SUM(Nov6M)+SUM(Dec6M))/180)*28)  then 'PEDIR'  END AS Satus
    FROM
    (select ItemCode, ItemName, ItmsGrpNam,
    (CASE WHEN Month = 1 THEN Quantity ELSE 0 END) As Jan,
    (CASE WHEN Month = 2 THEN Quantity ELSE 0 END) As Feb,
    (CASE WHEN Month = 3 THEN Quantity ELSE 0 END) As Mar,
    (CASE WHEN Month = 4 THEN Quantity ELSE 0 END) As Apr,
    (CASE WHEN Month = 5 THEN Quantity ELSE 0 END) As May,
    (CASE WHEN Month = 6 THEN Quantity ELSE 0 END) As Jun,
    (CASE WHEN Month = 7 THEN Quantity ELSE 0 END) As Jul,
    (CASE WHEN Month = 8 THEN Quantity ELSE 0 END) As Aug,
    (CASE WHEN Month = 9 THEN Quantity ELSE 0 END) As Sep,
    (CASE WHEN Month = 10 THEN Quantity ELSE 0 END) As Oct,
    (CASE WHEN Month = 11 THEN Quantity ELSE 0 END) As Nov,
    (CASE WHEN Month = 12 THEN Quantity ELSE 0 END) As Dec,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 180) and Month = 1 THEN Quantity ELSE 0 END) As Jan6M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 180) and Month = 2 THEN Quantity ELSE 0 END) As Feb6M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 180) and Month = 3 THEN Quantity ELSE 0 END) As Mar6M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 180) and Month = 4 THEN Quantity ELSE 0 END) As Apr6M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 180) and Month = 5 THEN Quantity ELSE 0 END) As May6M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 180) and Month = 6 THEN Quantity ELSE 0 END) As Jun6M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 180) and Month = 7 THEN Quantity ELSE 0 END) As Jul6M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 180) and Month = 8 THEN Quantity ELSE 0 END) As Aug6M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 180) and Month = 9 THEN Quantity ELSE 0 END) As Sep6M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 180) and Month = 10 THEN Quantity ELSE 0 END) As Oct6M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 180) and Month = 11 THEN Quantity ELSE 0 END) As Nov6M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 180) and Month = 12 THEN Quantity ELSE 0 END) As Dec6M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 90) and Month = 1 THEN Quantity ELSE 0 END) As Jan3M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 90) and Month = 2 THEN Quantity ELSE 0 END) As Feb3M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 90) and Month = 3 THEN Quantity ELSE 0 END) As Mar3M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 90) and Month = 4 THEN Quantity ELSE 0 END) As Apr3M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 90) and Month = 5 THEN Quantity ELSE 0 END) As May3M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 90) and Month = 6 THEN Quantity ELSE 0 END) As Jun3M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 90) and Month = 7 THEN Quantity ELSE 0 END) As Jul3M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 90) and Month = 8 THEN Quantity ELSE 0 END) As Aug3M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 90) and Month = 9 THEN Quantity ELSE 0 END) As Sep3M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 90) and Month = 10 THEN Quantity ELSE 0 END) As Oct3M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 90) and Month = 11 THEN Quantity ELSE 0 END) As Nov3M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 90) and Month = 12 THEN Quantity ELSE 0 END) As Dec3M,OnHand
    FROM
    ( SELECT DISTINCT T0.ItemCode, T0.OnHand, T0.ItemName, T1.ItmsGrpNam, T2.unitMsr, T2.Quantity, T2.LineTotal,MONTH(T3.DocDate) As Month,T3.DocDate
    FROM OITM T0 INNER JOIN OITB T1 ON T0.ItmsGrpCod = T1.ItmsGrpCod
    INNER JOIN INV1 T2 ON T0.ItemCode = T2.ItemCode
    INNER JOIN OINV T3 ON T2.DocEntry = T3.DocEntry
    WHERE T3.Docdate >='20100101' AND T3.Docdate <= '20101231' AND T2.TargetType <> '14' ) source ) VIEW2
    Group by VIEW2.ItemCode, VIEW2.OnHand,VIEW2.ItemName, VIEW2.ItmsGrpNam

    Carlos,
    Try this Code.
    select View2.ItemCode, ItemName, ItmsGrpNam,
    SUM(Jan) As Jan, SUM(Feb) As Feb, SUM(Mar) As Mar,
    SUM(Apr) As Apr, SUM(May) As May,SUM(Jun) As Jun,
    SUM(Jul) As Jul,SUM(Aug) As Aug,SUM(Sep) As Sep,
    SUM(Oct) As Oct,SUM(Nov) As Nov,SUM(Dec) As Dec,
    (SUM(Jan6M)SUM(Feb6M)SUM(Mar6M)SUM(Apr6M)SUM(May6M)SUM(Jun6M)
    SUM(Jul6M)SUM(Aug6M)SUM(Sep6M)SUM(Oct6M)SUM(Nov6M)+SUM(Dec6M)) As 'Vtas6M',
    ((SUM(Jan6M)SUM(Feb6M)SUM(Mar6M)SUM(Apr6M)SUM(May6M)SUM(Jun6M)
    SUM(Jul6M)SUM(Aug6M)SUM(Sep6M)SUM(Oct6M)SUM(Nov6M)+SUM(Dec6M)))/6 As PromVtas6M,
    (SUM(Jan3M)SUM(Feb3M)SUM(Mar3M)SUM(Apr3M)SUM(May3M)SUM(Jun3M)
    SUM(Jul3M)SUM(Aug3M)SUM(Sep3M)SUM(Oct3M)SUM(Nov3M)+SUM(Dec3M)) As 'Vtas3M',
    ((SUM(Jan3M)SUM(Feb3M)SUM(Mar3M)SUM(Apr3M)SUM(May3M)SUM(Jun3M)
    SUM(Jul3M)SUM(Aug3M)SUM(Sep3M)SUM(Oct3M)SUM(Nov3M)+SUM(Dec3M)))/3 As Promvtas3M,
    OnHand AS StockGlobal,
    ((SUM(Jan6M)SUM(Feb6M)SUM(Mar6M)SUM(Apr6M)SUM(May6M)SUM(Jun6M)
    SUM(Jul6M)SUM(Aug6M)SUM(Sep6M)SUM(Oct6M)SUM(Nov6M)+SUM(Dec6M))/180) AS 'PromDiario6M',
    CASE WHEN ItmsGrpNam = 'AC CINTAS'
    and OnHand <= (((SUM(Jan6M)SUM(Feb6M)SUM(Mar6M)SUM(Apr6M)SUM(May6M)SUM(Jun6M)
    SUM(Jul6M)SUM(Aug6M)SUM(Sep6M)SUM(Oct6M)SUM(Nov6M)+SUM(Dec6M))/180)*50) then 'PEDIR'
    WHEN ItmsGrpNam = 'AC ADHESIVOS'
    and OnHand <= (((SUM(Jan6M)SUM(Feb6M)SUM(Mar6M)SUM(Apr6M)SUM(May6M)SUM(Jun6M)
    SUM(Jul6M)SUM(Aug6M)SUM(Sep6M)SUM(Oct6M)SUM(Nov6M)+SUM(Dec6M))/180)*50) then 'PEDIR'
    WHEN ItmsGrpNam = 'CN POLISOCIANURATO'
    and OnHand <= (((SUM(Jan6M)SUM(Feb6M)SUM(Mar6M)SUM(Apr6M)SUM(May6M)SUM(Jun6M)
    SUM(Jul6M)SUM(Aug6M)SUM(Sep6M)SUM(Oct6M)SUM(Nov6M)+SUM(Dec6M))/180)*25) then 'PEDIR'
    WHEN ItmsGrpNam = 'HV NOMAGUARD'
    and OnHand <= (((SUM(Jan6M)SUM(Feb6M)SUM(Mar6M)SUM(Apr6M)SUM(May6M)SUM(Jun6M)
    SUM(Jul6M)SUM(Aug6M)SUM(Sep6M)SUM(Oct6M)SUM(Nov6M)+SUM(Dec6M))/180)*28) then 'PEDIR' END AS Satus,
    ISNULL(POItemSum.POSum,0.000000) as POSum
    FROM (
    select ItemCode, ItemName, ItmsGrpNam,
    (CASE WHEN Month = 1 THEN Quantity ELSE 0 END) As Jan,
    (CASE WHEN Month = 2 THEN Quantity ELSE 0 END) As Feb,
    (CASE WHEN Month = 3 THEN Quantity ELSE 0 END) As Mar,
    (CASE WHEN Month = 4 THEN Quantity ELSE 0 END) As Apr,
    (CASE WHEN Month = 5 THEN Quantity ELSE 0 END) As May,
    (CASE WHEN Month = 6 THEN Quantity ELSE 0 END) As Jun,
    (CASE WHEN Month = 7 THEN Quantity ELSE 0 END) As Jul,
    (CASE WHEN Month = 8 THEN Quantity ELSE 0 END) As Aug,
    (CASE WHEN Month = 9 THEN Quantity ELSE 0 END) As Sep,
    (CASE WHEN Month = 10 THEN Quantity ELSE 0 END) As Oct,
    (CASE WHEN Month = 11 THEN Quantity ELSE 0 END) As Nov,
    (CASE WHEN Month = 12 THEN Quantity ELSE 0 END) As Dec,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 180) and Month = 1 THEN Quantity ELSE 0 END) As Jan6M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 180) and Month = 2 THEN Quantity ELSE 0 END) As Feb6M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 180) and Month = 3 THEN Quantity ELSE 0 END) As Mar6M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 180) and Month = 4 THEN Quantity ELSE 0 END) As Apr6M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 180) and Month = 5 THEN Quantity ELSE 0 END) As May6M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 180) and Month = 6 THEN Quantity ELSE 0 END) As Jun6M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 180) and Month = 7 THEN Quantity ELSE 0 END) As Jul6M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 180) and Month = 8 THEN Quantity ELSE 0 END) As Aug6M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 180) and Month = 9 THEN Quantity ELSE 0 END) As Sep6M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 180) and Month = 10 THEN Quantity ELSE 0 END) As Oct6M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 180) and Month = 11 THEN Quantity ELSE 0 END) As Nov6M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 180) and Month = 12 THEN Quantity ELSE 0 END) As Dec6M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 90) and Month = 1 THEN Quantity ELSE 0 END) As Jan3M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 90) and Month = 2 THEN Quantity ELSE 0 END) As Feb3M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 90) and Month = 3 THEN Quantity ELSE 0 END) As Mar3M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 90) and Month = 4 THEN Quantity ELSE 0 END) As Apr3M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 90) and Month = 5 THEN Quantity ELSE 0 END) As May3M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 90) and Month = 6 THEN Quantity ELSE 0 END) As Jun3M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 90) and Month = 7 THEN Quantity ELSE 0 END) As Jul3M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 90) and Month = 8 THEN Quantity ELSE 0 END) As Aug3M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 90) and Month = 9 THEN Quantity ELSE 0 END) As Sep3M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 90) and Month = 10 THEN Quantity ELSE 0 END) As Oct3M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 90) and Month = 11 THEN Quantity ELSE 0 END) As Nov3M,
    (CASE WHEN DocDate >= (CURRENT_TIMESTAMP - 90) and Month = 12 THEN Quantity ELSE 0 END) As Dec3M,
    OnHand
    FROM (
    SELECT DISTINCT T0.ItemCode, T0.OnHand, T0.ItemName, T1.ItmsGrpNam, T2.unitMsr,
    T2.Quantity, T2.LineTotal,MONTH(T3.DocDate) As Month,T3.DocDate
    FROM OITM T0 INNER JOIN OITB T1
    ON T0.ItmsGrpCod = T1.ItmsGrpCod INNER JOIN INV1 T2
    ON T0.ItemCode = T2.ItemCode INNER JOIN OINV T3
    ON T2.DocEntry = T3.DocEntry
    WHERE T3.Docdate >='20100101' AND T3.Docdate <= '20101231'
    AND T2.TargetType <> '14' ) source ) VIEW2
    LEFT OUTER JOIN
    (select ItemCode, SUM(LineTotal) As POSum from POR1
    group by ItemCode) POItemSum
    ON VIEW2.ItemCode =POItemSum.ItemCode
    Group by VIEW2.ItemCode, VIEW2.OnHand,VIEW2.ItemName, VIEW2.ItmsGrpNam,
    ISNULL(POItemSum.POSum,0.000000)
    Hope this helps
    Krishnan

  • Help on Join AP with Order_Lines

    Hi Gurus,
    How to join AP Invoices with Order Lines. I am trying to get order number from order_lines and Invoice number from AP_Invoices
    Regards

    792011 wrote:
    Hi Gurus,
    How to join AP Invoices with Order Lines. I am trying to get order number from order_lines and Invoice number from AP_Invoices
    RegardsAre you referring to a particular Oracle product (pre built database)? this forum is for SQL and PL/SQL questions, so a lot of people here work at the low level end of the coding, not with those products.
    If that's the case, just let us know so we can stop looking at it here, and go post your question in the correct product forum.

  • Joining Quotes with Orders in OBIA Siebel Sales

    Hi Gurus,
    I need to find a way to join the Quotes with the Order in the OOTB RPD from Siebel Sales implementation. I am trying to join with the Row_WID but i do not get any results for the below query, i want to have the the Quote number and the related Order Number and details.
    select * from obaw.w_order_d a, obaw.w_order_f b, obaw.w_Quote_f c, obaw.w_quote_d d
    where a.row_wid=b.row_wid
    and b.row_wid=c.row_wid
    and c.row_wid = d.row_wid
    I am sure i am going grossly going wrong somewhere.
    Quick help will be appreciated.
    Regards,
    Amit

    Amith,Is this answered Common key to join Opportunity, Quotes & Orders
    Coming to your question,you established the joins wrong,here is the query i have written for you
    select a.integration_id ,a.row_wid,a.vis_pr_bu_id,
    b.integration_id "quote integration",b.row_wid "quote wid",b.vis_pr_bu_id "quote vis",
    c.integration_id "fact int",c.quote_wid "fact quote",c.vis_pr_bu_id "fact vis"
    from w_order_d a,
    w_quote_d b,
    w_quote_f c,
    w_order_f d
    where a.row_wid=b.row_wid
    and b.row_wid=c.quote_wid
    and a.row_wid=d.order_wid
    hope answered.
    Cheers,
    KK
    Edited by: Kranthi.K on Jun 27, 2011 9:24 PM

  • Cannot join network with ipod touch

    Please help - I just got the ipod touch and got the january software update. I want to have email & web surfing capability. When I try to join my home network, it asks for a password. I've tried my wireless network key, and my computer password. Nothing works. Does ANYONE know what I should do? Does this have anything to do with wireless network settings? Servers? Addresses? What information should I be entering onto the touch?
    Thanks!

    Hello and Welcome to Apple Discussions. 
    It wants your wireless network key when it asks for a password. It is worth proving the connectivity without security enabled but you don't want to remain like that for long.
    A WEP network key (plain text) must be 5 characters long for 40bit WEP or 13 characters long for 128bit WEP. If the WEP key is in hexadecimal (10 or 26 characters) try adding a $ infront of the key.
    Actually WEP can be cracked in a couple of miniutes so I'd advise switching your router to use WPA encryption. WPA is much more secure and you can use any password/key you wish.
    If you post the make/model number of your wireless router we can probably advise more.
    cheers
    mrtotes

Maybe you are looking for

  • Get value from  APEX_ITEM.SELECT_LIST_FROM_QUERY - column on a report.

    Hello. Help. Help. Help. I have to get value from APEX_ITEM.SELECT_LIST_FROM_QUERY - column on a report. SELECT DISTINCT ROLE AS GET_ROLE, JOB AS GET_JOB, APEX_ITEM.SELECT_LIST_FROM_QUERY ( 1, '%', 'SELECT DISTINCT CODE c, MODE m FROM T2 WHERE ROLE =

  • How to configure the web interface of service desk

    Hi All, We are currently doing a configuration on solman service desk. I am on a stage where in i need to use the web interface of service desk via tcode notif_create_bsp. However, every time i call the transaction code (call the url) i cant view the

  • How to check the records in Master Data Table?

    Hi,    I am trying to load the Master Data Table using the Flat File.Now how to check the records in Master Data Table? I done the following way: Info Provider->Info Object->Right Click->Display Data or Maintain Master Data But it's not showing the r

  • ITunes will NOT install...Pictures!!!!

    My iTunes all of a sudden stopped working. When I tried to open it, it said it could not open non-installed programs (but, if I click on an iTunes music file, iTunes will open up). So I came here to apple.com to download it again. Well I save the fil

  • Crm datasource  extract structure &communication structure

    hello all, how to find standard datasource extract structure in CRM. its very urgent. i will give full points. advance thanks to all.