Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How can i make a field mandatory

Hi Experts

I want to make a field in the purchase order mandatory for data entering. how can i do this?

Do i have to use the SDK or a Formatted search please tell me the proper way of doing this.

Thanks & Regards

Kanishka Wickrama

Former Member
replied

Try this one, it is working. (And see the difference) ::

ALTER proc [dbo].[SBO_SP_TransactionNotification] 

@object_type nvarchar(20), 				-- SBO Object Type
@transaction_type nchar(1),			-- [A]dd, <u>pdate, [D]elete, [C]ancel, C[L]ose
@num_of_cols_in_key int,
@list_of_key_cols_tab_del nvarchar(255),
@list_of_cols_val_tab_del nvarchar(255)

AS

begin

-- Return values
declare @error  int				-- Result (0 for no error)
declare @error_message nvarchar (200) 		-- Error string to be displayed
select @error = 0
select @error_message = N'Ok'

--------------------------------------------------------------------------------------------------------------------------------

--	ADD	YOUR	CODE	HERE
IF (@object_type = N'22' AND @transaction_type in (N'A', N'U') )
BEGIN
IF EXISTS (SELECT T1.DocEntry FROM OPOR T0 inner join POR1 T1 on T0.DocEntry = T1.DocEntry
WHERE (T1.OcrCode IS NULL or T1.OcrCode = '') AND T0.DocEntry = @list_of_cols_val_tab_del)
BEGIN
Set @error =1
set @error_message = 'Profit Center cannot be blank'
END
END

--------------------------------------------------------------------------------------------------------------------------------

-- Select the return values
select @error, @error_message

end

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question