Other recent blogs
Let's talk
Reach out, we'd love to hear from you!
In the SAP ecosystem, Process Integration (PI) and Process Orchestration (PO) are two vital game-changers of SAP's middleware technology, which enables intelligent SAP-centric enterprises to integrate their disparate systems and applications seamlessly within an organization. SAP PI/PO supports integration with a wide variety of systems, including SAP ERP, CRM, and SCM systems, as well as third-party systems.
One critical aspect of data transmission within the SAP PI/PO scenario is ensuring security and compatibility, especially when dealing with sensitive datasets. This is where Pretty Good Privacy (PGP) encryption with File Content Conversion (FCC) plays a crucial role.
Here's a breakdown:
PGP can be explained as a public-key encryption system known for its security and reliability. It comes with a pair of public/private keys required to encrypt and decrypt datasets. Companies leverage the public key to encrypt the data and the private key for data decryption.
FCC enables businesses to convert files from one format to another in a variety of formats, including XML, CSV, and JSON. FCC is an easy, secure, and fast way to exchange data formats compliant to different systems.
Here are some benefits of performing FCC with PGP in SAP PI/PO
Now, let's delve into the essence of how to perform File Content Conversion with PGP in SAP PI/PO and understand how companies using this strategic move to enhance their data security, and data integrity, while thriving in an increasingly interconnected world.
File Content Conversion in SAP PI/PO: The quick steps to follow
SAP PI/PO provides out-of-the-box functionality to handle file content conversion from Flat file to XML and vice versa in File Adapter. This function can only be used if the file isn’t encrypted. For handling File content conversion along with PGP, we need adapter modules and an advanced user detail function. This blog outlines the steps to achieve this.
PGP Decryption and Flat File to XML Conversion in the Sender Channel
In the sender communication channel, we need to specify two additional adapter modules.
- Localejbs/PGPDecryption: This module is used to decrypt the PGP message. It should be the first to be used so that the file is decrypted before content conversion.
- AF_Modules/MessageTransformBean: This module is used to convert Flat file to XML message with the first line in a single segment. It should be used next so that the file is converted from Flat to the XML structure.
- CallSAPAdapter: This is the default module of the channel and must be the last module to be used.
Once the modules have been specified, create the Sender Data Type as specified in the pattern below. All the elements of the line will be stored in ‘Record,’ and multiple occurring nodes will be enabled in ‘RecordSet.’
For our requirements, we need only three fields from each line of CSV so that our receiver structure looks like below. You can change it to suit your objectives.
Moving ahead, create a Message Mapping, and define an Advanced User Defined Function (UDF).
The UDF takes the whole line as a string and splits it at each page. You can update the delimiter to whatever is used in the file.
Output 1: This delivers the second string after the split.
Output 2: This delivers the fifth string after the split.
You can change the number and position of outputs according to your needs.
Configure the mapping in the manner illustrated below.
Test this message mapping.
Create an Integrated Configuration for this scenario and activate your objects. This should decrypt the encrypted PGP message and split the elements successfully.
Handle PGP Encryption and XML to CSV Conversion in the Recruiter Channel
Create ESR and Integration Directory objects as usual, but in the Receiver File Channel instead of using File Content Conversion, use Adapter Modules in the sequence mentioned below.
- Localejbs/AF_Modules/StrictXml2PlainBean: This module is used to convert XML to CSV.
- Localejbs/PGPEncryption: This module is used to encrypt the outgoing message.
Following the above-mentioned steps, you can successfully handle File content conversion along with PGP Encryption/Decryption. These steps will work with any adapter that supports enhancement through adapter modules. Please note that while using the default File content conversion provided by PI/PO, File adapter will not work with PGP encrypted messages.