I have read hundreds of posts related to BAPI_ACC_DOCUMENT_POST and creating profitability segment; however, I still am not satisfied that I have found the correct answer.
Some background...
- We are using BAPI_ACC_DOCUMENT_POST for the creation of a variety of "standard" entries
- Some entries use GL accounts for which profitability segment has been configured
- When we test an entry via the BAPI that has profitability segment active, we get an error back... F5 808 - GL account requires profitability segment
- When we test the same entry via transaction FB01, there is no problem. The "Assignment to profitability segment" popup appears with the characteristics Plant, Product, and Profit Center populated. User accepts the entries, and moves on.
I can make the BAPI work of course by populating the CRITERIA table with plant, product, and profit center; however, with the complexity of COPA, I will not always know which characteristics to add to the CRITERIA table. I feel like it must be possible to get a profitability segment assigned without putting any information in the CRITERIA table; however, I may be wrong.
Question: Is it possible to have BAPI_ACC_DOCUMENT_POST behave similar to how FB01 auto-assigns values to characteristics in the assignment to profitability screen? If not, does anyone have advice on how to determine what the characteristics need to be each time I use a GL where profitability segment is active?
Thank you!
Respectfully,
Brian