‎2008 Aug 21 4:02 PM
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
‎2008 Aug 21 4:06 PM
You're posting a document and then immediately reversing it?? Why?
Rob
‎2008 Aug 21 4:17 PM
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)
‎2008 Aug 21 4:10 PM
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
‎2008 Aug 26 12:55 PM