Hi everyone.
I'm trying to implement a condition to not let the user add/update any document if a specific field if he's null or empty. But, unfortunately, it's not working.
Can you find the error?
DECLARE @SeasonOINV NVARCHAR(50);
IF @object_type='13' and (@transaction_type='A' or @transaction_type='U')
BEGIN
SELECT @SeasonOINV = OINV.U_Season FROM OINV WHERE DocEntry = @list_of_cols_val_tab_del;
IF (@SeasonOINV IS NULL or @SeasonOINV = ' ')
BEGIN
SET @error = 1000;
SET @error_message = 'SAP ERROR: Must choose a season - Maybe Item doesn''t have season defined or It''s a service Doc. Please fill any value.';
SELECT @error, @error_message
RETURN;
END
END
Thanks,
Anita.