cancel
Showing results for 
Search instead for 
Did you mean: 

Transaction Notification For User Defined Object

Former Member
0 Kudos

Dear Expert,

I want to create a transaction notification for my user defined form. I have a matrix on my form which has a field as 'Code'. I want that this field (On Row Level) should have unique values all the time while adding or updating the form.

Object Type: MaterialMaster

Table Name: MaterialDetails

FieldName: U_Code

Plz help me to get this notification.

Regards

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Amit,

Please check below query.

IF @object_type = 'MaterialMaster' AND @transaction_type IN('A','U') and @error = 0

BEGIN

IF ( SELECT COUNT(*)

FROM MaterialDetails A


WHERE A.U_Code IN (SELECT U_Code FROM MaterialDetails WHERE  U_Code = @list_of_cols_val_tab_del)

GROUP BY A.U_Code

HAVING COUNT(*) > 1

) >1

BEGIN

  set @error = -10

  set @error_message = 'You can not Add Dublicate Code'

END

End

Hope this help

--

--

Regards::::

Atul Chakraborty

Former Member
0 Kudos

Dear All,

Plz reply to my question. It is very important.

Regards

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Check this thread:

http://scn.sap.com/thread/1766096

Thanks & Regards,

Nagarajan

Former Member
0 Kudos

Hi ,

Can you  please explain how can I check whether a particular value exist or not. Or it can be the case that user can enter 2 same values while adding or updating the form. How can I check that ?

Regards

Former Member
0 Kudos

Dear All,

Plz reply. Is it possible or not ?

I can describe in details.

Regards

Former Member
0 Kudos

Hi

I have tried this. but it is not working for me. Plz help me:

IF @transaction_type IN ('A','U') AND @object_type = 'MaterialMaster'

BEGIN

IF EXISTS

     (

select T0.U_Code from [@MaterialDetails]  T0 where

T0.U_Code = @list_of_cols_val_tab_del

)

BEGIN

SELECT @Error = -1, @error_message = 'Number already exist.'

END

END

Regards

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Sorry for keep you waiting. Without correct object type, stored procedure will not work. I am not able create UDT  to test.

Check this threads,

Thanks & Regards,

Nagarajan

former_member192773
Active Participant
0 Kudos

hello Amit,

try something like this:

if(

select count(T0.U_Code) from [@MaterialDetails]  T0 where

T0.U_Code = @list_of_cols_val_tab_del) != 1

begin

--ERRORMessage

end

Regards Teun

Former Member
0 Kudos

hi.plz check it..

Former Member
0 Kudos

Hi,

I already checked this. But I am not able to set my condition. Code value should have unique values all the time.

Regards