Today I got a case from my support counterpart, whereby business just raised a ticket that claim when she printed the invoiced, one of the value was not been displayed in the subtotal.
As you can see in the screen above, though there are two Condition Types with subtotal maintained in the transaction, but in the printing, it only displays one. Only subtotal of Minimum Order Charge is shown.
This case is quite strange, in my opinion. How can be if the same value occurred for consecutive Condition Type, only one value is displayed and the other value is getting suppressed?
Then when I saw the issue explained by my counterpart, in my opinion it sounds pretty straightforward the root cause probably lies in the printing indicator.
And normally, the printing program will use function module to generate the components relevant for pricing. In my case, function module RV_PRICE_PRINT_HEAD is used. So I put some breakpoint inside this function module program.
After spending some time checking through debugging, then finally I found the ‘culprit’.
It’s quite interesting I can say, that there is line of syntax in line 164 if you say below snapshot. The syntax says, if found the current XKOMV-KWERT value same with previous subtotal, then do not append it to the structure TKOMVD. This what happened for my case that caused the subtotal for Emergency Fee did not appear in the output. Because they both have same amount as 100$.
Furthermore I checked, this code was invoked because the printing indicator used in my client still use the previous procedure (‘X’ or ‘S’).
After found the root cause, I then tried to simulate by changing the printing indicator to use the new procedure (‘ABCD’/’abcd’).
I chose ‘B’ for header and ‘b’ for item to replace the current printing indicator.
Woilaa! The values now can be displayed all of the subtotals, regardless if the value are the same.
Though currently the subtotals are able to be displayed. I still don’t understand and probably this just out of my curiosity only. Why SAP put such logic to prevent the same values of different subtotals to be displayed. It is normal, isn’t it, to have the same amount for different purpose? And the logic is only used if the printing indicator ‘S’?