[Tips] Câu query tr...
 
Notifications
Clear all

[Tips] Câu query truy vấn thông tin Bin Location nhập mã hàng nào gần nhất

1 Posts
1 Users
0 Reactions
66 Views
admin
Posts: 411
Admin
Topic starter
(@admin)
Noble Member
Joined: 3 years ago

Sử dụng câu query sau:

select max(T0.MessageID) "MessageID", max(T0.CreateDate) "CreateDate", max(T0.TransType) "TransType", max(T0.DocEntry) "DocEntry"
, T0.ItemCode, T0.Dscription, T3.BinCode, T3.Descr "Bin Description"
from OILM T0
 join OBTL T2 on T0.MessageID=T2.MessageID
 join OBIN T3 on T2.BinAbs=T3.AbsEntry
where T0.AccumType='1' and T0.TransType in ('20', '18') and T3.BinCode='[%0]'
group by T0.ItemCode, T0.Dscription, T3.BinCode, T3.Descr
order by T3.BinCode

*** Câu query trên áp dụng cho chứng từ Goods Receipt PO (TransType = 20), AP Invoice (TransType=18), bạn có thể thêm các loại giao dịch khác, chẳng hạn Goods Receipt (TransType = 59)

Tham khảo thêm danh sách các chứng từ ở đây

https://forum.sapb1.vn/community/sdk/danh-sach-cac-objedt-type-trong-he-thong-erp-sap-business-one/#post-475

Reply
Share:
x  Powerful Protection for WordPress, from Shield Security
This Site Is Protected By
Shield Security