有PO沒PR的查詢

2021-06-27 00:38:47 字數 2795 閱讀 4776

select rrsl.rcv_transaction_id,

--pre.attribute1,

(case

when p_acct = '16049901' then

(select trim(fa.serial_number)

from fa_additions_v fa

where fa.asset_number = pr.attribute1

and rownum = 1)

when p_acct = '16049902' then

(select trim(fa.serial_number)

from fa_additions_v fa

where fa.asset_number = pr.attribute1

and rownum = 1)

else

pr.attribute1

end) segment1,

'' item_number,

-- rrs.je_source_name

'採購接收' sources, --**

1 seq,

'tot' seq_tt,

rsh.receipt_num num,--接收單號

rrsl.accounting_date dates, --日期

(nvl((rrsl.accounted_dr), 0) -

nvl((rrsl.accounted_cr), 0)) amt --本位幣金額

from (select prl.attribute1,

prh.requisition_header_id,

prl.requisition_line_id,

prl.line_location_id,

prd.distribution_id

from po_requisition_headers_all prh, 

po_requisition_lines_all prl,

po_req_distributions_all prd

where prh.requisition_header_id = prl.requisition_header_id

and prl.requisition_line_id = prd.requisition_line_id) pr,--退貨沒有pr 因此作為子查詢

po_headers_all             poh,

po_lines_all               pol,

po_line_locations_all      pll, --  pre po rsl rsh rt

po_distributions_all       pda,

rcv_transactions           rt,

rcv_receiving_sub_ledger   rrsl,

gl_code_combinations       gcc,

rcv_shipment_headers       rsh,

rcv_shipment_lines         rsl

where 1 = 1

and poh.po_header_id = pol.po_header_id

and pol.po_line_id = pll.po_line_id

and pll.line_location_id = pda.line_location_id

--and pla.po_line_id = rsl.po_line_id

and pll.line_location_id = pr.line_location_id(+)--用子查詢的外連線

and pr.distribution_id = pda.req_distribution_id--delete:子查詢之後 此條件導致查不出退貨(採購訂單號)%5038 

and rt.organization_id = pll.ship_to_organization_id

and rt.po_line_location_id = pll.line_location_id

--***重要條件**

--and rsl.po_distribution_id = pda.po_distribution_id--delete by wrh 20140605:缺少201402的510100009739

and rt.po_distribution_id = pda.po_distribution_id

--***重要條件**

and rsh.shipment_header_id = rsl.shipment_header_id

and rt.shipment_line_id = rsl.shipment_line_id(+)

and rt.shipment_header_id = rsh.shipment_header_id

and rt.transaction_id = rrsl.rcv_transaction_id

--and pre.requisition_line_id = rt.requisition_line_id(+)

and rrsl.code_combination_id = gcc.code_combination_id

and gcc.segment3 = nvl(p_acct, gcc.segment3)

and to_char(rrsl.accounting_date, 'yyyy-mm') =

nvl(p_date, to_char(rrsl.accounting_date, 'yyyy-mm'))

and poh.org_id = p_org_id

PR與PO的控制

以下就業務要求及sap的技術設定詳細說明。1.po必須參考pr建立,不允許採購員手動使用me21n直接建立。啟用 採購員的功能許可權 1.1 spro 物料管理 許可權管理 定義採購員的功能許可權,按業務要求定義乙個新的profile.圖11 01 1.2 將1.1定義的profile assign...

有網和沒網的生活

文章寫於12月1日。有一周,因為一些原因,宿舍斷網了。倒也沒什麼感覺,要獲取什麼資訊,手機也是很ok的。又過了一周,網路復原了,我一衝動,又給電腦裝上了warcraft和11平台,想偶爾玩一盤,結果沒把持住,就一發不可收拾了。玩dota,玩蜀門,當然沒大學時候瘋狂了,也佔據了我下班後生活的一部分,最...

JE 裡有沒喜歡搖滾的 Linkin Park

大家寫 之餘,有什麼消遣的啊,聽 都聽什麼呢。我是各種 都聽,古典居多,流行歌流行之後偶爾挑一首聽聽,搖滾的愛好是從步入程式設計的時候開始的,開始只是用來刺激下神經,換換頭腦。後來一發不可收拾,聽著聽著竟能聽懂內哦a內涵了,特別是linkin park 那發自內心的嘶吼。隨便寫幾首自己聽的感覺 wh...