0% found this document useful (0 votes)
680 views

Custom Adapter Module in SAP PI - SAP Blogs

The document discusses creating a custom Java adapter module in SAP PI to extract multiple attachments from an email and store them in a directory. It provides the code for a Java adapter module that gets the target directory path from a module input and saves each attachment found in the message to that path with its original file name. The steps to create such a Java adapter module in SAP Netweaver Developer Studio are also outlined.

Uploaded by

mohananudeep
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
680 views

Custom Adapter Module in SAP PI - SAP Blogs

The document discusses creating a custom Java adapter module in SAP PI to extract multiple attachments from an email and store them in a directory. It provides the code for a Java adapter module that gets the target directory path from a module input and saves each attachment found in the message to that path with its original file name. The steps to create such a Java adapter module in SAP Netweaver Developer Studio are also outlined.

Uploaded by

mohananudeep
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

12/23/2020 Custom Adapter Module in SAP PI | SAP Blogs

Follow RSS feed Like


Community

Ask a Question Write a Blog Post Login

Personal Insights

Dilip Kumar Krishnadev Pandey


October 30, 2017 9 minute read

Custom Adapter Module in SAP PI


0 Likes 13,243 Views 6 Comments

Overview

In a business scenario, a group of users send attachments to one mail-id. They can send multiple attachments
per mail. So, here, we need to nd out a way to extract all attachments with their original names from a mail and
store it in some folder.

Using Sender-Mail adapter, we read mails with attachments.

For storing attachments to speci c sap application directory, we use Receiver-File Adapter along with a custom
java adapter module.

Note: Receiver-File-Adapter can store only 1st attachment, so, we create a custom adapter module for this
channel which will store multiple attachments to folder.

Sender/Receiver Communication channels can be referred from below link:

SAP PI mail attachment to le

Pre-requisites:

Pre-requisites to create a custom java adapter module form SAP PI 7.11 is as below:

SAP NetWeaver Developer Studio 7.1

https://blogs.sap.com/2017/10/30/sap-pi-module-to-extract-multiple-attachments-to-directory/?utm_source=dlvr.it&utm_medium=facebook 1/30
12/23/2020 Custom Adapter Module in SAP PI | SAP Blogs

Follow RSS feed Like

Java Runtime Environment 1.6 (Jre 1.6)


SAP library (or jar) les for required for module development
sap.aii.af.lib.mod.jar                  : <bin>/ext/com.sap.aii.af.lib/lib
com~tc~logging~java~impl.jar  : <bin>/system
sap.aii.af.svc_api.jar                 : <bin>/services/com.sap.aii.af.svc/lib
sap.aii.af.cpa.svc_api.jar          : <bin>/services/com.sap.aii.af.cpa.svc/lib
sap.aii.af.ms.ifc_api.ja r            : <bin>/interfaces/com.sap.aii.af.ms.ifc/lib

Include above jar les in the library classpath of SAP Netweaver Developer Studio 7.1 via below steps:
Navigate to Windows → Preference → expand “Java” → select “Build Path” → select “Classpath
Variables” → Click “New” to create a “New Variable Entry” → input “Name” as “PI_AF_LIBS” → select
“Path” (above jar location)

NwceTool
This will help to convert EAR les to SDA les
It uses JRE 1.6

 
https://blogs.sap.com/2017/10/30/sap-pi-module-to-extract-multiple-attachments-to-directory/?utm_source=dlvr.it&utm_medium=facebook 2/30
12/23/2020 Custom Adapter Module in SAP PI | SAP Blogs

Java Adapter Module Code:


Follow RSS feed Like

Below java adapter module code is been written to get SAP-Directory path with external module input
variable ‘SapDirPath’ and save the atatchments with original leName into the path:

/**
*
*/
package com.sap.adaptermodule;

import java.rmi.RemoteException;
import javax.ejb.EJBException;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import javax.ejb.TimedObject;
import javax.ejb.Timer;

import com.sap.aii.af.lib.mp.module.ModuleContext;
import com.sap.aii.af.lib.mp.module.ModuleData;
import com.sap.aii.af.lib.mp.module.ModuleException;
import com.sap.aii.af.service.auditlog.Audit;
import com.sap.engine.interfaces.messaging.api.Message;
import com.sap.engine.interfaces.messaging.api.MessageKey;
import com.sap.engine.interfaces.messaging.api.Payload;
import com.sap.engine.interfaces.messaging.api.auditlog.AuditLogStatus;

