Skip to Content
Jan 17, 2018 at 07:04 AM

Validation for inventory and Non-Inventory items should not allow in same document



i am working in SAP B1. we are using gate inward with help of ADD ON. during gate inward entry inventory and Non-Inventory item should not allow in same document.

How does we control through sql validate?

i tried via below queries. but it doesn't work properly. please guide me.

if exists (select * FROM [@INSEC_OOGI] A inner join [@INSEC_OGI1] B on A.DocEntry=B.DocEntry left join oitm c on b.u_itemcode=c.itemcode where c.invntitem not in ('Y','N') and a.DocEntry=@DocEntry) SELECT @ErrorCode=10 , @ErrorName = 'Document cannot containt both regular and asset item..'