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: 

Wrong PDF attachment sent to the customer

former_member569532
Participant
0 Kudos

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

7 REPLIES 7

former_member186746
Active Contributor
0 Kudos

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

0 Kudos

Hi Rob,

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

Sandra_Rossi
Active Contributor
0 Kudos

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.

alexander_bolloni
Contributor
0 Kudos

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

0 Kudos

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?

0 Kudos

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

0 Kudos

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