Send purchase order data via e-mail

Published on

in

Reading time:

1–2 minutes

For the electronic exchange of purchase order data, SAP Business Network (formerly Ariba Network) immediately comes to mind. However, this requires both parties involved in the ordering process, the customer (buyer) and the supplier, to be registered on the platform, which is certainly not the case for every company.

Consequently, alternative solutions are needed to transmit order data electronically. Many companies have long-established email inboxes to which orders can be sent, for example, as PDF files. These inboxes are monitored by specialized software that extracts information from the PDF files and uses it to create a sales order within the supplier’s ERP system.

Instead of using a PDF file, for which countless solutions exist within the SAP ERP ecosystem, it’s also possible to send purchase order data in a format that is easier for machines to process.

In principle, this can be achieved as follows (this also applies to older SAP ERP releases):

  1. Generate an ORDERS IDoc for the specific supplier using message control.
  2. Process the ORDERS IDoc via a custom-developed function module, integrated as a PSS port (refer to the ABAP Programming Interface (PI); the function module OWN_FUNCTION can serve as a template).
  3. Within the function module, generate an IDoc-XML from the ORDERS IDoc using the GET_XMLDATA_AS_STRING method of the IDOC_XML_SERVICE class.
  4. Modify the IDoc-XML if necessary.
  5. Generate an email using the CL_BCS class and attach the IDoc-XML.
  6. Generate a PDF version of the order, if required, and attach it to the email as well.
  7. Send the email.

This solution is simple, fast, and therefore cost-effective to implement. Since the transmission is based in the source system on IDocs, you can also leverage the full range of practical IDoc transactions for monitoring and administration.