cancel
Showing results for 
Search instead for 
Did you mean: 

Prevent for entring wrong data

Former Member
0 Kudos

Dear all

How can i Prevent a user from adding a Sales Invoice if the field 'Customer Ref. No' is empty/blank. ..... HELP

Thanks & Regards

Rajnish Srivastava

Accepted Solutions (1)

Accepted Solutions (1)

former_member196081
Active Contributor
0 Kudos

you should use stored procedure for this

Answers (1)

Answers (1)

Former Member
0 Kudos

you can use SBO_SP_TransactionNotification

and add your required condtion there.

Former Member
0 Kudos

Hi .. thanks for ur reply.....

Please tell me the detail how can i do that ..... i am new in SAP......

Thanks & regards

Rajnish Srivastava .. ]

Former Member
0 Kudos

Hi Rajnish,

Add this code in SP --Add code section

IF @object_type='13' and @transaction_type='A'-- Sales Invoice Add

BEGIN

If exists

(Select o.DocEntry from oinv o

where o.DocEntry=@list_of_cols_val_tab_del

and (o.NumAtCard ='' or o.NumAtCard is null) )

select @error = 1,

@error_message = 'Please enter Customer Ref No. in Sales Invoice !'

END

Please mark as answer if your problem solved.

Regards,

Former Member
0 Kudos

hi

my problem is solved ... but what if i want to set it for some different field .... means where i can find the code for different fields ...

as u provide @object_type='13'..... what object type i used for different fields like if i want to restrict the user to enter the remarks ... wht string(as u answered 13 for NumAtCard) i need to pass there ..... and from where i can find the strings detail for different fields......

Thanks & regards ,..

Former Member
0 Kudos

Dear 13 is used for not any field, its used for Document identification.

For Sales Invoice = 13

Sales Order = 17

You can check like:-

Select objtype from ordr

Please mark as answer if your problem is solved.

Best of Luck....

Former Member
0 Kudos

thanks for ur help........CLOSED...........................

Former Member
0 Kudos

THANKS