A (very) brief history of Fax
Although the fax has been around for more than 150 years now sending faxes still is a very widely used technology. That is an incredibly long period of time if you compare this to the product cycles of modern hardware. But the way to send a fax also was changed in the last decades. After connecting fax devices to your ERP systems it is now common practice to use a fax server instead.
As we are entering the cloud era the next step in evolution would be to replace the fax servers by fax services offered in the cloud.
cospace - a free telecommunications service in the cloud
One of these cloud-based service offerings is cospace. The reason why I choose cospace for my blog is not by chance but related to the fact that the service is offered by our parent company QSC AG. But I am sure that the showcased technique of connecting SAP to cloud-based services via an ABAP REST API can be used for other service providers as well.
So what free services are offered by cospace?
- Send and receive a limited number of faxes (only within Germany)
- Use a Multi-Voicebox for incoming calls
- Arrange and manage dial-in conference calls
- Use 5GB of secure cloud storage hosted in Germany
All cospace functions can be controlled by a REST API using JSON as a container for the serialized data. This gives us the possibility to use these services from external systems like SAP.
ABC - the ABAP Bridge to Cospace
Because sending a fax covers only a tiny subset of all available cospace functions I uploaded my source code to Project ABC in SAP Code Exchange, hoping to find some coworkers that like to add some useful functions there.
Possible scenarios to realize would be for instance:
- Replacing current fax hardware by the cloud fax service
- Automatically link incoming faxes with business objects in SAP
- Easily setting up conference calls with customers stored in SAP
- Sharing file attachments with customers outside the corporate network
Back to cloud faxing now, how is it done?
During the development of my prototype I did not invest too much time in the design of the UI. At least you can test the cloud faxing in a live scenario if you follow the installation steps described in project ABC.
After calling the transaction you enter your cospace credentials in SAP Gui. Then you are asked to upload a PDF file and enter a recipients fax number. After that the fax is prepared in the cloud and send to its recipient.
In SAP you will see a log with some technincal information about the whole sending process:
In the cospace web gui you can see the corresponding information about the fax:
Under the Hood
Now what is happening behind the scenes?
The communication between SAP and cospace is managed by HTTP commands using interface IF_HTTP_CLIENT. Technically the following steps are executed:
- Read session id and load balancing server from cospace
- Authenticate on load balancing server with session id and user credentials
- Create a cospace Fax object
- Upload the PDF file
- Read the events from cospace until the uploaded PDF is converted
- Send the Fax object
Because all data is exchanged in JSON format the installation of the ABAP JSON Document Class (another great project of Uwe Fetzer) is a prerequisite for using ABC.