Skip to Content

Need help in SPT Modification

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Aug 22, 2017 at 06:30 AM
    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 '' 
    Add comment
    10|10000 characters needed characters exceeded


    • 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