cancel
Showing results for 
Search instead for 
Did you mean: 

SP Transaction Notification for Special Prices

0 Kudos

Hi,

I need to monitor changes on the additions and updates for the business partners special prices. I have a challenge while implementing the

@num_of_cols_in_key because I understand a special price object number 7 has two keys i.e CardCode and ItemCode both from OSPP table.

I have tested with this sql code:

IF ((@object_type = 7) AND (@transaction_type = 'U'))

BEGIN

IF EXISTS (SELECT T0.ItemCode, T0.CardCode, T0.Price, T0.Currency, T0.Discount, T0.ListNum FROM OSPP T0 WHERE

  T0.ItemCode = @list_of_key_cols_tab_del)

BEGIN

What am I doing wrong?

Accepted Solutions (0)

Answers (2)

Answers (2)

mbanggo
Explorer
0 Kudos

Hi Paul,

I know this answer is way too late already, however the script below works for my transaction notification regarding special prices. I hope you can use this as your guide in writing your script.

----Uncheck the Auto Box in OSPP

if @object_type = '7' and @transaction_type in ('A','U')

begin

if exists

( Select * from OSPP

where (RTRIM(@list_of_key_cols_tab_del) LIKE 'CardCode' + CHAR(9) + 'ItemCode')

and cardcode = left(@list_of_cols_val_tab_del,len(cardcode))

and itemcode = right(@list_of_cols_val_tab_del,len(itemcode))

and AutoUpdt = 'Y'

)

Begin

set @error = 7000014

set @error_message ='Please Uncheck the "Auto" Box'

select @error, @error_message

return

End

End

Sincerely,

Melvin

Former Member
0 Kudos

Hi,

Can you explain your requirement in detail

0 Kudos

Hi,

I would like to create insert into select  where I am getting the updated fields from the OSPP whenever a change occurs.

I am having a problem with Sp transaction notification for the "Special Prices object" as it has two keys and two values that is CardCode and ItemCode. I have also trie using "T0.ItemCode in (@list_of_cols_val_tab_del) " to no avail.

What could be the problem?

Regards,

Paul.

Former Member
0 Kudos

Hi,

The problem is that parameter (@list_of_cols_val_tab_del ) contain the business partner and the item code . it seems that there is no space between them . is you need only the item code you have to substring the (@list_of_cols_val_tab_del )

shachar