Skip to Content

Need Help for this SPTN?

Hi Friends

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

if exists (SELECT t0.CardCode FROM [OCRD] T0 inner join OUSR T1 on T0.UserSign=t1.internal_k WHERE t0.GroupCode in ('108','114','115') and T0.CardType='C' and T0.UserSign not in ('1','45', '46','47','48','61','62','55','70','65') and T0.CardCode=@list_of_cols_val_tab_del) begin

select @Error = 186,@error_message = 'Customer Group of SEZ,Dealer,Branch not allowe to create,Branch-Ask Your Branch Manager"'

end

end

in this SPTN , i am not able updated that groups through manager user also,

what is wrong in his query plz let me know

Regards

Kurma

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Nov 09, 2016 at 01:28 AM

    Hi Reddy,

    First of all in your case, you don't need to do a inner join with OUSR, because you don't use this table. Check if the UserSign of your user "manager" are in the list ('1','45', '46','47','48','61','62','55','70','65').

    Hope it helps

    Kind Regards,

    Diego Lother

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Reddy,

      What is the UserSign of your "manager" user?. If the "manager" user that you mentioned is the default user of SAP B1, you shoudn't receive any error, because the UserSign is 1. If not, try run this query:

      SELECT INTERNAL_K FROM OUSR WHERE USER_CODE = 'your user login here'

      get the result and add the new value on your list ('1','45', '46','47','48','61','62','55','70','65', 'new value').

      Hope it helps.

      Kind Regards,

      Diego Lother

  • avatar image
    Former Member
    Nov 09, 2016 at 12:29 PM

    Hi,

    This worked

    if exists (SELECT t0.CardCode FROM [OCRD] T0 WHERE t0.GroupCode in ('108','114','115')

    and T0.CardType='C'

    and T0.UserSign not in ('1','45', '46','47','48','61','62','55','70','65')

    and T0.CardCode=@list_of_cols_val_tab_del)

    Begin

    set @Error = 186

    set @error_message = 'Customer Group of SEZ,Dealer,Branch not allowed to create,Branch-Ask Your Branch Manager"'

    End

    Regards

    Pradnya

    Add comment
    10|10000 characters needed characters exceeded