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

Need to Post f-02 Using bapi:BAPI_ACC_DOCUMENT_POST

0 Likes
4,644

Hi,

I am facing one problem.
I need to post Gl account posting Using Bapi::BAPI_ACC_DOCUMENT_POST
If i post Gl account credit debit everything is fine.

But If i post or mention Vendor code with special Gl it is not working.

I am calling bapi:

CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
documentheader = documentheader
* IMPORTING
* OBJ_TYPE = OBJ_TYPE
* OBJ_KEY = OBJ_KEY
* OBJ_SYS = OBJ_SYS
TABLES
accountgl = accountgl
accountpayable = accountpay
currencyamount = currencyamount
extension1 = extension
return = return.

In the abvoe
accountgl I am passing Vendor and account type
accountgl-vendor_no = it_final-lifnr.

accountgl-acct_type = 'K'.

and accountpay Details
i am passing Special Gl account too.

While posting Front end f-02 with same data , document posting. But using bapi I am not able to post. Any thing i missed Please Suggest me.

10 REPLIES 10
Read only

RaymondGiuseppi
Active Contributor
3,697

Pass the vendor item in the accountpayable table, not to the accountgl one, fill VENDOR_NO and SP_GL_IND correctly. Which SGL ind did you try?

Read only

0 Likes
3,697

Thank you very much for your reply.
yes , I am passing vendor_no and sp_gl_ind
Can you please have a look on below images.
Any thing i am missing, Special Gl indicator . E i am passing. If i post Front end , Document posting.

Read only

0 Likes
3,697

I am getting as like below

FI/CO interface: Balance in transaction currency

Error in document: BKPFF $ VEDCLNT666

Message class: RW : 022

Read only

3,697

Did you create the amount records of currencyamount (transaction currency 00) for GL and AP records with a zero sum?

Read only

0 Likes
3,697

Yes Sir, i did.

What is the problem i did not understood. problem is coming creation with vendor it is coming. otherwise working fine.But i need with vendor code. Error message leading me at se91 Message class:RW and mess no:022
Did not understood what is the problem

Read only

0 Likes
3,697

Have you put 4 items in GL(3) and AP(1) tables, with one occurence for each item number 1-4?

Read only

0 Likes
3,697

hi, Sir,

Accoun Gl 4 lines

4th line is for vendor that is the reason not passing gl only passing vendor.

Accountpay

Only single line passing vendor.

Anything is wrong. please update me.

Read only

0 Likes
3,697

You should have only 4 lines in total in GL + AP tables, remove the GL item associated to vendor, give the AP item a number not already associated to any GL item (e.g. vendor item is 1, GL items are 2, 3 and 4, account items are 1, 2, 3 and 4)

Read only

0 Likes
3,697

Don't duplicate the same item : only in GL or AP table, use a number for AP that is not used by any GL item. (Here you try to generate a document of 5 lines)

Read only

0 Likes
3,697

hi Raymond Giuseppi

I got the answer. There is One Custom Function module is there, When i ever i create the Entry with Vendor, one field xfield is passing as x automatically. This line is deleting the function module.

Now i remove the code. Now working.I did not understood. 1 point,When ever line entry is having posting key with 39,One more line with posting key 31 is coming. In the zfunction module they are removing the 31 line entry, Then only I can add the entry using bapi. Other wise fi interface error is coming.