cancel
Showing results for 
Search instead for 
Did you mean: 

Validation Query

Former Member
0 Kudos

How to validate Manufacturer Name (thru drop down) in OITM Table during Purchase Order

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hii

Try this

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

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 = '22' and @transaction_type = 'A'

begin

If  ( Select T1.ItemCode

              from OPOR T0 Inner join POR1 T1 on T0.DocEntry = T1.DocEntry

                              Inner join OITM T2 ON T1.ItemCode = T2.ItemCode

                               where T2.FirmCode = @list_of_cols_val_tab_del) is null

Begin                         

select @error = -5001

select @error_message = N' Please add another vendor'

End

End

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

-- Select the return values

select @error, @error_message

end

Former Member
0 Kudos

HI,

Any one can help me on the same thru a validation sql query?

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Please explain with an example.

Thanks & Regards,

Nagarajan

Former Member
0 Kudos

Hi Nagarajan,

Good Morning !

I have managed my item master with multiple manufacturer name thru SAP default feature on Item Master-->Manufacturer Name On Item Master General Tab.  How I can validate the same thru sql query during Purchase Order Generation on restricting user from other than manufacturer name apart from master.

Regards,

Pramod

Former Member
0 Kudos
Former Member
0 Kudos

KennedyT21
Active Contributor
0 Kudos

Hi P.K. Swain...

You can use the Transaction Notification for the Validation...

Check with the link


http://scn.sap.com/people/lisa.mulchinock/blog/2009/05/22/the-sptransactionnotification-stored-proce...

Hope Helpful


Regards

Kennedy

kvbalakumar
Active Contributor
0 Kudos

Hi,

Do you mean to say that the Vendor in the Purchase Order should be same as Item's Manufacturer name?

Regards,

Bala