2023 Dec 05 8:30 AM
Hi there,
I would like to ask if is possible to read the content of a PDF with OCR directly on SAP.
The PDF file is attached to mail in inbound folder (SOIN).
In this PDF is written the purchase number and the position and I must catch these data to create Goods Movement.
Could you help me?
I appreciate if you write code.
Thank you in advance
2023 Dec 05 9:47 AM
2023 Dec 05 10:24 AM
Hi Matthew,
the PDF comes from an External partner who sends it via mail as attach.
Inside the PDF there are all information I need, such as Purchase Document Number, Position, Date of Creation and so on.
With these information I have to create Goods Receipt and Goods Movement.
Since my final customer don't want to activate IDoc Process I thought to read data from PDF using OCR but I don't know if it is possible.
2023 Dec 05 10:30 AM
Right next to the "Your Answer" editor, it says:
You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details.
2023 Dec 05 10:31 AM
If any answer is no, do you really want to develop such a tool and compete with certain SAP or SAP partner products?
Else look at sample such as Reading PDF attachment from sap inbox through ABAP
2023 Dec 05 10:37 AM
Hi Matthew,
the PDF comes from an External partner who sends it via mail as attach.
Inside the PDF there are all information I need, such as Purchase Document Number, Position, Date of Creation and so on.
With these information I have to create Goods Receipt and Goods Movement.
Since my final customer don't want to activate IDoc Process I thought to read data from PDF using OCR but I don't know if it is possible.
It's possible, but pdf is a really bad way to send electronic data. Frankly, I'd just tell them to send the information in a text file. Or if they insist on PDF, then use PDF/A-Format, which can have XML attachments.
First, you need a third party PDF/OCR reader.
Then you send the PDF to that reader, and get back the information you need. You could do this by installing such a program on the application server and using system commands, but I'd install it on a separate server and set up a web service.
Alternatively, find someone who offers PDF to text as a cloud service, and use that.
2023 Dec 05 12:02 PM
Hello Matthew, thanks for your reply.
If i ask to exernal partner to provide me the pdf in PDF/A- Format how then can I read information inside it?
Is there a transformation in Sap that convert PDF into XML and then Into Internal Table?
If yes, could you post the code to do this?
2023 Dec 06 8:35 AM
It requires more than just pdf/a - they have to explicitly put the information into the xml attachment.
But really - if they don't want to do IDOCs, why don't they just send the information as a text document, rather than PDF?
I've only done it the other way - created pdf/a invoices with an xml attachment in the ZUGFeRD format mandated by the German government. I've no idea how to process XML attachments within SAP - except by using some third part tool, and proceeding as the last two paragraphs of my answer.
2023 Dec 05 11:59 AM
Hello Giuseppi, I tried to use the code but i Have a short dump when i try to connect to ADS
2023 Dec 05 12:26 PM
You didn't answer Raymond questions, which were very important.
SAP do propose conversion tools but not as part of SAP ERP.
2023 Dec 05 12:27 PM
(I mean "SAP do propose conversion tools" except the very few ones i.e. ABAP List, SAPScript Forms and Smart Forms into PDF, but not the opposite way)
2023 Dec 05 12:48 PM
Ah thanks. So the only way is to ask a text file with all information.
Thank you
2023 Dec 05 2:04 PM
Without tool, better ask provider for text or xml file.
Some tools