Posts

How do you Document your SAP CPI Iflows

Documentation of integration has always been a strange thing. It has been pretty difficult to make sure we documented the details correctly and had enough information with. Normally you will just get some document designed to document some other thing and then try to adapt it to your integration. That will never give a good result. You may be compliant but just a waste of time if the documentation is not useful.

For SAP PI/PO we have for ages been using a Word template for the documentation of each interface. We support that with the Figaf IRT tool, so you can generate it fast. You can see an example of the SAP PI documentation here. The inspiration was to avoid having the documentation that was never updated and always had the initial version.

SAP Best practive

I did find an example of a SAP CPI template in the best practice guide. I did not like if for a few assumptions:

  • It was focusing on the wrong things that were a bit to detailed and too generic. Like a file conversion, or mapping it just has empty tabs that users need to fill in.
  • It could not be automated every well, which ment it did require a lot of user governance to host the information
  • It was juggling 3 different adapters and not showing the required details

I wanted to improve the process and make it even easier to capture the most important part of a CPI Iflow. It ended up with the following information:

  • Overview of the iFlow header information like name and description
  • History of changes logged with business requirements
  • Connection sender and receiver together with information
  • Test cases you have created for the tool
  • Flow description which is a table representation of the iflow. It will give some overview of how the different steps are connected
  • Configuration parameters configured in the full landscape, so you got some information on what is being used and the relavant resources.
  • Resources and the lat change data for them.

You can download an example of the document here for the SF to AD iflow.

There are ways to improve the document with more information. If you have anything that you think will provide value and make it easier to understand the documentation. Do let us know.

Automated documentation does have some limits like being able to update it different places, and add the extra information that makes sense.

You can try it own on your own iflows and see how it performs in your landscape.

SAP PI/PO B2B Add-on alternative

We will in the next period of time see a large number of users that will be performing migrations of their SAP PI/PO platfrom to 7.5. I have created a number of resources on SAP PI/PO Migration. One of the big thing in this migration is the migration from Seeburger to B2B Add-on. We do have a tool that allow you to automate the migration from Seeburger to B2B Add-on message mappings.

B2B Add-on from SAP does work and can give you a way to manage your EDI messages. There are still some gaps in the B2B Add-on solution that could be greatly improved and where i see that an alterntaive solution could be better. It is in the area of:

  • Logging and archiving of messages sent.
  • Partner management and settings usability
  • Configuration of partner connections via AS2, VANS or SFTP.

I had a webinar with Paw Pedersen from BizBrains that created a product called Link. Link is a tool build to manage your EDI solution. It is currently being used to manage B2B for Biztalk, but the same system can be used also for SAP PI/PO. They have been running it for a number of customers from small companies wanting to run EDI to big banks. You will learn about what the solution can help with. You can see the replay here.

They have a number of different configuration options and security settings that are required for banks. They also have large customers with many partners, so they know how to make the application scale.

One of the reasons I think it could be useful for you is that you can switch to their platform and then there is no need to upgrade to the PO license and can stay on the PI License. It can save you a great deal of money and speed up your migration process.

There is a number of different ways the Link solution can tie into your SAP PI/PO solution from

  • Just as an Archive of messages
  • Partner configuration
  • Partner configuration that updates your mappings
  • Using it also for SAP CPI.

If you find the product interesting write to psp@bizbrains.com, and get a trial of what the solution can do.

I will be a part of designing a good solution that will make your migration as simple as possible.

Automated SAP PIT Test case creation

A month ago SAP released a testing tool for SAP PI/PO. One thing I have been contemplating a lot is how to test the first upgrade. One challenge with the SAP PIT testing tool is to be able to run a test on your first upgrade with the tool. I do see a problem with the first two upgrades. If you accept the premise that we need to test all upgrades for SAP PI/PO and therefore need a tool for it. Then it has some challenges for the beginning.

The first upgrade

The system needs you to implement OSS Note 2650265 which is an upgrade to MESSAGING SYSTEM SERVICE released February 2019 and applies to many services packs for 7.31 and above. If you want to implement this upgrade you will need to patch all components because they are linked in SAP Netweaver Java. This means that for this to work you need to implement quite a number of changes for it to work. I see the process as the following:

  1. Implement the patch according to the note on your development system.
  2. Since you don’t know if any thing is affected you will need to run a full test with your SAP PI
  3. Implement the note in production
  4. Once the note is in production you can upgrade your development system to 7.5 SP 14.
  5. Then you can start to create test cases on the 7.5 SP14 and validate that nothing has changed. You will then compare production data with data on SP14 so you cannot compare how the upgrade works.
  6. Once you are done with creating the test cases you can implement SP 14 in your landscape
  7. Next upgrade can be made a bit easier because you have the test data

For me it does sound like a lot of extra manual tests and changes to your landscape limiting how much you can do in the process.

Figaf IRT

