cancel
Showing results for 
Search instead for 
Did you mean: 

Substitution at ML closing document

Former Member
0 Kudos

Good day

The following scenario considers internal produced materials and determination of actual value using the material ledger.

The SAP client where I am working has defined that the COGS account changes depending if the customer is related or not to the company corporate group. So far so good, because there is a substitution step that modifies the account depending on the value of a specific field (KNVV-KTGRD) in the customer master data.

The problem arises when performing the ML closing document. At this point I cannot find any data that allows me to link the line item to the customer or sales order so I cannot work any relation that allows me to substitute the account as it was done. The outcome is that the revaluation amount is going to be posted according to GBB-VBR, whereas the original post was posted in a different account.

What I need to know is if there is any way to retrieve the customer (or any SD relevant data) when posting the ML closing document in order to extend the substitution code to the ML closing document.

Kind Regards

Juan

Accepted Solutions (1)

Accepted Solutions (1)

ArturoSenosain
Advisor
Advisor
0 Kudos

Hi Juan.

The ML revaluation for COGS  is done at Controlling Level 'GL Account'  ( check Tcode OMXC or view V_CKMLMV007R

0009/v++). The GL account is active. This is explain in some way in note:

1242114 - Revaluation of consumption: Additional acct assgmt features

If the substitution in for COGS is done in the correct way, i think you dont need to do a substitution in the ML Close, the standard system must revaluate at Controlling Level!


I guess you are doing the substitution as a step in GGB1, my personal point of view is this is not a correct place to do because the ML document already exist  in the internal tables but not the FI BSEG line item.

In order to verify my point, do the following: In CKM3N, enter to the consumption file. do you see the substituted account or the original account? If the account is the original, i guess you are creating some inconsistency at dabase level. Your substitution must do the work in FI, CO and ML.


Keep in mind do a substution of accounts in FI document is a modification to the standard SAP (the fields HKONT is excluded from view VWTYGB01 in the standard system). I always recomend dont do this kind of account substitutions to my customer,but this is just my point of view.

Arturo.

Former Member
0 Kudos

Hello Arturo.

When I checked CKM3N as you suggested, the line below consumption category shows the wrong account (the one that is being determined according to the obyc settings and not the one posted in the FI document after the substitution).

I also checked the Controlling document and Profit Center document that were generated at the moment and both of them have the proper account, the one determined after the substitution. When I checked the ML document that was generated I did not find any field regarding the G/L account, so I do not think the substitution logic is my problem.

Next, I tried to figure out from where the system is reading the account that appears in CKM3N below the consumption category. I found that this record is kept in table CKMLMV005 and I also found that the record regarding the material I am looking at was generated before the goods delivery where the substitution of account took place. It seems the system wrote this record when the first good delivery for this material was recorded, and when this occurred the substitution was not meant to work. What I do not understand is why the system did not create a new consumption alternative when the substitution took place considering that this time there was a different G/L account.

If you have any comments regarding my analysis I would appreciate it. Regards.

Juan

ArturoSenosain
Advisor
Advisor
0 Kudos

Hi Juan.

The problem is the following:

In the creation of the FI document, the 1st step in the code is create the consumption line (controlling level) for the ML Document. After that, the system adjust the ACCT tables of the FI Document and one of the steps is trigger the substitution (in your case, the account). In other words, the GGB1 substitution is trigger to late, at a time all the info for the ML document is ready to insert at database level  Thats why you dont see the correct account in CKM3N

>>>

What I do not understand is why the system did not create a new consumption alternative when the substitution took place considering that this time there was a different G/L account.

>>> The reson is because GGB1 with HKONT is not standard, as you see the system is not intended to the substitution correctly in ML, in spite of doit correctly in FI and CO. Just for your info, if you have an account with cost element type 1 post to a cost center, you can see the substition only do its work in FI, but in CO you see an incorrecct cost element.

My option, i think its better do the substitution  in badi CKML_UPDATE , in the method MODIFY_FI_TABLES. This badi is trigger very early in the creation of the FI document, before the creation of the ML Document, so every change you do here is reflected both in ML and in FI. You can read the documentation in the marketplace,

Note 996305 - Documentation: BAdI CKML_UPDATE

PS. I never tested in a PRD system the substitution of an account (i only change other stuff), if you try, test carefully!




Answers (0)