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

BDC program

Former Member
0 Likes
845

Hi All,

I am using BAPI_ACC_DOCUMENT_POST in my report prgm to post open purchase orders.

Whenever this bapi successfully posts an PO, i need to capture the document num created by the BAPI and pass this num to FB08 transaction.

My doubt is

1) hw to capture document num created by the BAPI ?

2) hw to pass this document num to FB08 transaction?

I came to knw that this can be done using BDC. if its true can u plz provide me a sample code for the same. Else just tell me the steps that needs to be followed in order to achieve the above mentioned functionality.

Regards

Balu

4 REPLIES 4
Read only

Former Member
0 Likes
719

You're posting a document and then immediately reversing it?? Why?

Rob

Read only

0 Likes
719

thats what i am asked to do. Frankly speaking i dont knw what is meant by document posting and all those things.

I am asked to do as below after BAPI being called successfully.

1. Provision Reversal

Call transaction FB08 and perform the posting (on the first day of the next period), as per the following mapping

a ) Pass document number, Company Code,Fiscal Year

b.) Posting date = P_Period + 1 day

c.) Reversal reason (Hardcode = u201C01u201D)

d.) Save the entry.

2. Out put of the report

When the document is created, update the following table. Prepare a report from the Z table and display to the user in ALV format.

Z table layout

1)Company Code EKKOu2013BUKRS

2)Fiscal Year (From selection parameter GJAHR)

3) Period (From selection parameter)

4)Purchase Order (EKPOu2013EBELN)

5)PO Line Item (EKPOu2013EBELP)

5)Document Number(BELNR)

6)Reversal Document Number(BELNR)

Read only

Former Member
0 Likes
719

The bapi returns the document number in the messages table.

I would avoid the bdc, the FM FI_DOCUMENT_REVERSE does the reversal of the document also

Read only

Former Member
0 Likes
719

thnks