08-14-2017 10:55 AM
Hi Experts,
We have a custom program to create the spool form invoice SAPSCRIPT and convert the spool to pdf and send as email.While sending the emails sometimes program is picking the previous spool and converting to PDF and sending to customer.We got complaints from users like wrong invoices sent to customer.We have included the commit work and wait statement still we are getting the same problem.Kindly anyone advise how solve this issue.
Thanks & Regards,
Anu
08-14-2017 11:51 AM
Hi,
You already know the problem, namely that in some cases it is picking the previous spool number. So try to replicate it on a QA environment and debug to see how this is caused. Alternatively enforce a wait statement after the creation of the spool.
Kind regards, Rob Dielemans
08-15-2017 2:45 AM
Hi Rob,
Thank you for your reply.We cannot replicate the problem because it is not occuring all the times.
08-14-2017 1:40 PM
So, you have a wrong logic to determine the number of the generated spool. The next thing is to tell us how the whole thing works. If you don't know then you must first investigate by yourself how it works, then tell us.
08-14-2017 3:22 PM
The question for me is: why do you create a spool request in the first place? You could tell SAPscript API to return OTF data and convert OTF to PDF using CONVERT_OTF module.
If you have to create spool request - the SAPscript API returns you the spool id of the created request. There should not be a possibility for error if that spool ID is taken and converted to PDF and then sent via email...
Pls clarify
Regards,
Alex
08-15-2017 3:12 AM
Hi Alexander,
Thank you for your reply. I am submitting the print program of SAPSCRIPT from another program and using the exported OTF data to convert to PDF. So,if I use OTF from SAPSCRIPT, Can I rectify the above problem?
08-16-2017 2:44 PM
How do you retrieve the OTF data from the submitted program - normally OTF data is returned as an internal table by CLOSE_FORM function. It would be available in the program that called the SAPscript API. How will your "master" program get access to it?
I believe you need to explain the entire structure of your approach...
08-16-2017 3:12 PM
Hello Anu,
you should search for 'rqident' in you custom program (and includes) because your symptoms are that it requests last entry in the spools table. That can explain why, when several requests are done at the same times, the last entry is not corresponding to your run.
If there is request to table rqident then you have to replace it by Alexander's suggestion.
Best regards
Bertrand