Skip to Content

Wrong PDF attachment sent to the customer

Aug 14, 2017 at 09:55 AM


avatar image
Former Member

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,


10 |10000 characters needed characters left characters exceeded

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.

Further commenting has been locked.
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Alexander Bolloni
Aug 14, 2017 at 02: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



Show 3 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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?


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


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


Rob Dielemans Aug 14, 2017 at 10:51 AM


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

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Rob,

Thank you for your reply.We cannot replicate the problem because it is not occuring all the times.