Skip to Content
0
Jan 15, 2020 at 11:41 PM

Default Cost center by user in Marketings Documents using FMS SAP B1

414 Views Last edit Jan 16, 2020 at 12:53 AM 6 rev

Hello

Our compagny want to set default cost center for our shop in marketing documents (A/R invoice for ex)

We have 3 shop , 3 user with their default warehouse and for Ex :

When user 'BQ2' (Shop number 2) create A/R Invoice + payment , default cost center (BQ2) should automaticaly be there and he should not be able to create A/R Invoice without adding the cost center/distribution rule .

I know that you can allocate cost center/distribution rules directly in chart account

But our G/L Accounts (Sales and expendures) are based on Item Group , not Warehouse

i checked in form settings , document tab , i can allocate the distribution rule/cost center , but when i close the A/R invoice et re-open a new one , it reset and we need to select again the cost center.

So i searched on this forum and on internet , and saw that it's possible , for that case , to use FMS to fill the required cost center .

I tried this query for an exemple :

SELECT T0.[PrcCode] FROM OPRC T0 WHERE T0.[PrcCode] ='IT'

Put a FMS directly on COGS dimension/Distribution Rule based on this query and auto-refresh when the user select item code in A/R Invoice and its work perfectly

Now i want FMS who consider UserID and then select automatically the distribution rule using CASE query

SELECT Case when (select $[user]) = 8 then (SELECT T0.[PrcCode] FROM OPRC T0 WHERE T0.[PrcCode] ='BQ2') when (select $[user]) = 2 then SELECT T0.[PrcCode] FROM OPRC T0 WHERE T0.[PrcCode] ='IT') End

I tried this one , but i had error syntax , can you help , is it the correct way ? Thanks

https://www.leveragebusinessone.com.au/cost-centres-sap-business-one/

Also This link is another solution responding to my problem , even if the distribution rule doesn't come automatically, we can force the user to set the correct D.R

so if you can help me on how to create Additionnal autorisation and give me the SBO_SP_TransactionNotification stored procedure query for my case (they didn't show that part) , it will help.

Thanks