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