07-05-2018 5:13 PM
Hello Friends,
We have requirement, in one of our client that, we are sending customer statement to client every month through email attachment.
Now they want this pdf attachment as a password protected.
We are sending smartform in email as a attachment.
So basically we want to send smartform as a pdf protected through email.
I have searched a lot for the solution but not able to find the proper one.
Please help me to solve this.
Thanks.
07-06-2018 3:07 AM
I suppose you export the data to PDF file through smartforms then send PDF to customer. As far as I know SAP doesnt support to encrypt PDF file with password and you need 3-party (usually cost some money) to archive that. But I think there is workaround that you compress PDF file and set password to compress file and there are alot of compress tool can do that (zip, 7z...). The ideal is like below:
1. Export PDF to compress folder.
2. Use fm: SXPG_COMMAND_EXECUTE to call compress tool's command and compress abow folder from abap.
This example explain how to use SXPG_COMMAND_EXECUTE:
About command of compress tool, you can read this thread:
https://stackoverflow.com/questions/18180060/how-to-zip-a-file-using-cmd-line