Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 7846

Mandatory stored procedure for Item Master Data

$
0
0

Hi All,

 

I tried creating a stored procedure to prevent empty value in item master data.

 

But it doesn't seem to work. I need experts to help me on this.

 

--Variable declarations

DECLARE @numatcard nvarchar(100)

DECLARE @count INT

DECLARE @price INT

DECLARE @docdate date

DECLARE @Shipdate date

declare @OrdBalQty NUMERIC(19,6)

declare @GrQty NUMERIC(19,6)

declare @ItemCode nvarchar(20)

declare @LineNum INT

declare @itemname nvarchar(100)

declare @purchaseuom INT

declare @packinguom INT

declare @inventryuom nvarchar(200)

declare @defaultwarehouse nvarchar(50)

declare @ordermulti INT

declare @moq INT

declare @leadtime INT

 

 

--    STORED PROCEDURE STARTS HERE --

 

-- Prevent Item master data addition without proper conditions.

 

IF @OBJECT_TYPE='4' AND @TRANSACTION_TYPE='A'

BEGIN

    IF EXISTS (SELECT ITEMCODE FROM OITM WHERE itemname is null AND ordrmulti is null AND ITEMCODE = @list_of_cols_val_tab_del)

 

    BEGIN

    SET @error = 5

    SET @error_message = 'PLEASE FILL IN THE MANDATORY COLUMNS!'

    END

END

 

If columns are blank , users are not allowed to add the entry.

 

Thank you in advance.


Viewing all articles
Browse latest Browse all 7846

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>