Skip to main content

Hello Dear Community, 

I'm trying to write PQL query that will return Material Numbers which are ordered on both active Scheduling Agreements and open Purchasing Orders in SAP. 

 

Do you have any suggestions which PQL functions will be suitable for that? I've attached example with the input/expected output.

 

Thank you!

 

Hi Neda! If I understand your requirement, this PQL query will be useful:

 

SELECT "Material Number", "Purch. Doc. Number", "Purch. Doc. Type", "Purch. Doc. Status"

FROM "nameoftable"

WHERE "Purch. Doc. Type"='SA' AND "Purch. Doc. Status"='Open'

ORDER BY "Material Number" ASC

 


Hi Neda, if I understood your query, Please try as below.

 

CASE WHEN "Purch.Doc.Type" LIKE 'SA'

AND

"Purch.Doc.Status" LIKE ''Open'

THEN "Material NUMBER"

ELSE 'other'

END


Hi Neda, if I understood your query, Please try as below.

 

CASE WHEN "Purch.Doc.Type" LIKE 'SA'

AND

"Purch.Doc.Status" LIKE ''Open'

THEN "Material NUMBER"

ELSE 'other'

END

Thank you Rahul,

Your proposed PQL query will return Material Numbers that are ordered on active SAs. And my intention is to identify Material Numbers that are ordered on both active SAs and open POs at the same time. The use case behind is that we are not duplicating demand to supplier and ordering extra product.

 

BR

Neda


Reply