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

FI Substitution not triggered when posting through BAPI_ACC_DOCUMENT_POST

Former Member
0 Likes
6,548

Hi,

We are using a substitution to populate the profit centre for the AP line item from profit centre of the G/L line item while posting the FI documents. This substitution is defined at the "Complete document" node in the transaction GGB1. The pre-requisites for this substitution are document type and the company code. This substitution is working when the FI document is posted manually using the t.code fb60 or f-02 and also when posting through BDCs on these transactions.

One of my program was using a BDC of FB60 and was calling this substitution. Now i changed the BDC to BAPI_ACC_DOCUMENT_POST and the substitution is not triggered and the profit centre is not copied from the G/L line items. The same document while posting through the transaction FB60 is getting the profit centre from the G/L line item through the substitution. The pre-requisites are satisfied when calling through the BAPI also but still the substitution is not called.

Is there any restriction on the substitution for BAPIs?

Thanks in advance.

Regards,

Immanuel.

1 ACCEPTED SOLUTION
Read only

alex_cook
Active Participant
3,601

Howdy,

The BAPI doesn't call the substitutions - you can call the substitutions manually, eg function module FI_SUBSTITUTION_HEADER.

Cheers

Alex

Howdy,

The BAPI doesn't call the substitutions - you can call the substitutions manually, eg function module FI_SUBSTITUTION_HEADER.

Cheers

Alex

5 REPLIES 5
Read only

alex_cook
Active Participant
3,602

Howdy,

The BAPI doesn't call the substitutions - you can call the substitutions manually, eg function module FI_SUBSTITUTION_HEADER.

Cheers

Alex

Read only

Former Member
0 Likes
3,601

Hi Alex,

Thanks for your reply.

There are other substitutions which are defined at the "Line item" level in GGB1 and these substitutions are triggered when the document is posted using BAPI_ACC_DOCUMENT_POST. The control stops at the breakpoint in the substitution when the document is posted via BAPI.

Is it because my substitution is defined at the "Complete document" level that it is not called?

Regards,

Immanuel.

Read only

0 Likes
3,601

Found alternate solution.

Thanks.

Immanuel.

Read only

0 Likes
3,601

Hi

Do you mind sharing the solution you found? I am having a similar problem.

Thanks

Floyd

Read only

0 Likes
3,601

Hi Floyd,

My requirement helped me. In my substitution there were a lot of logic to derive the profit centre based on different scenarios. From these logics i separated the logic required to derive the profit centre for my requirement and implemented that logic in my program itself. Then I passed this profit centre through the EXTENSION1 table and filled it in the BTE for the BAPI.

I am not sure if this will work for you.

Regards,

Immanuel.