The Figaf tools allow you to test all SAP PI 7.31, 7.4 and 7.5 system without installing new support packs. We have a number of options to record messages. Either as SAP is doing with looking in the log messages, except we can use a patch that is 2 years old to enrich your monitoring web services. Or we even have a web scraping option that is even older than it. But we do have a better solution which is to add a module to your processing chain. That way you can test much faster on your system with a lower impact on them.

Screenshot of the new button to export data to PIT

SAP Customers prefer to use standard tools, in the places where it makes sense and they can find enough value. We, therefore, are working on a way to enable you to export your Figaf IRT test cases to SAP PIT, so you can stop using the Figaf tools for testing. This way you can use Figaf to help test the first upgrades and then use SAP PIT for the future

We do hope that we are proving enough value together with ways to make your SAP testing better and faster, and also allow you tigth itnegration to test the interfaces that you are changing.

How how does the migration work

It is a pretty simple just process. Once you have a Testing Template in Figaf IRT and have run it you will see the Export to PIT button. The messages then exist on your SAP PI system. Figaf IRT will create a Test Suite in PIT with the same messages. IRT know which messages should be added to the test cases so it will request. Then it is just up to PIT to fetch the messages.

It is a licensed feature of the Figaf IRT so you will need to purchase a license, it can save you some time for your testing.

You can see a demo of it here.

There will be a few more changes to make for the process to work, like:

  • Set a name for the template
  • Send ignoring elements over to the test case
  • Update it the process if PITs API is changing since it is not published.

There may also come future development in the PIT tool, we can use to run this process better. Lets see in the next support packs. It is possible to add running of tests cases and integrate it with our DevOps appoach so you can test the interfaces that is changed by a mapping.

If you want to see how fast you can create test cases in Figaf and run your tests in it then download the tool for free and get started in an hour. We do also have many extra features that you will not find in SAP PIT.

The testing solution from SAP to test PI/PO called PIT

Friday the 8 of March was the day that SAP finally released SP 14 of SAP PI/PO 7.5. The big promise was the new testing solution that allowed users to test SAP PI message process. It is called PIT.

“TL;DR the testing solution from SAP has some good features for testing. If you are serious with your testing and want full coverage then try out the Figaf IRT tool. “

As a vendor with a similar product, I have been interested in knowing what was going on with it and how it was working. I had seen some initial working of it but did not know where it would end. If it was going to be a killer product then it would remove part of my market. No customers can see the solution and judge if it will be useful for their use cases.

The key takes away is that testing is an important part of your it process where it is upgrading/patching, development or change of your interfaces. It is something that customer have expected and would like to see improved.

It is also good to know that SAP is taking the same approach as we have for fetching and running test cases.

Let’s start with the good part.

The Good part of PIT

  • It is a part of your license so you do not have to pay separately for it.
  • It removes the excuse that you cannot run any tests because you can always set it up
  • It supports fetching test data from dual-stack systems so you can test when you are performing upgrades for the systems. You will need to apply some ABAP notes to allow the recording.
  • You don’t need to install extra systems to run it the testing application.
  • It has a shared repository of data that all developers with the right role can access.
  • You can configure comparison of attachments
  • There are batch jobs running message processing and validation.
  • It is standard software following SAP delivery and support method.
  • Messages can be stopped before reaching the adapter and thereby not send it to the receiver.
  • That no changes need to be made to your landscape except you need to switch logging on for a period of time for the interfaces you want to collect data from.
  • It gives a good overview over how many messages that are affected by a change in one element
One overview i like. In just one screen you can see where the differences are structure across the testing result

I have not seen any roadmaps of the tool and how much resources and new features will be delivered but it looks like there will be more effort in it. So this is all based on the initial release.

Check out the video that I recorded that show my first look at what the tool can do.

My first experience with the tool and what is possible.

I believe that PIT will probably run more tests that my tool because the availability of the tool and customers it is simple to install the system.

What are the requirements

The test system must be installed on a 7.5 sp 14 or above. It can only run a test on the system with that SP level.

PIT  is able to collect test data from AEX system 7.31+ that have been updated within the last 2 years (It requires this note 2650265, which seems to have been backported to all service packs on 7.31+).

PIT can also collect messages from ABAP based systems here you need to apply some more support packages to allow the system to read data.

Read more on

I still see some areas where we have advantages over the SAP tool. (Okay, I may be a little biased, but if you try it out you will hopefully too.)

