
Hello All,
After talking to some customers and getting feedback about documentation, one of the points mentioned was the need for more information about debugging hints in the SAP transactions.
Thinking about this, I realized I'm always debugging :cool: -, but, until now, I never created documentation describing how to debug transactions in the Procurement area.
Therefore, this post is special with debugging hints for those who work with invoice creation using MIRO.
One of the main scenarios I usually debug is the integration between MM and FI, where common questions are:
A. What IV sends to FI?
B. What FI sends back to IV?
C. Is IV or FI responsible to generate a specific line in the subsequent FI document?
In order to know the answers to all of these questions, two important breakpoints should be set inside the function module MRM_INVOICE_POST:
1. The first breakpoint needs to be set in the call of function module CKMV_AC_DOCUMENT_CREATE.
2. The second breakpoint needs to be set right after the call of this same function.
See the screenshot with the breakpoints:
During MIRO execution, these breakpoints will be called when you choose Simulate button.
Basically, as the comment in the code says, when function module MRM_INVOICE_POST calls function module CKMV_AC_DOCUMENT_CREATE, this is the calling to the accounting interface.
ℹ TIP: Always read the comments in the code, it can clarify potential questions!
Some hints when you start your debug session:
Sometimes, I have to analyze why a FI document is posted with the wrong G/L account, or why a G/L account line is presenting wrong values.
For this, I set the mentioned breakpoints and I simulate a new invoice in MIRO.
Once the system stops in the first breakpoint:
From this table I collect the data from the following fields:
- POSNR = Accounting Document Line Item Number
- KTOSL = Transaction Key
- SAKNR = G/L Account Number
From this table I collect the data from the following fields:
- POSNR = Accounting Document Line Item Number
- CURTP = Currency type and valuation view
- WAERS = Currency Key
- WRBTR = Amount or tax amount in the currency of the currency types
- KURSF = Exchange rate
At a first look at the data collected, we already can see if FI or IV generated the specific line we are analyzing (now this is the answer to question C :cool: ).
Sometimes, FI changes a G/L account number because there is a FI substitution involved.
Or, there are split lines generated on the FI side. Therefore, FI will return to IV with several new lines.
And, there are cases where information will be kept as it was sent from IV to FI, with no differences.
These breakpoints are also very useful during cancellations via MR8M transaction.
The logic is the same, and I use it to check posting differences between the original invoice posted and the current cancellation posting values.
Other common scenarios I see are related to exchange, price, or stock differences.
Checking XACCIT-KTOSL (transaction key), I identify if it is an exchange rate difference if XACCIT-KTOSL = KDM, a price difference if XACCIT-KTOSL = PRD, or a stock difference if XACCIT-KTOSL = BSX. Please, don't rely on the G/L account number or its description! The correct way to identify a line in a FI document is always checking the transaction key!
When different currencies are involved, and translations are required, the next step is to check XACCCR-KURSF (exchange rate) values, to see what is the exchange rate used and then identify from where this is coming.
In the function module MRM_INVOICE_POST in terms of exchange rate, we can check:
- PERFORM zeile_generieren: it calculates items values in local currency. If the material ledger is active for the plant, this form calculates also items values in the second local currency:
- PERFORM accit_kred_aufbauen: this form calculates the value of the vendor line in local currency:
- PERFORM accit_kred_aufbauen_hw: this form calculates the value of the vendor line in local currency. And, if the material ledger is active, this form also calculates the value of the vendor line in the second local currency:
Hope these debugging hints help you to better perform your invoice posting analysis, whenever you need it :smile:
Regards,
Carla Bussolo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 | |
2 |