Application Development 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: 

BAPI_DOCUMENT_CREATE2 not working whne called from Module-pool program

0 Kudos

Hi,

I have created a custom FM to create documnet number. This FM uses BAPI_DOCUMNET_CREATE2 to create document numbers.

When i execute the custom FM, it is creating document number and document as well.

Bt when i call the custom FM in a module pool, document number is getting generated, but document is not getting created. No instance of the document no is found in CV04N transaction or DRAW tavble.

Regards,

Anita

1 ACCEPTED SOLUTION

0 Kudos

I got the solution.

The custom FM using the BAPI will not work properly when called form Module pool. It seems two different processors are called.

Instead I call the custom FM from a program and I called the program from the module pool.

its working fine now.

thanks all for the suggestions

3 REPLIES 3

SimoneMilesi
Active Contributor
0 Kudos

Anita, your question is a bit... foggy.

Did You check the return table if there is any message? Did you put the BAPI_TRANSACTION_COMMIT after BAPI_DOCUMNET_CREATE2 ?

These are the basic questions, then without knowing what your FM does, it's extremely hard trying to help you.

suresh_kutam
Participant
0 Kudos

Hello Anita,

Firstly, looks  this BAPI 'BAPI_DOCUMENT_CREATE2' is not released.

We are not suppose to use these BAPIs which are not released, please check for other BAPIs or other FM .

if you can provide more details, we can check exact FM/BAPI.

Good Luck..

0 Kudos

I got the solution.

The custom FM using the BAPI will not work properly when called form Module pool. It seems two different processors are called.

Instead I call the custom FM from a program and I called the program from the module pool.

its working fine now.

thanks all for the suggestions