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

BAPI_ACC_DOCUMENT_POST

Former Member
0 Likes
3,239

Hello Friends,

I'm seeing an issue with BAPI_ACC_DOCUMENT_POST...

It is creating more than one document for the given data but returning only one Doument number since return parameter is not a table, it is a import parameter.

How I can find all the documents that were created when this BAPI is executed? Is this a bug in the BAPI? If so do you have any solution or do you recommand any other BAPI.

Thanks in Advance

Regards,

Satya.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,002

It only creates one document per BAPI call. Are you calling it in a LOOP?

Rob

15 REPLIES 15
Read only

Former Member
0 Likes
2,003

It only creates one document per BAPI call. Are you calling it in a LOOP?

Rob

Read only

0 Likes
2,002

Thank you for your respose.

No...I'm calling this BAPI only one time. For example when I pass 21 line items to GL table and currecny table...(which consists of two different currencies)..BAPI is creating two documnets. However in the return we can see only one document...But if go to FB03 and look for subsequent number that is also being available.

Thanks a lot for your help.

Read only

0 Likes
2,002

In some circumstances this BAPI can create more than one document, for example, when posting a cross-company document. It will post one document for the first company code and one document for the second company code. These will be linked in the database so it is possible to determine both document numbers once the BAPI has finished processing.

Read only

0 Likes
2,002

Is this how the standard transaction behaves?

Rob

Read only

0 Likes
2,002

How can I find out the linkage...Is that BKPF table? Thank you for help.

Read only

0 Likes
2,002

If field BKPF-BVORG is populated then you are performing cross-company postings. This field is used to link all docs that are posted cross-company and it is possible for there to be two or more docs. This is standard SAP functionality.

Table BVOR stores all documents that belong to the key specified in BKPF-BVORG.

Hope this helps.

Read only

0 Likes
2,002

Your reply sloves our issue...Thanks for your help. Poins assisgned as an appriciation.

Read only

0 Likes
2,002

hi satya ,

my problem , I am using BAPI_ACC_DOCUMENT_POST for posting cutomer incoming payment.The return is giving the successful message that is S RW 605 document successfully posted, but it is not updated in databse. I used BAPI_TRANSACTION_COMMIT also after BAPI_ACC_DOCUMENT_POST. If you send your code, I will try to resolve my issue.

Thanks in advance

Kumar

Read only

0 Likes
2,002

Here is the code:

CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'

EXPORTING

DOCUMENTHEADER = HEADER

IMPORTING

OBJ_TYPE = OBJ_TYPE

OBJ_KEY = OBJ_KEY

OBJ_SYS = OBJ_SYS

TABLES

ACCOUNTGL = ACCTGL

  • ACCOUNTRECEIVABLE =

ACCOUNTPAYABLE = ACCOUNTPAYABLE

CURRENCYAMOUNT = CURR

RETURN = RETURN.

READ TABLE RETURN WITH KEY TYPE = 'E'.

IF SY-SUBRC NE 0.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

ENDIF.

Assign some points if it useful.

Read only

0 Likes
2,002

Hi,

I have tried BAPI_ACC_DOCUMENT_POST for cross company scenario.but got an error inconsistent fico interface, as the document header company code will be different from for some line item company codes?how did u ue this for cross company scnario?

and how abt the line items for clearing the post.do we need to select the account and create an item and pass or BAPI does internally automatically.

Please reoly, bit urgent, having delivery

Thanks in advance.

Read only

0 Likes
2,002

For cross-company postings, we needed to set the header company code equal to the company code of the first line item. I believe there is an OSS note that discusses this.

Read only

Former Member
0 Likes
2,002

can you send your program code?

Read only

0 Likes
2,002

My issue was resloved....Do you have same isse? which code do you want me to send? BVOR access code?

Read only

0 Likes
2,002

or try the FM

call function 'FI_ACCBELNR_GET'

tables

t_belnr = it_belnr.

after BAPI_ACC_DOCUMENT_POST

but I never tried it for cross company code postings

Read only

Former Member
0 Likes
2,002

To get a list of related posted documents, this is how SAP does it, and us as well:

  • Get a list of all related documents, just like SAP does it:

call function 'AC_DOCUMENT_RECORD'

EXPORTING

i_awtyp = bkpf-awtyp

i_awref = bkpf-awkey+0(10)

i_aworg = bkpf-awkey+10(10)

i_awsys = bkpf-awsys

x_dialog = ' '

i_bukrs = bkpf-bukrs

TABLES

t_documents = gt_documents

EXCEPTIONS

NO_REFERENCE = 1

NO_DOCUMENT = 2.