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

PO history & BAPI_ACC_DOCUMENT_POST

Former Member
0 Likes
2,989

Hi!

At dialogue creation down payment (F-48), the system creates communications between the purchasing order and the accounting document.

I.e. in history of a position of the purchasing order there is a record with number accounting the document.

And in the accounting document down payment there is a reference to number of the purchasing order in a browser of relations (look FB03 it is cluck in the menu: Environment-> Document Environment-> relationship Browser).

I use ' BAPI_ACC_DOCUMENT_POST ' for creation down payment:

As a result I receive the normal document down payment, but links on the purchasing order it was not created, i.e. there is no record with number of the accounting document in history of a position of the purchasing order, and there is no reference to the purchasing order in a browser of relations of the accounting document.

Is it possible to create the high-grade document down payment with all references what is at dialogue work of transaction F-48? What I for this purpose should make?

Edited by: Soloviev Ivan on Apr 1, 2008 1:47 AM

Hi!

At dialogue creation down payment (F-48), the system creates communications between the purchasing order and the accounting document.

I.e. in history of a position of the purchasing order there is a record with number accounting the document.

And in the accounting document down payment there is a reference to number of the purchasing order in a browser of relations (look FB03 it is cluck in the menu: Environment-> Document Environment-> relationship Browser).

I use ' BAPI_ACC_DOCUMENT_POST ' for creation down payment:

As a result I receive the normal document down payment, but links on the purchasing order it was not created, i.e. there is no record with number of the accounting document in history of a position of the purchasing order, and there is no reference to the purchasing order in a browser of relations of the accounting document.

Is it possible to create the high-grade document down payment with all references what is at dialogue work of transaction F-48? What I for this purpose should make?

Edited by: Soloviev Ivan on Apr 1, 2008 1:47 AM

4 REPLIES 4
Read only

JohnyI
Explorer
0 Likes
1,877

Hi,

Did you find a solution to your problem ?

I'am facing the same problem and was curious to know if you solved this.

Read only

Former Member
0 Likes
1,877

Yes. I am find solution for my promlem.

In standard the BAPI does not update the MM order history.

If you need this functionality it is necessary to implement

a business transaction event (user exit) to call

the function ME_CREATE_HISTORY_FINANCE which is also called

from F-48 for online postings.

Take a look a Business Transaction Event 1050.

You need some check here to make sure the function is only called

for your BAPI postings, perhaps you can check for BKPF-TCODE

or BKPF-AWKEY if use use your own object type starting with Z... here.

Then call the function like:

CALL FUNCTION 'ME_CREATE_HISTORY_FINANCE'

EXPORTING

i_check = 'X'

i_post = 'X'

TABLES

t_bkpf = t_bkpf

t_bseg = t_bseg

EXCEPTIONS

error_message = 9.

IF sy-subrc = 9.

MESSAGE ID sy-msgid TYPE 'A' NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

It is necessary to create an A message here in case of problems

because at the point this BTE is called the document numbers are

already taken and an A message ensures a proper ROLLBACK

to avoid document number gaps.

Read only

0 Likes
1,877

Soloviev,

Thanks for your response. I had also found this function module while debugging F-48 a short while after posting the question.

I was planning to create a custom function module to call ME_CREATE_HISTORY_FINANCE after the BAPI call.

But I see that you suggested using BTE 1050. I will give that a try.

Thanks a lot !!

Johny.

Read only

0 Likes
1,877

Hi,

It is possible to explain how fill the structures of the BAPI_ACC_DOCUMENT_POST for the down payment.

THank you in advance.