Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Creating profitability segment from BAPI_ACC_DOCUMENT_POST

0 Likes
10,435

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

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
5,431

AFAIK you must populate the Criteria table with the PA Segments you or functionals want.

You already identified the Plant, Product, and Profit Center fields.  If you don't want to hardcode this, quite commendable, you have to analyze your Customizing tables.

Regards,

Raymond

2 REPLIES 2
Read only

RaymondGiuseppi
Active Contributor
0 Likes
5,432

AFAIK you must populate the Criteria table with the PA Segments you or functionals want.

You already identified the Plant, Product, and Profit Center fields.  If you don't want to hardcode this, quite commendable, you have to analyze your Customizing tables.

Regards,

Raymond

Read only

0 Likes
5,431

Raymond,

Thank you for the reply. This is the same conclusion I have come to.

Brian