Why you still need to buy my tool

  • It enables you to test your modules that way you are ensuring that it is also covered as a part of the test.
  • We have a number of options for testing including using the SAP logging, but unlike SAP we du support all 7.31+ releases because we have web scraping to get messages. It is not an ideal solution but allows you to create test data on your old system without having to patch them. Because then you will have to do testing.
  • The speed of recording multiple test cases is a lot faster with the IRT tool because it can handle a lot of configuration needed. You can select multiple iflows and record them at the same time.
  • We do have a graphical overview to view differences and add ignoring of certain elements like time stamps that you do not want to cover.
  • Figaf support patterns not covered by PIT like Async-sync, Sync-async, EDISeperator and pattern is determinated automatically
  • Comparison not only in XML but also JSON, X12, EDIFACT, Text, and Binary
  • Simple data anonymization. You can select your input payload and then with a few clicks analyze everything and insert random names or number on different locations. This allows you to test with sensitive data and comply with GDPR.
  • Allow you to run multiple jobs and test cases when you want or scheduled
  • Excel report of all results so you can show how it worked
  • Connection with our DevOps solution so you can ensure that you are testing all interfaces that are affected by your change. It also allows you to document what was changed.
  • For customers the ability to get new features or functions delivered in days.
  • And so on… I could probably find a few more areas that we cover better.

Will we integrate the Figaf IRT tool with PIT

Since SAP will have a lot of test cases running in the tool we may be able to add some additional benefits of running tests with it. There may be something that can be implemented. We can leverage the way SAP is processing messages if you don’t want to get the test messages into the adapter. We could also use the ability to send a message directly to the message processing without creating an XI30 message.

We cloud probably also leverage the SAP part about downloading messages from dual-stack systems, and use them in our landscape.

IT will probably depend on when customers are adopting 7.5 sp14.

Your take away

If you have a plan to apply 7.5 sp 14 in the near future to your landscape do evaluate it. And see how it fits your plan and idea for working with the tools.

If you want to tool that can help you set up test cases faster, give you full tracking of what is being developed then try out the Figaf IRT tool? And we do support CPI also in the same approach.

You can check out the tool and see if it will suit your testing capabilities better. Check it out at Figaf.com/IRT


A different way to restart SAP CPI content

It is pretty difficult to restart SAP CPI messages from any external applications. There is just two ways that include either the Enterprise Messaging/JMS or the Datastore. Some times this can create some complex scenarios for the user to develop.

We wanted to make some of the development a little easier. It requires just one groovy script and two script steps in your iflow. We will show a different way that allows you to restart messages in an external application and setup rules for how often it can be reprocessed. We leverage that the Figaf IRT application is able to download messages that have a specific filter like Receiver is LOG. Then the message will be downloaded and you can apply some rules to it like it should be reprocessed 3 times. There is also the option to send notifications to emails or systems like Jira.

Check out the video where you can see how simple it is to restart a SAP CPI message.

We currently do not know how this will affect count of connections on your SAP CPI system, so use with caution.

You can try out Figaf IRT on your own system. We have both a cloud and an on-prem version to deploy the application.

You can see the code below, it will be updated so you can find a more uptodate version in the IRT application.

package com.figaf.irt
import com.sap.gateway.ip.core.customdev.util.Message
import org.apache.camel.converter.stream.InputStreamCache
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
def Message initalSave(Message message) {
    try {
        //Body
        def body = message.getBody(java.lang.String)
        def base64 = body.bytes.encodeBase64().toString()
        Map map = message.getHeaders()
        map.put("body", base64)
        message.getHeaders()
        def json = JsonOutput.toJson(map)
        def cache = new InputStreamCache(json.bytes)
        // we save the json as a property, so we can restore it in the pipeline
        message.setProperty("IRTSAVE", cache)
    } catch (Exception ex) {
        try {
            def messageLog = messageLogFactory.getMessageLog(message)
            messageLog.setStringProperty("CustomLog", ex.getClass().getName() + ":" + ex.getMessage())
        } catch (Exception ignored) {}
    }
    return message
}
/**
 * An error have occurred then save the payload as an attachement
 * @param message
 * @return
 */
def Message savePayload(Message message) {
    try {
        def messageProperties = message.getProperties()
        def ex = messageProperties.get("CamelExceptionCaught")
        if (ex == null) {
            return message
        }
        def irtpayload = message.getProperty("IRTSAVE")
        JsonSlurper jsonSlurper = new JsonSlurper()
        def map = jsonSlurper.parseText(irtpayload.getText())
        map.put("Cause", ex.getClass().getName() + ":" + ex.getMessage())
        irtpayload = new InputStreamCache(JsonOutput.toJson(map).bytes)
        ByteArrayOutputStream bytesOut = new ByteArrayOutputStream()
        irtpayload.writeTo(bytesOut)
        def messageLog = messageLogFactory.getMessageLog(message)
        messageLog.addAttachmentAsString("IRTSAVE", new String(bytesOut.toByteArray()), "application/json")
        message.setHeader("SAP_Receiver", "LOG")
    } catch (Exception ex) {
        try {
            def messageLog = messageLogFactory.getMessageLog(message)
            messageLog.setStringProperty("CustomLog", ex.getClass().getName() + ":" + ex.getMessage())
        } catch (Exception ignored) {}
    }
    return message
}