import java.io.File;
import java.io.FileOutputStream;
import java.util.Iterator;

/**
* @author User
*
*/
public class MAttachToDirBean implements SessionBean, TimedObject {

/* (non-Javadoc)
* @see javax.ejb.SessionBean#ejbActivate()
*/
public void ejbActivate() throws EJBException, RemoteException {
// TODO Auto-generated method stub

/* (non-Javadoc)
* @see javax.ejb.SessionBean#ejbPassivate()

https://blogs.sap.com/2017/10/30/sap-pi-module-to-extract-multiple-attachments-to-directory/?utm_source=dlvr.it&utm_medium=facebook 3/30
12/23/2020 Custom Adapter Module in SAP PI | SAP Blogs

*/
Follow RSS feed Like
public void ejbPassivate() throws EJBException, RemoteException {
// TODO Auto-generated method stub

/* (non-Javadoc)
* @see javax.ejb.SessionBean#ejbRemove()
*/
public void ejbRemove() throws EJBException, RemoteException {
// TODO Auto-generated method stub

/* (non-Javadoc)
* @see javax.ejb.SessionBean#setSessionContext(javax.ejb.SessionContext)
*/
public void setSessionContext(SessionContext arg0) throws EJBException,
RemoteException {
// TODO Auto-generated method stub

/* (non-Javadoc)
* @see javax.ejb.TimedObject#ejbTimeout(javax.ejb.Timer)
*/
public void ejbTimeout(Timer arg0) {
// TODO Auto-generated method stub

public void ejbCreate() throws javax.ejb.CreateException {

private SessionContext myContext;


MessageKey amk = null;
public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData) throws Modul
{
Object obj = null;
Message msg = null;
String SapDirPath = null;

try
{
obj = inputModuleData.getPrincipalData();

https://blogs.sap.com/2017/10/30/sap-pi-module-to-extract-multiple-attachments-to-directory/?utm_source=dlvr.it&utm_medium=facebook 4/30
12/23/2020 Custom Adapter Module in SAP PI | SAP Blogs

msg = (Message) obj;


Follow RSS feed Like
amk = new MessageKey(msg.getMessageId(),msg.getMessageDirection());

Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "JAM-MAttachToDir| Custom-Java-Adap

//Get user-input as a "module.key" parameters from communication channels


//Input-1: 'SapDirPath' to get folder path where attachments will be stored
SapDirPath = (String) moduleContext.getContextData("SapDirPath");
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "JAM-MAttachToDir| Directory Path i

//Get the input attachment from the source message)


Iterator itr = msg.getAttachmentIterator();
while(itr.hasNext()){
//handle attachment
Payload payload = (Payload) itr.next();

//get attachment name


String atchnm = payload.getContentType(); //this gives output like "application/o
atchnm = atchnm.replaceAll("\"", ""); //replace all quoteString (i.e. ") with
int i1 = atchnm.lastIndexOf("=") + 1;
String atchmntNm = atchnm.substring(i1,atchnm.length());
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "JAM-MAttachToDir| Attachment f

//Write file to directory


byte [] inpbyt = payload.getContent();
File path = new File(SapDirPath + "/" + atchmntNm);
FileOutputStream fos = new FileOutputStream(path);
fos.write(inpbyt);
fos.flush();
fos.close();

Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "JAM-MAttachToDir| " + atchmntN


}
}catch (Exception e) {
ModuleException me = new ModuleException(e);
throw me;
}
return inputModuleData;
}
}

Steps to Create Java Adapter Module:

https://blogs.sap.com/2017/10/30/sap-pi-module-to-extract-multiple-attachments-to-directory/?utm_source=dlvr.it&utm_medium=facebook 5/30
12/23/2020 Custom Adapter Module in SAP PI | SAP Blogs

1. Create an EJB project in “SAP NetWeaver Developer Studio 7.1”


Follow RSS feed Like

2. Assign project names to the EJB and EAR projects

EJB Project Name: MAttachToDir_EJB.


EAR Project Name: MAttachToDir_EAR (check the option to add EAR project).
Click “Next”.

https://blogs.sap.com/2017/10/30/sap-pi-module-to-extract-multiple-attachments-to-directory/?utm_source=dlvr.it&utm_medium=facebook 6/30
12/23/2020 Custom Adapter Module in SAP PI | SAP Blogs

Follow RSS feed Like

3. Choose the correct EJB version.

Con gure Module Project as → SAP EJB J2EE 1.4 Project.


Choose the EJB Module → 2.1.
Click “Next”.

https://blogs.sap.com/2017/10/30/sap-pi-module-to-extract-multiple-attachments-to-directory/?utm_source=dlvr.it&utm_medium=facebook 7/30
12/23/2020 Custom Adapter Module in SAP PI | SAP Blogs

Follow RSS feed Like

Uncheck the ag to create the EJB client jar interfaces.

https://blogs.sap.com/2017/10/30/sap-pi-module-to-extract-multiple-attachments-to-directory/?utm_source=dlvr.it&utm_medium=facebook 8/30
12/23/2020 Custom Adapter Module in SAP PI | SAP Blogs

Follow RSS feed Like

Click “Finish”
Please note, 2 projects will be created, an EJB project (MAttachToDir_EJB) and an EAR project
(MAttachToDir_EAR).

4. Create an Enterprise Bean in the EJB project

Right-click on the “MAttachToDir_EJB”.


Select: New → EnterpriseBean.

https://blogs.sap.com/2017/10/30/sap-pi-module-to-extract-multiple-attachments-to-directory/?utm_source=dlvr.it&utm_medium=facebook 9/30
12/23/2020 Custom Adapter Module in SAP PI | SAP Blogs

Follow RSS feed Like

5. Create the package and class for the EJB project

EJB Name                           : MAttachToDir


Bean Type                          : Select the dropdown “Stateless Session Bean”.
Give a default EJBPackage: com.sap.adaptermodule.
Uncheck option                   : generate default interfaces.
Check option                      : add optional interfaces.
Click “Next”.

https://blogs.sap.com/2017/10/30/sap-pi-module-to-extract-multiple-attachments-to-directory/?utm_source=dlvr.it&utm_medium=facebook 10/30
12/23/2020 Custom Adapter Module in SAP PI | SAP Blogs

Follow RSS feed Like

6. Assign user-module interfaces: Use the following values to assign to the parameters in the screen below:

Remote interface              : com.sap.aii.af.lib.mp.module.ModuleRemote


Home interface                 : com.sap.aii.af.lib.mp.module.ModuleHome
Local interface                  : com.sap.aii.af.lib.mp.module.ModuleLocal
LocalHome interface         : com.sap.aii.af.lib.mp.module.ModuleLocalHome
Uncheck option                 : Service End point
Click ‘Finish’

https://blogs.sap.com/2017/10/30/sap-pi-module-to-extract-multiple-attachments-to-directory/?utm_source=dlvr.it&utm_medium=facebook 11/30
12/23/2020 Custom Adapter Module in SAP PI | SAP Blogs

Follow RSS feed Like

7. Examine and verify the content of ejb-jar.xml

On the left panel, navigate: EJB project → ejbModule → META-INF.


Double click on the “ejb-jar.xml”.

https://blogs.sap.com/2017/10/30/sap-pi-module-to-extract-multiple-attachments-to-directory/?utm_source=dlvr.it&utm_medium=facebook 12/30
12/23/2020 Custom Adapter Module in SAP PI | SAP Blogs

Follow RSS feed Like

When the “ejb-jar.xml” is displayed on the right panel, select the “Enterprise Beans” tab at the bottom.
Expand “Session Beans” and select “MAttachToDir”.
All the local and remote interfaces should be displayed.

The “Service endpoint” should be empty. If not, then go to “Source” and edit the tag “<service-
endpoint>”with blank value

https://blogs.sap.com/2017/10/30/sap-pi-module-to-extract-multiple-attachments-to-directory/?utm_source=dlvr.it&utm_medium=facebook 13/30
12/23/2020 Custom Adapter Module in SAP PI | SAP Blogs

Follow RSS feed Like

8. Enter the JNDI name in the ejb-j2ee-engine.xml

On the left panel, double click on the “ejb-j2ee-engine.xml”.

“Ejb-j2ee-engine.xml” will be displayed on the right panel.


Expand “Session beans” and click on “MAttachToDir”.
Enter the JNDI Name: MAttachToDir.
Save the le.

https://blogs.sap.com/2017/10/30/sap-pi-module-to-extract-multiple-attachments-to-directory/?utm_source=dlvr.it&utm_medium=facebook 14/30
12/23/2020 Custom Adapter Module in SAP PI | SAP Blogs

Follow RSS feed Like

9. Include external libraries in the EJB project so the java class can be compiled

Right click on the EJB project.


Navigate to “Build Path”.
Select “Con gure Build Path”.

https://blogs.sap.com/2017/10/30/sap-pi-module-to-extract-multiple-attachments-to-directory/?utm_source=dlvr.it&utm_medium=facebook 15/30
12/23/2020 Custom Adapter Module in SAP PI | SAP Blogs

Follow RSS feed Like

In the Properties dialogue box, click the “Add Variable”.

https://blogs.sap.com/2017/10/30/sap-pi-module-to-extract-multiple-attachments-to-directory/?utm_source=dlvr.it&utm_medium=facebook 16/30
12/23/2020 Custom Adapter Module in SAP PI | SAP Blogs

Follow RSS feed Like

Select the variable, “PI_AF_LIBS”, created earlier

https://blogs.sap.com/2017/10/30/sap-pi-module-to-extract-multiple-attachments-to-directory/?utm_source=dlvr.it&utm_medium=facebook 17/30
12/23/2020 Custom Adapter Module in SAP PI | SAP Blogs

Follow RSS feed Like

Click on “Extend”.

https://blogs.sap.com/2017/10/30/sap-pi-module-to-extract-multiple-attachments-to-directory/?utm_source=dlvr.it&utm_medium=facebook 18/30
12/23/2020 Custom Adapter Module in SAP PI | SAP Blogs

Follow RSS feed Like

10. Enter the code for “MAttachToDirBean”

Copy and paste code from above to below project le

https://blogs.sap.com/2017/10/30/sap-pi-module-to-extract-multiple-attachments-to-directory/?utm_source=dlvr.it&utm_medium=facebook 19/30
12/23/2020 Custom Adapter Module in SAP PI | SAP Blogs

Follow RSS feed Like

11. Delete the package containing the Local and Remote interfaces from the build

Expand the “build” folder in the EJB project.

https://blogs.sap.com/2017/10/30/sap-pi-module-to-extract-multiple-attachments-to-directory/?utm_source=dlvr.it&utm_medium=facebook 20/30
12/23/2020 Custom Adapter Module in SAP PI | SAP Blogs

Delete all the folders created under build → classes → com → sap -> aii
Follow RSS feed Like
Do not delete ” build → classes → com → sap -> adaptermodule”

12. Con gure the EAR project: The EAR le contains the following:

JAR le created from the EJB project.


It has con guration information of the libraries, services and interfaces that will be used by the user-
module in the EJB.
It contains the SAP manifest le, which has unique identi ers for each speci c EAR. The manifest
information is generated uniquely each time it is modi ed.
Steps to Configure EAR:
Expand the EAR project.
Double-click on the “application-j2ee-engine.xml” le.
In the right panel, click on the “Reference” and then on the “+” sign to “Add Elements”.

https://blogs.sap.com/2017/10/30/sap-pi-module-to-extract-multiple-attachments-to-directory/?utm_source=dlvr.it&utm_medium=facebook 21/30
12/23/2020 Custom Adapter Module in SAP PI | SAP Blogs

Follow RSS feed Like

Click “Create New” in the dialog.

Add below elements as given in table

Reference target Reference Reference target Provider


type type name

engine.security.facade hard service sap.com

engine.j2ee14.facade hard library sap.com

com.sap.aii.af.svc.facade hard service sap.com

com.sap.aii.af.ifc.facade hard interface sap.com

com.sap.aii.af.lib.facade hard library sap.com

com.sap.base.technology.facade hard library sap.com

https://blogs.sap.com/2017/10/30/sap-pi-module-to-extract-multiple-attachments-to-directory/?utm_source=dlvr.it&utm_medium=facebook 22/30
12/23/2020 Custom Adapter Module in SAP PI | SAP Blogs

Follow RSS feed Like


Check the option “Failover Mode”.
Save the le.

13. Exporting SAP EAR File

Right Click on EAR project -> Export -> SAP EAR File

https://blogs.sap.com/2017/10/30/sap-pi-module-to-extract-multiple-attachments-to-directory/?utm_source=dlvr.it&utm_medium=facebook 23/30
12/23/2020 Custom Adapter Module in SAP PI | SAP Blogs

Follow RSS feed Like

https://blogs.sap.com/2017/10/30/sap-pi-module-to-extract-multiple-attachments-to-directory/?utm_source=dlvr.it&utm_medium=facebook 24/30
12/23/2020 Custom Adapter Module in SAP PI | SAP Blogs

Follow RSS feed Like

14. Custom java adapter module has been created as EAR le “MAttachToDir_EAR.ear “

Steps to Covert EAR les to SDA Files using NWCE-Tool:

From above steps, java adapter module EAR le “MAttachToDir_SDA.ear” gets created.
To use this module in SAP-PI, we need to convert it in to SDA le format with “.sda” extension.
Pr-requisites for EAR to SDA le conversion:
Java Jre1.6      Check Java Jre1.6 Directory (here C:\Program Files\Java\jre1.6.0_01)
nwcetool          Copy nwcetool folder in to C:\NWDS
Any local Windows system

Command line steps for EAR to SDA le conversion:


cmd>cd \
cd C:\NWDS\NWCE_TOOLS\tools\nwcetool
SET JAVA_HOME=C:\Program Files (x86)\Java\jre6
SET NWCETOOLLIB=C:\NWDS\NWCE_TOOLS\tools\lib
nwcetool.bat

https://blogs.sap.com/2017/10/30/sap-pi-module-to-extract-multiple-attachments-to-directory/?utm_source=dlvr.it&utm_medium=facebook 25/30
12/23/2020 Custom Adapter Module in SAP PI | SAP Blogs

Follow RSS feed Like

createsda -n MAttachToDir -v sap.com -l MAttachToDir -c 2 -type J2EE


C:\Users\User\Desktop\bLOG_jAM\MAttachToDir_EAR.ear
C:\Users\User\Desktop\bLOG_jAM\MAttachToDir_SDA
Where
createsda -n JNDI-Name -v Vendor-Name -l JNDI-Name -c 2 -type J2EE Source of \EAR_ le_path
Destination of\SDA_ le_Path

Now rename le “MAttachToDir_SDA.ear” to “MAttachToDir_SDA.sda”

https://blogs.sap.com/2017/10/30/sap-pi-module-to-extract-multiple-attachments-to-directory/?utm_source=dlvr.it&utm_medium=facebook 26/30
12/23/2020 Custom Adapter Module in SAP PI | SAP Blogs

Steps to Deploy SDA les in PI-Server:


Follow RSS feed Like

SDA File deployment using Telnet in SAP-PI:

1. Place the sda le (MAttachToDir_SDA.sda) in directory ‘/usr/sap/trans/EPS/in/’


2. Update the le ‘/usr/sap/trans/EPS/in/deploylist.txt’ with the le to be deployed
3. Use below commands
telnet localhost <port>
Username: <enter j2ee_admin user>
Passwrod: <*******>
deploy list=/usr/sap/trans/EPS/in/deploylist.txt version_rule=all

4. Post Deployment, SDA le gets extracted in below SAP-PI’s folder path, having folder name as of JNDI-
Name ‘MAttachToDir‘
/usr/sap/<systemID>/<instance>/j2ee/cluster/apps/sap.com/MAttachToDir/

5. In SAP-PI’s NWA, we can check deployed modules as below:


SAP-PI’s NWA url: http://<sap-pi-host>:<sap-pi-port>/nwa
Go to -> NWA -> Problem Management -> Java -> JNDI Browser Operation Management -> System -
> Start & Stop -> Java EE Applications

Alert Moderator

Assigned tags

SAP Process Integration | SAP Process Orchestration |

Related Blog Posts

PI REST Adapter - Blog Overview


By Ivo Kulms , Dec 18, 2014
SAP PI Mail attachment to File
By Dilip Kumar Krishnadev Pandey , Oct 10, 2017
Setting Dynamic Con guration Attributes Using Custom Adapter Module in Advanced Adapter Engine of PI/PO
By Vadim Klimov , Aug 23, 2016

https://blogs.sap.com/2017/10/30/sap-pi-module-to-extract-multiple-attachments-to-directory/?utm_source=dlvr.it&utm_medium=facebook 27/30
12/23/2020 Custom Adapter Module in SAP PI | SAP Blogs

Related Questions Follow RSS feed Like

mutiple attachments using sender mail adapter


By Former Member , Mar 12, 2015
Can we remove deployed custom adapter module
By Former Member , Apr 30, 2014

Extending Module Chain for SAP PI Adapters


By Former Member , Aug 04, 2016

6 Comments

You must be Logged on to comment or reply to a post.

Manoj K

October 30, 2017 at 3:38 pm

Nice one Dilip. Clearly explained Step by Step.

But i believe this module will work only in case NFS isn’t it? Because i can see in your module
implementation you are just building FilePath to the local server. In case you need to drop it to external server
you need to implement FTP/SFTP connection to the server in the module code itself.

Like(0)

Dilip Kumar KrishnaDev Pandey | Post author

October 31, 2017 at 5:07 am

Dear Manoj,

Good Morning …

Yes, This module is working for SAP-Ecc-directory which is mapped/accessible to SAP-PI server.

Thanks & Regards,

Dilip.

https://blogs.sap.com/2017/10/30/sap-pi-module-to-extract-multiple-attachments-to-directory/?utm_source=dlvr.it&utm_medium=facebook 28/30
12/23/2020 Custom Adapter Module in SAP PI | SAP Blogs

Like(0)
Follow RSS feed Like

Evgeniy Kolmakov

October 31, 2017 at 7:55 am

Hi Dilip!

And why not to use SFTP adapter for that at receiver’s side? As I could see from your code, you consider your PI
OS to be the Unix OS (by the way, avoid using hardcoded le path separators in any code, your module will raise
exception on Windows OS, for example. Use “File.separator” instead).

Regards, Evgeniy.

Like(0)

Dilip Kumar KrishnaDev Pandey | Post author

October 31, 2017 at 9:15 am

Dear Evgeniy Kolmakov

Thanks for suggestion on lePath check, in module code we can give a condition if directory exists then
proceed or throw module exception with message as “Directory not found”.
We can use SFTP adapter at receiver side as this adapter supports multiple attachments, here no need of
any custom module.
But in my case, I have to work with SAP-ECC-Directory which is accessible from SAP-PI using lePath
reference only, so I have to use File-Receiver Channel and module is to make it compatible to handle multiple
attachments.

Thanks & Regards,

Dilip.

Like(0)

Evgeniy Kolmakov

October 31, 2017 at 1:14 pm

Hi Dilip!

1. I just wanted to point on the way to create more exible, reusable and robust applications.

2. Since you have access to your resource using java IO, this means that it is mounted to PI’s le system. And
most of Unix/Linux systems provide access to its le system using SSH by default. So you could use SFTP
adapter to access PI le system without any additional SFTP server software required.

Regards, Evgeniy.

https://blogs.sap.com/2017/10/30/sap-pi-module-to-extract-multiple-attachments-to-directory/?utm_source=dlvr.it&utm_medium=facebook 29/30
12/23/2020 Custom Adapter Module in SAP PI | SAP Blogs

Like(0)
Follow RSS feed Like

Dilip Kumar KrishnaDev Pandey | Post author

October 31, 2017 at 2:44 pm

Dear Evgeniy Kolmakov

About 2nd point, I will try this option.

Thanks & Regards,

Dilip.

Like(0)

Find us on

Privacy Terms of Use

Legal Disclosure Copyright

Trademark Cookie Preferences

Newsletter Support

https://blogs.sap.com/2017/10/30/sap-pi-module-to-extract-multiple-attachments-to-directory/?utm_source=dlvr.it&utm_medium=facebook 30/30

You might also like