SAP for Utilities Discussions
Connect with fellow SAP users to share best practices, troubleshoot challenges, and collaborate on building a sustainable energy future. Join the discussion.
cancel
Showing results for 
Search instead for 
Did you mean: 

FPMA issue-> create single clearing document per debit item

0 Kudos

Dear all, I have the folllowing requirement.

When running the automatic clearing, a clearing document should be created per invoice/ debit item. Currently what is happening is for a contract object, all invoices and open credits are set off in a single clearing document.

Current behaviour:

a) Account balance:

Invoice 1 : $100

Invoice 2:  $300

Open credit: $1000

b) Run the automatic clearing

Clearing document 01  posted with 3 subitems

Subitem 1 : $100

Subitem 2:  $300

Subitem 3: -$400

Open credit of $600 posted

Current requirement:


a) Account balance:

Invoice 1 : $100

Invoice 2:  $300

Open credit: $1000

b) Run the automatic clearing

Clearing document 01  posted with 2 subitems

Subitem 1 : $100

Subitem 2:  -$100

Clearing document 02  posted with 2 subitems

Subitem 1 : $300

Subitem 2:  -$300

Open credit of $600 posted

Can anyone advise on how to achieve this(note that event 0591 cannot be used to achieve the above)?

12 REPLIES 12

Former Member
0 Kudos

Hi Antish,

Check the configuration Financial Accounting->contract.acc. rec and paya->basic functions->open item management->clearing control->clearing variants->define clearing variants.

Here you control the grouping criteria by various parameters like contract, main trans, sub trans, etc.  Also you could look at implementing FM FKK_SAMPLE_TFK115 which can be called within the clearing variants.

Regards,

Yuvi.

0 Kudos

Hi Yuvraj, thanks for your reply. If you look at the example i gave above there are no common fields between the invoice and the open credit(apart from contract object). In this case, I cannot use any grouping  

AmlanBanerjee
Active Contributor
0 Kudos

Hi Antish,

Have you tried the grouping characterisitic functionality for auto clearing under the following node-

Financial Accounting-->Contract Accounts Receivable and Payable--->Business Transactions-->Automatic Clearing--->Grouping Variants-->Define Grouping Characteristics

In this activity, you define the characteristics that you use to group the items to be paid in the clearing run.

So if you create characteristic which groups them by OPBEL (FICA Document no.), then I think it would group by document no. and create a separate clearing document for each FICA document no.

Once you have configured the grouping characteristic, maintain it in the following SPRO node

Financial Accounting-->Contract Accounts Receivable and Payable--->Business Transactions-->Automatic Clearing--->Grouping Variants-->Define Grouping Variants

Once done maintain the grouping variant in the following SPRO node-

Financial Accounting-->Contract Accounts Receivable and Payable--->Business Transactions-->Automatic Clearing--->Define Specifications for Automatic Clearing

Now run FPMA to check whether its working or not.

Hope it helps...

Thanks,

Amlan

0 Kudos

Hi Amlan, I had initially tried with the config you mentioned. System does not do any clearing here since it is unable to carry out the grouping by doc number(since doc number is unique). I have attached a screenshot of the log when i run FPMA with this config.

For the time being, I am forced to use event  590 where I am allowing only one invoice to be cleared at a time and deleting the rest from the parameter table. This way we are getting one clearing doc per invoice. In addition to that, i have to plan several sequential jobs for the automatic clearing so that in case taxpayer has several invoices, each invoice will be cleared per job. The risk is controlled since the number of taxpayers is small so far but it is not an ideal solution.

0 Kudos

Likewise, we use event 591.  The problem with events 590 & 591 is they run before clearing control is called.  Because of this clearing control only sees the one debit you passed and multiple credits.  By doing this you have programmatically decided the order upon which the debits will be cleared.  As long as you keep that in mind you should be fine.

Events 590 & 591 are not the answer if you expect clearing control to control the order of your debit clearing.  When used, you must programatically make that decision.

I

raviahuja
Contributor
0 Kudos

Hi Antish,

It might be late but can you try below config:

1. Define Clearing Categories

Financial Accounting > Contract Accounts Receivable and Payable > Basic Functions > Open Item Management > Clearing Control > Define Clearing Categories

2. Define Clearing Types

Financial Accounting > Contract Accounts Receivable and Payable > Basic Functions > Open Item Management > Clearing Control > Define Clearing Types (Use by default provided by SAP)

3. Define Clearing Variant

Financial Accounting > Contract Accounts Receivable and Payable > Basic Functions > Open Item Management > Clearing Control > Clearing Variants > Define Clearing Variants

Here for each clearing variant, you can define clearing steps. And within these clearing steps, you can define your grouping and sorting rule based on OPBEL i.e. document number.

4. Lastly, define defaults for account maintenance

Financial Accounting > Contract Accounts Receivable and Payable > Basic Functions > Open Item Management > Clearing Control > Define Specifications for Clearing Types > Define Defaults for Account Maintenance.

Hope it helps.

Ravi

Former Member

Ravi,

Surely this configuration will not work as a clearing requires both a debit and credit.  Both of which will have different document numbers.  Using opbel as grouping characteristic would result in no clearing.

Former Member
0 Kudos

any news on this issue? Did it got resolved in the meantime? I have similar issue...

0 Kudos

Geoffrey,

My requirement was to limit clearing to 1 credit and multiple debits.  I accomplished this using event 591 and have been using this method for 2 years in production without issues.

Antish's requirement was to limit clearing to 1 credit / 1 debit.  I was able to prototype this using events 110 and 591 together.   I do not have this running in production.

I have not seen a solution relying on configuration I found plausible.

Thanks...

0 Kudos

Hello Tim,

Thank you very much for your reply.

Can you send me the code you wrote for prototyping? I would like to have a look at it and maybe use it in production. My customer wants to clear one debit and one credit entry at a time.

Thanks for your help.

Rgds,

Geoffrey.

0 Kudos

Perhaps prototype was not an adequate description.   I used my current function modules and manipulated events 591 and 110 thru debugging.  I'm comfortable it will work.  Here is what I recall:

Event 591 is called prior to clearing control.  Using field azvdg_0591 you can control what is grouped in clearing control.  . At our location, we group 1 credit and all debits in event 591, This guarantees a seperate clearing document for each credit..  Field E_ITNUM_NEXT tells clearing control to return to event 591 for the next grouping. 

Event 110 returns the clearing proposal.  Here you can control what is actually cleared and reduce the proposal to 1 debit / 1 credit.  We have not enhanced event 110 at this location.

Its a iterative process for each BP.

Event 591 is called as long as E_ITNUM_NEXT = 2.

Event 110 - returns clearing proposal which can be manipulated.

Repeat for remaining documents..

So you basically you have 2 events to work with.  One at the beginning to control what goes into clearing control and the other at the end to control what is finally cleared by the clearing document.  A developer should be able to use 1 or both of thse events in combination to accomplish your goal. 

Just be sure your coding of these events does not conflct with your clearing configuation.

0 Kudos

hi  Tim , thanks for your sharing ,very useful ..............

I learned a lot of here from above everybody....