Skip to Content
0

Need a SPT

Nov 12, 2016 at 09:00 AM

79

avatar image
Former Member

Hi Experts

I need to block the user who attempt to post the JE (Open, Not based on Document)

when ever a User try to post JE and if the user included any GL codes from any of these Drawers

Turnover,Cost of Sales,Operating Costs,Non-Operating Income and Expenditure,Taxation and Extraordinary Items

the user should not be allowed with out selecting Cost center, and it should be applicable for

Open JE & From These Drawers only

Regards


10 |10000 characters needed characters left characters exceeded
Former Member

Hi Experts

Any Solutions

Regards

0
Former Member

Hi experts

Any solution ??

Regards

0
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
DIEGO LOTHER Nov 15, 2016 at 12:09 AM
1

Hi Shahan

For validate JE use the object type 30 in your transaction notification. Like this:

if (@object_type = '30') begin 
	--Do your validation here
end

Kind Regards,

Diego Lother

Show 3 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi sir

am a functional guy, not much aware of Tech side, pls help me by Coding

REGARDS

0
Former Member

Hi Lother

This how i try for SPT

IF (@Object_Type='30') AND (@transaction_type in ('A', 'U'))

BEGIN IF EXISTs (SELECT JDT1.Account FROM JDT1 Inner Join OACT ON JDT1.Account = OACT.AccntntCod WHERE OACT.GroupMask IN ('4','5','6','7') and JDT1.ProfitCode IS NULL AND JDT1.TransId = @list_of_cols_val_tab_del)

Begin SET @error = 10 SET @error_message = N'Its Mandatory to Choose The Cost Center'

End

End

But its not Blocking the Process

Regards

0

Hi Shahan,

This is the way. Below the your query with some corrections. I believe that should do the work.

IF (@Object_Type='30') AND (@transaction_type in ('A', 'U'))
BEGIN 
	IF (EXISTS (SELECT T0.Account FROM JDT1 T0 INNER JOIN OACT T1 ON T0.Account = T1.AcctCode WHERE T1.GroupMask IN ('4','5','6','7') and ISNULL(T0.ProfitCode, '') = '' AND T0.TransId = @list_of_cols_val_tab_del))
	BEGIN 
		SET @error = 10 SET @error_message = N'Its Mandatory to Choose The Cost Center'
	END
END

Kind Regards,

Diego Lother

1
avatar image
Former Member Nov 17, 2016 at 10:52 AM
0

Hi,

What's your SAP version?

In General settings, you can define whether to block postings without Cost center code.

Administration -> System initialization -> General settings -> Cost accounting Tab -> Distribution Rule.

Regards,

Bala

Share
10 |10000 characters needed characters left characters exceeded