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

Oracle change initial password with sqlplus

A quick tip, at the first login in DB you must to change the initial password but some tools cannot do this, for example dbeaver.

Then you need to download sqlplus from oracle and unzip it in some place:

instantclient-sqlplus-windows.x64-18.3.0.0.0dbru.zip

Open an terminal and go to sqlplus folder and execute:


sqlplus.exe /nolog

And connect witth one of this:


conn USER@TNS_ALIAS

conn USER/PASS@host:port/SID

Best

Mac OS X set Terminal color theme

A few days ago I had been upgrading my OS X with a fresh install, the default theme in terminal is very poor if you work with the console, to change the theme you can configure the colors.

First, edit your  “~/.bash_profile“, if don’t exists create new one, and add this content:

export TERM="xterm-color"
alias ls="ls -G"
export PS1="\e[1;30m\][\e[\e[1;30m\]\e[1;33m\] \u@\H \[\e[1;32m\]\w\[\e[0m\] \e[1;30m\]]\n[\[ \e[1;31m\]\T\[\e[0m\]\e[1;30m\] ] > \e[37m\]"

Now, you can download a preconfigured themes from:

https://github.com/lysyi3m/macos-terminal-themes

Select one and open it with double click (files with “.terminal” extension), now change the terminal preferences, in Profiles section select your profile and set as Default.

I use the Nova theme in my laptop:

nova

Cheers

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