We have a requirement to post cash discounts for non-merchandise to a separate G/L account which is different from our merchandise discount G/L account. I started down the road of using substitution to achieve this requirement and using a user exit to achieve this requirement. I am doing substitution using the Complete Document since I need to loop through the line items to determine if the vendor first is a non-merchandise vendor and then again to see if a cash discount was created. The program works fine as far as substituting the correct G/L account in the BSEG table, but I run into trouble when it tries to create the controlling document. I get the error "Internal Error: Entry in COKA-Buffer Not Found". I've read SAP note 436046 which isn't much help in this scenario for achieving my business requirement.
Just for testing purposes, I did a substitution as a line item where anytime the G/L account for cash discount appears I substituted it with the new Non-Merchandise G/L account. When I do it this way, everything processes through fine including creating the controlling document.
Can you tell me if there is a way at the line item level to see all the line items that will be processed where I can see if the correct vendor G/L account will be part of this document? Basically, I want to influence the cash discount G/L account number only if I have a certain vendor G/L account number? Or do you know a way around the error I am receiving when I have my user exit at the complete document level?
If none of these options will work, do you have any other suggestion on how we can post our non-merchandise cash discounts to a separate G/L account?
Any help/direction would be most appreciated.