Skip to Content
0

Need help in SPT Modification

Aug 22, 2017 at 05:51 AM

36

avatar image

Dear Experts

am having a SPT, which allow only a single User to Add/ edit BP master data

I need a little Modification in this ,

I need the same SPT to allow 2 users to Add/ edit BP master data

Pls help me to Solve

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

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

BEGIN

IF (SELECTCASEWHEN @transaction_type ='A'AND UserSign <> 8 THEN 8

WHEN @transaction_type ='U'AND UserSign2 <> 8 THEN 8

ELSE 0 END

FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del) =8

BEGIN

SET @error =-100

SET @error_message ='Only User User1 is Allowed to Create and Edit Business Partners'

END

END

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Kennedy T Aug 22, 2017 at 06:30 AM
0
IF (@object_type = '2' AND @transaction_type IN ('A', 'U'))
BEGIN
    IF EXISTS (
           SELECT cardcode
           FROM   OCRD
           WHERE  CardCode = @list_of_cols_val_tab_del
                  AND UserSign2 IN ('8', '')
       )
    BEGIN
        SET @error = -100      
        SET @error_message = 'Only User User1 is Allowed to Create and Edit Business Partners'
    END
END

-- enter the 2nd user code into '' 
Show 4 Share
10 |10000 characters needed characters left characters exceeded

Thanks rajan

Sir , its not working, its not allowing user when I use your coding

I Just assign the usersign2 ('8','5')

but when it try to edit from Usersgin2 = 6, then it allows to edit

I need to allow only usersing2 ('8','5') to add and edit

can I use Userid ('8','5')

regards

0
 
IF (@object_type = '2' AND @transaction_type IN ('A', 'U'))
BEGIN
    IF EXISTS (
           SELECT cardcode
           FROM   OCRD
           WHERE  CardCode = @list_of_cols_val_tab_del
                  AND UserSign2 not IN ('8', '5')
       )
    BEGIN
        SET @error = -100      
        SET @error_message = 'Only User User1 is Allowed to Create and Edit Business Partners'
    END
0

Hi Kennedy

I updated the SPT with your recent one , after that

when I test to update and add from other user and from usersign2 8 & 5

its blocking by pop up with an error

(-1) Stored procedure SBO_SP_TransactionNotification must return a value

regards

0

IF (@object_type = '2' AND @transaction_type IN ('A', 'U')) BEGIN IF EXISTS ( SELECT cardcode FROM OCRD WHERE CardCode = @list_of_cols_val_tab_del AND UserSign2 not IN ('8', '5') ) BEGIN SET @error = -100 SET @error_message = 'Only User User1 is Allowed to Create and Edit Business Partners' END END
0