cancel
Showing results for 
Search instead for 
Did you mean: 

Post documents using BAPI

Former Member
0 Kudos

Hello,

I have to post documents (FB01) one way is using batch input but I would like to know if there is a BAPI to do it.

Thank you

Miguel.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Miguel,

BAPI_ACC_DOCUMENT_POST is MYSTERIOUS.

-


1. There were quite previous posts

regarding posting a document in FI

thru a BAPI.

2. Most of them suggested

BAPI_ACC_DOCUMENT_POST

(and others , but i tried with BAPI_ACC_DOCUMENT_POST )

3. Some intermediate problems were there

regarding document number auto generation,

which fields to passs etc...

4. But what happens, finally is this :

The BAPI executes successfully!.

It even gives the message Document XXXX posted.

BUT

There is no such record in any database table (BKPF,BSEG)

5. Even if we use

BAPI_TRANSACTION_COMMIT

the problem is there.

6. More mysterious is that

the Number range interval gets INCREMENTED by one.

But there are no signs of any document

in database tables. !!!

If anybody gets the solution,

please let me/us know !!!

Regards,

Amit M.

Former Member
0 Kudos

Hi Amit,

I am facing the same issue ........... did you get to solve this problem ?

I am working on 4.7 version. The Idoc gets posted successfuly ......... but the strange thing happens >>>> NO DATA in bseg/bkpf ......... ???

Your help would be appreciated.

Thanks,

Jasjit

arjun_subhash
Active Participant
0 Kudos

Hello experts,

i am facing the same problem with both

bapi_acc_invoice_reciept_post and

bapi_acc_document_post

document XXX posted successfully but no such documents in database!!!

i used bapi_acc_gl_posting_post , its creating documents but my requirement is to post credit to a particular vendor account not to a balancesheet ledger which cant be done using bapi_acc_gl_posting_post.

what should be done,my doc_type is KR

any help please???

Former Member
0 Kudos

Hi everybody,

Can anyone send me the sample code for using the BAPI_acc_gl_posting_post for posting document through fb01.

reds

gaya

Former Member
0 Kudos

We are in 4.6c and using bapi BAPI_ACC_GL_POSTING_POST.

We use to pass values to these three params in the DOCUMENTHEADER.

obj_type

obj_key

obj_sys

But after applying an OSS note, we didn't have to. I'm so sorry that I can;t find the OSS note itself, but one thing for sure, the note allowed us not to pass anything to these fields.

I will keep searching and post it here once I found it. For the meantime, you probably want to search using the BAPI funcmod as the key in oSS.

Former Member
0 Kudos

Found it, here's the OSS note number : 561175.

REad through the note.

Once you applied that, you don't have to pass anything on those three fields.

Try it out and let us know.

Former Member
0 Kudos

Hi Miguel,

You can the use FM "NUMBER_GET_NEXT" to get the next available document number.

Regards

Anthony

nablan_umar
Active Contributor
0 Kudos

Have you look at BAPI_ACC_DOCUMENT_POST?

Former Member
0 Kudos

The 4.6c version doesn't have that function yet. However, I found "BAPI_ACC_GL_POSTING_POST" function but I don't know what to put in OBJ_KEY field. I posted a document using FB01 and the the field contains the number of the document posted (autogenerated). before runing the function I don't know that number.. what should I use? is the right funtion?

Former Member
0 Kudos

Hi Miguel,

I have the same requirement as you, but in the first case I'm not able to generate the IDOC at all. So could you please give me some tips regarding the distribution settings. So far this is what I've done.

In BD64 I have created the model view and added the message type 'ACC_GL_POSTING' as a BAPI.

Then I have generated the partner profile.

Now if I go to transaction fb01 and do the necessary and save the data, idoc is not created.

Is there anything else I have to do to generate the Idoc.

Your help is appreciated..

Thanks.

Saravana.

Former Member
0 Kudos

Hi Miguel,

Yes you are on the right track.

You have to build the document header and lines to pass to the function.

Building the header is pretty straight forward except for the obj_type and the obj_key parameters.

In your case the obj_type should be 'BKPFF'. You have to build the obj_key using document number, company code and fiscal year.

First get the document number using the function "NUMBER_GET_NEXT". Then concatenate the three variables in the above order to get the obj_key.

Regards

Anthony

Former Member
0 Kudos

one tip , to know how to use a particular FM , use where used list.

regards