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_DOCUMENT_CREATE2 not working whne called from Module-pool program

Former Member
0 Likes
912

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
Read only

Former Member
0 Likes
765

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
Read only

SimoneMilesi
Active Contributor
0 Likes
765

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.

Read only

suresh_kutam
Participant
0 Likes
765

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..

Read only

Former Member
0 Likes
766

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