SAP PI AES encryption in Message Mapping

I developed a simple UDF (User Defined Function) in Java to crypt  and decrypt some text data in my message mapping, first into section ‘Attributes and Methods‘ I setted static constants for AES and I used a method to “normalize” the string text for crypt and decrypt with the method fixedLengthString.

I don’t know why but if I didn’t this the decryption does not work, the method only get the first 16 characters and apply a String format.

This is the code: Seguir leyendo

Anuncios

SAP PI Encrypt Soap request with private certificate

I’ve been working to secure the information with a SOAP web service with SAP PO and It’s an expensive and frustraiting task for me because I don’t have enough knowldege about TLS protocol and certificates.

In this entry I want to share my experience to do it.

Overview

  1. Create a keypair certificates in Keystore (Private key and public certificate) and export them
  2. Configure the SOAP sender communication Channel
  3. Configure the Integrated Configuration Scenario (ICO)
  4. Configure web service client (SOAP-UI)

1.Create a keypair certificates in Keystore (Private key and public certificate) and export them

Go to NWA> Configuration > Security > Certificates and keys, then on Key storage tab Add View, give it a name for key storage (it’s selected by default). Now on View Entries tab select create and set a name for your key pair, leave the options by default  and check Store Certificate optionand click next. Fill out the data for your certificate, something like this:

Seguir leyendo

SAP PI Proxy to JDBC to get millions of records

Recently I’ve had to develop a scenario  with Proxy to JDBC communication to extract a lot of records (millions of records), the strategy to achieve this is get a bunches of records in packages until transfer all records from database to SAP.

I’ve developed a Service Interface with tree operations:

  • Count: to get the number of records to extract
  • Transfer: to get records in packages
  • Delete: clear the table if the prrocess completes successfully

The execution logic is simple, first, SAP counts all record in DB to know how many of them will be extract, next an ABAP program calculate the size of packages and start to extract the records in packages, and count the transfered data per package, at last, if the transferred data is equal to initial count the source table is deleted.

The interesting point is on Message mapping, let’s review them: Seguir leyendo

SAP PO Soap to Soap scenario with multiple operations (sync and async)

I don’t know but I was thinking, why in SAP make a simple web service it’s awful task?

In other technologies (Java for example) you can publish one service with multiple operations with synchronous and asynchronous communication, but do this in SAP PO it’s very tricky.

I don’t write how to develop the scenario, instead, I prefer to talk about “that dirty tricks” to achieve this.

For example, you develop a service interface with multiple operations to expose some functionality via Advanced Adapter Engine, I use soap sender adapter for the outbound system (legacy system) and soap receiver for the inbound system (SAP), I’m working on SAP PO 7.5 (in older versions too).

2018-04-05 10_21_52-Enterprise Services Builder (vhephxidci_XID_00)2018-04-05 10_22_38-Enterprise Services Builder (vhephxidci_XID_00) Seguir leyendo

SAP PI Naming Convention

When I start on PI development I feeling very confused by the naming convention of their components, a couple years ago I was thinking if it is a best naming convention but I don’t found anything about it.

Talking to other consultants of PI/PO they are agree this naming is a responsibility of the organization standards, but in some times it’s not the best.

For example, when you implement a Java proxy if you naming convention it’s not clear the java code is very awful and I don’t like that. In the organization when I work this is very common mistake, because every release of new service interface has problems with the other develoment teams to integrate your systems, only by the naming convetion is too large or dificult to read.

I’ve been developing services interfaces around of five years and recently I found (in my opinion) the best naming convention for SAP PI/PO in this website.

The document is like a cheetshet and it’s very clear to read, definitely I recommend this.

If you has problems to access I leave a copy of the document here

Cheers

SAP PO get SOAP xml payload

Frecuently I need to check xml payload on SOAP service interfaces but the PO it’s configured to not persist this messages.

In old versions of PI (like 7.10) you can use the TraceHTTP parameter in  sender or receiver adapter, in the module sap.com/com.sap.aii.af.soapadapter/XISOAPAdapterBean, this paramenter write the xml payload in the message log, according to next values:

  • headers: Only HTTP headers are traced for request and response
  • plain: the whole HTTP request and response are traced (including headers and body)
  • hex: A hex dump is traced for whole HTTP request and response

Seguir leyendo

SAP PO mapping Sync SOAP to JDBC

Well, this time I would like to share this tip to create a service interface to retrieve data from Database with SAP PO/PI.

When you develop the message types to get SQL data you must to check the names and the structure of the Data Types, for example, this is a simple structure to do this query:

SELECT VC_PEDIMENTO, INVNUM, VC_PRC_FILE_FLG
FROM MYTABLE WHERE (INVNUM='4900005421')

For the request sender message type you can write your own structure with any label names:

2018-03-07 11_00_30-MM_ConsultarPedidos_ECC_to_DLX_req_ Display Message Mapping Seguir leyendo