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_POST_DOCUMENT - Fields not filled in FI document

Former Member
0 Likes
1,408

We are creating an FI journal using BAPI_ACC_POST_DOCUMENT. In the paramater ACCOUNTGL the field PROFIT CTR is populated for some item lines, and for others the field WBS_ELEMENT. The FI document is posted, apparently without error. When looking at the document environment we can see that the relevant documents have also been created in PCA and Controlling. However, the fields for Profit Center and WBS Element on the line item in the FI document itself remain blank. Is this normal? If not, how do we correct the problem?

8 REPLIES 8
Read only

Former Member
0 Likes
1,195

The only thing I can think of is to check to see if the G/L Account number(s) used allow for Profit Center or WBS Element to be populated.

Brent

Read only

Former Member
0 Likes
1,195

Hi,

try the following :

1)Check the return table from BAPI, it might have some messages.

2)Try posting a document with same data through transaction.See if yoy get same issue.

Read only

0 Likes
1,195

Thanks for the responses.

The field status on the accounts is correct for the objects that are being posted to. The BAPI appears to finish without error, just returns the doument number posted. If I post a transaction manually, it's fine.

Read only

0 Likes
1,195

Hi,

Try executing the bapi from SE37.

See if you get the desired result.

Read only

eduardo_hinojosa
Active Contributor
0 Likes
1,195

Hi

Are you using the FM 'BAPI_TRANSACTION_COMMIT' after the BAPI?

See SAP Note 306504 - Collective note: BAPIs for the AC interface, it says:



You get the input parameter of module BAPI_TRANSACTION_COMMIT. Execute this
without changing the parameters.
By executing this module, the required COMMIT WORK is generated, which
posts documents which you have updated.

I hope this helps you

Regards

Eduardo

Read only

Former Member
0 Likes
1,195

Thanks again for all the posts. SE37 does appear to give the desired result, but it still does not work when we actually post in the program. We are using the commit FM.

Read only

0 Likes
1,195

Hi,

Then you need to check the parameters being passed to the BAPI ,within the program.

Someting is missing out there.

Read only

0 Likes
1,195

Hi,

Please check if the fields needs to be prefixed with Zeros or conversion routine to be applied before passing the structure to the BAPI.

Through SE37, it takes all these into consideration automactically. But through program, it has to be handled by code.

Regards,

Yogesh