Skip to main content
Question

LOBBY DATA PR/PO COLUMN

  • November 23, 2020
  • 4 replies
  • 89 views

Forum|alt.badge.img+7

I am trying to see the PO number for parts on a Distro Order, i have the below SQL but it is retuning both closed and open PO’s is there a way for it to only show the open PO’s. Thank you

(SELECT listagg(order_NO, '^') WITHIN GROUP (ORDER BY 1) FROM (SELECT ORDER_NO FROM &AO.PURCHASE_REQ_LINE_ALL WHERE part_no = DISTRIBUTION_ORDER.PART_NO))

 

This topic has been closed for comments

4 replies

Forum|alt.badge.img+7
  • Hero
  • 69 replies
  • November 24, 2020

Add below condition to filter out closed/cancelled ones?

 

and &AO.purchase_order_api.Get_State(order_no) not in ('Cancelled','Closed')


Forum|alt.badge.img+7
  • Author
  • Sidekick
  • 65 replies
  • November 24, 2020

@asanka  when i tried adding yours to the filter i get the below message

 


Forum|alt.badge.img+19
  • Superhero (Employee)
  • 488 replies
  • November 24, 2020

Which PO’s do you want to see? I guess it is not the PO on the DO since that already exists in field PO_ORDER_NO in view DISTRIBUTION_ORDER.

Is it a list of other open PO’s you want I would have used view PURCHASE_ORDER_LINE_PART (Purchase Order Line View for part lines) instead of PURCHASE_REQ_LINE_ALL (purchase requisition line view) and the condition asanka had: 

objstate not in ('Cancelled','Closed')

 

Another thing, do you have several sites? Then you need to add this to only show PO’s for the DO demand site:

contract = DISTRIBUTION_ORDER.demand_site


Forum|alt.badge.img+7
  • Author
  • Sidekick
  • 65 replies
  • November 24, 2020

I was trying to see if there were any PR or PO’s open for the Part on the DO, i was able to get it to work using the below, thank you everyone for your assistance

 

(CASE WHEN (SELECT listagg(order_NO,'^') WITHIN GROUP (ORDER BY 1) FROM (SELECT ORDER_NO FROM &AO.PURCHASE_REQ_LINE_ALL WHERE part_no = DISTRIBUTION_ORDER.PART_NO))  NOT IN 'Released' THEN 'YES' ELSE 'NO' END)


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings