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

Create an additional FI document after initial MM/FI posting

Former Member
0 Likes
1,150

Hello all,

     What we are trying to do is post an MM document and then after the MM document and FI have posted, we want to post a subsequent document in FI to offset additional accounts.  We don't want the across the board effects of a T030 determination change would have.  Right now it was developed to at the MM posting save the document number, then after a minute or two read the document and make another FI posting.  We would want this at run time.. basically create 1 MM doc and 2 FI documents in the same company code.  Any help would be appreciated.

Ronnie

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
839

Hi Ronnie,

I suppose you are talking of material document posting.

You can use

BAdI : MB_DOCUMENT_BADI

Method : MB_DOCUMENT_UPDATE

Note : The UPDATE method of MB_DOCUMENT_BADI has a COMMIT WORK in it. So if COMMIT WORK is called twice then the update process terminates.

Call the BAPI as an RFC call with DESTINATION NONE and the commit also in similar fashion.

OR

Call it using IN BACKGROUND TASK

Regards

3 REPLIES 3
Read only

Former Member
0 Likes
839

I know that there is a better way than what I will propose.  Maybe by proposing it however, it will get the others to respond.

In the MM transaction, I would find the form or function where it branches to creating the FI document.  Then in at then end of it I would create an implicit enhancement.  There I would call the FB01 BAPI. 

So how does that strike you?

Neal

Read only

Former Member
0 Likes
840

Hi Ronnie,

I suppose you are talking of material document posting.

You can use

BAdI : MB_DOCUMENT_BADI

Method : MB_DOCUMENT_UPDATE

Note : The UPDATE method of MB_DOCUMENT_BADI has a COMMIT WORK in it. So if COMMIT WORK is called twice then the update process terminates.

Call the BAPI as an RFC call with DESTINATION NONE and the commit also in similar fashion.

OR

Call it using IN BACKGROUND TASK

Regards

Read only

0 Likes
839

Yes, when the material document is posted to MSEG, AFTER that and the matching FI document is posted, we need to post one additional FI document.  The problem with the other BAdI/exit solutions I have looked at is that the commit hasn't happened yet so you can't commit the new document.  I will look into this one.. thanks for the suggestion