Skip to Content

OWHS and OIGN table relationship

Hey guys!

I'm doing a query and crashed in a list of tables.
When I use OWHS, the query returns nothing. When I remove the same OWHS table it works normally.
I tried to change OING to ING1, but the error still persists.

I need a light!

T4."DocDate", T2."WhsCode", T3."WhsName", T0."ItmsGrpNam", T1."ItemCode", T1."ItemName", T1."InvntryUom", T2."OnHand", T1."U_RSD_PesoBruto", T1."U_RSD_UN_Conversao", T2."AvgPrice" 


FROM  OITB T0  
INNER  JOIN OITM T1  ON  T1."ItmsGrpCod" = T0."ItmsGrpCod"   
INNER  JOIN OITW T2  ON  T2."ItemCode" = T1."ItemCode"   
INNER  JOIN OWHS T3  ON  T3."WhsCode" = T2."WhsCode"   
INNER  JOIN OIGN T4  ON  T4."Filler" = T3."WhsCode"  AND  T4."ToWhsCode" = T3."WhsCode"   

WHERE 

T4."DocDate" >= [%0] 

Thankful right now!

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    Posted on Jul 17, 2020 at 11:22 AM

    Hi,

    I suggest using IGN1 as Items (and respective Warehouse) are on Document lines and not Header. use the following joins:

    FROM IGN1 T0
    INNE JOIN OIGN T1 ON T0."DocEntry" = T1."DocEntry"
    INNER JOIN OITM T2 ON T0."ItemCode" = T2."ItemCode"
    INNER JOIN OITB T3 ON T2."ItmsGrpCod" = T3."ItmsGrpCod"
    INNER JOIN OITW T4 ON T0."ItemCode" = T4."ItemCode" AND T0."WhsCode" = T4."WhsCode"
    INNER JOIN OWHS T5 ON T0."WhsCode" = T5."WhsCode"
    WHERE T1."DocDate" >= [%0]

    BR,

    Matija

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi,

      I made the following change, and the query even executes, but returns empty values.

      FROM IGN1 T0
      
      INNER JOIN OIGN T1 ON T0."DocEntry" = T1."DocEntry"
      INNER JOIN OITM T2 ON T0."ItemCode" = T2."ItemCode"
      INNER JOIN OITB T3 ON T2."ItmsGrpCod" = T3."ItmsGrpCod"
      INNER JOIN OITW T4 ON T0."ItemCode" = T4."ItemCode" AND T0."WhsCode" = T4."WhsCode"
      INNER JOIN OWHS T5 ON T0."WhsCode" = T5."WhsCode", INV1 T6
      INNER JOIN OINV T7 ON T6."DocEntry" = T7."DocEntry", PCH1 T8
      INNER JOIN OPCH T9 ON T8."DocEntry" = T9."DocEntry"
      
      WHERE 
      
      T1."DocDate" >= [%0] AND
      T0."ItemCode" = [%1]

      when I put another item in the query, SAP crashes.

      I believe it is because of the OINV and OPCH tables that are open.

      query-error.png (156.1 kB)
  • Posted on Jul 20, 2020 at 04:08 AM

    please provide report format as you want /require

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi,
      How are you, Mohd?
      I can get the information using the OINM table, but my problem now is that the query brings several duplicate lines.
      Do you have any tips how can I solve this?

      T2."TransType",T2."DocDate", T2."InQty", T2."OutQty", T4."WhsCode", T3."WhsName" AS "Nome do depósito", T1."ItemCode", T1."ItemName", T0."ItmsGrpNam", T1."InvntryUom", T1."U_RSD_PesoBruto", T1."U_RSD_UN_Conversao", T4."AvgPrice" 
      
      FROM  OITB T0  
      INNER  JOIN OITM T1  ON  T1."ItmsGrpCod" = T0."ItmsGrpCod"   
      INNER  JOIN OINM T2  ON  T2."ItemCode" = T1."ItemCode"   
      INNER  JOIN OWHS T3  ON  T3."WhsCode" = T2."Warehouse"   
      INNER  JOIN OITW T4  ON  T4."WhsCode" = T3."WhsCode"   
      INNER  JOIN OITM T5  ON  T5."ItemCode" = T4."ItemCode"   
      
      WHERE 
      T2."TransType" in (59,20) AND
      T1."ItemCode" = [%0]

      I tried to limit in the OINM by the field "TransType (" 59, 20), but even so there are several duplicate lines and with that making it difficult to extract the information.


      Regards,

      Junior

  • Posted on Jul 17, 2020 at 06:19 AM

    can you explain , what is the requirement

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Mohd Danish,

      At OIGN I need all incoming entries by period (T4. "DocDate") or by item (T1. "ItemCode"). The link I need at OWHS is only in the field (T5. "WhsCode").
      If I remove the OWHS table, the query is successfully executed, but it is incomplete.

      Regards,

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.