Basic SAP CPI Concepts Should Understand and Steps to Learn SAP CPI Effectively
Yee Loon Khoo
SAP CI/CPI, PI/PO, Integration Suite Consultant | SAP CI/CPI Course Creator | SAP? Certified
What this article for and what values it offers?
This article is my attempt to summarize my years of SAP integration experience into beginner-friendly guide, aim to show how to learn SAP Cloud Integration (CPI) effectively, by understand what the list of basic concepts should understand and start learning, also briefly explain the concepts.
When I first started in HCI (early old name of Cloud Integration), I keep asking myself what should I try and learn first to get to some level of competency in SAP CPI. What are the common skills/topic in SAP CPI I should check it out first? Luckily to my background in SAP PI/PO development, so I more of less know what to expect and tried, but still SAP CPI is fundamentally different integration framework compared to SAP PI/PO, so is like newly learning a new tool. I believe many just get started in SAP CPI will have similar doubt and questions too. This article will help.
The objective is one can get started with SAP CPI easier and understand different concepts in SAP CPI. If come across certain concepts/requirement/keywords, one can immediately have some picture/idea in their head and know what it is about(while still not competent enough yet) or even better already can recognize requirement as known pattern then able to confidently apply and formulate workable solution.
Second part of this article will show list of actionable steps to learn SAP CPI effectively, including links to different source of SAP CPI learning materials.
Basic SAP CPI Concepts should understand
1) SAP CPI is based on Apache Camel framework
First thing good to know is SAP CPI is based on Apache Camel integration framework. I mentioned good to know because it is not need to understand full usage of Camel, but it will make a lot sense when you see many “Camel” keyword during SAP CPI development, and know where to look for answers. For example, Camel’s simple expression, date, file language expression.
2) Content Modifier to add/change/delete some data
This is simple but important step in CPI that used frequently. Original Camel exchanges and Camel concept can refer this SAP Press blog. The key takeaways for practical CPI usage are:
a)??????Pipeline concept that CPI pass message contain headers, properties and body from one CPI step to next step connected by arrow. Multiple CPI steps can be chained together sequentially/parallelly.
b)?????Content Modifier able to add/change/delete headers, properties and body (also number range & variables).
c)??????Generally, header store smaller size data that might need send to receiver(s)a.?E.g. as HTTP headers.
d)?????Generally, property store larger size data and data need to store in earlier step of iflow and need retrieve back at later step.
e)?????Body is main payload that can send to receiver(s).
3) Request-Reply to make some calls and Adapter for Connectivity
Request-Reply simply mean make some request call to receiver and get reply/response back. Suggest to first learn these 3 adapter types: HTTP, OData, SOAP because majority of use-case especially those cloud-based API believed fall under these 3 adapter types.
4) Routing Concept mean where and how should my messages flow to?
Routing is common usage in integration, suggest to first learn these 3 routing patterns:
Router step to send message to different routes based on condition, process using different logic and optionally back to single main route.
Multicast step to send the same message to multiple routes to process differently, and optionally gather back results from all different routes.
Splitter step to tackle challenge of splitting large payload to smaller one then only process. Should understand different between General and Iterating Splitter, and learn how to split by XPath, Line Break and Token.
5) Converter to convert body from one format to another
Should learn the usage of standard converter JSON To XML, XML to JSON, CSV to XML, XML to CSV, because these are common payload format hence common requirement.
?
6) Looping concept in CPI
If you come from imperative/procedural programming background (e.g. Java, ABAP, C#), you might wondering how to looping in SAP CPI? What are the equivalent CPI ways to do for loop/while loop since all these CPI steps is drag-and-drop only without coding? The answer is using CPI “Looping Process Call” with condition to exit loop. You should also aware the concept of OData V2 vs V4 looping and leverage build-in looping feature of OData adapter.
?
7) Filter/Sorting concept in CPI?
Filter concept mean only take necessary data required, either source system only send required data, or use CPI filter step to retain only required data. For filter step you will need fair good knowledge of XPath to filter effectively. Alternatively, can use message mapping for filtering or use groovy mapping to do advanced complex filtering.
For sorting, there are no build-in ready step by CPI to do sorting. Will have to resort to custom solution, either XSLT, message mapping (not recommended due to need apply sorting to all fields) or groovy mapping.
?
8) Enrich/Lookup concept in CPI?
There will be cases you might need get different payloads from multiple sources or multiple calls, then only enrich the main payload with data from lookup payload. You should understand default capability and limitation of Content-Enricher step, and good to know ways to do advanced data enrichment using groovy mapping, since message mapping(multi-mapping) that involved multiple messages normally will be relatively much complex to develop and maintain.
?
9) Integration flow design concept in CPI
Personally, I classify the CPI iflow design to 2 major considerations:
First is performance consideration. You should aware different iflow design although might still achieve the result, but sacrificed performance and might become unbearable slow and error prone. General advice is to reduce number of calls required and eliminate unnecessary calls. Avoid using unnecessary large payload but split to reasonable smaller payloads.
Second is iFlow design that easy to understand, develop and maintain. For example, concept of modular design, divide and conquer technique to sub-divide different group of CPI steps into local integration process, make use of processDirect adapter for reusable logic. The iflow designed should be relatively easy to understand. If you from programming background then know that Spaghetti code is messy not maintainable, so the same apply to CPI iflow design, should easy to see where it start, how it flow (left to right, top to bottom) and where it end.One example of badly design iflow is use only one main process that have too many different CPI steps, multiple receivers and arrows that connecting horizontal, vertical, diagonal in every direction, then essential become Spaghetti flow.
?
10) Groovy Scripting capable?to tackle complex mapping (and many things else)
Since Groovy is general purpose programming language so it is very flexible and powerful, basically you can use Groovy script to do a lot of tasks (not only mapping) as long as you able code the solution in Groovy language, and supported in CPI environment. For example use groovy mapping to so source-target fields mapping between these data format: Xml, Json, CSV, IDOC, Odata Batch. Using Groovy scripting is extensible because able to import Java Jar libraries that contain the feature you needed. Example CSV processing Jar library.
?
11) Message Mapping (Graphical Mapping) and Queue and Context concept
If you need to support existing message mapping from standard pre-packaged content iflow, or need to migrate SAP PI/PO message mapping to SAP CPI, then there is no other choice but need to understand those tricky mapping queue and context handling using node functions. It will be difficult to work on complex message mapping without good understanding on message mapping queue and context concept.
?
12) XSLT powerful in XML transformation but come with steep learning curve
SAP CPI XSLT processor support XSLT 3.0 specification, the key takeaway is with XSLT 3.0 it is even feature-rich to do advanced xml transformation. For me I still not able to tune my thinking into XSLT way and not skilled in XSLT. If you have the time, determination and brain-power to learn and think in XSLT, it will be a great skillset to acquire.
?
13) Persistence/Variable/Data Store mean CPI keep data for later usage
For normal integration flow processing, all header, properties and body temporarily hold in CPI during runtime will not able to retrieve them back again after iFlow processing end. This persistence/variable/Data store concept is asking CPI to ‘remember’ by storing in SAP CPI. Generally, global/local variable is for storing single value, while Data Store is to store list of value/payloads under same data store name.
?
领英推荐
14) Exception handling concept in CPI
When error happened in CPI message processing, we can either do nothing then let it failed in CPI in red error, or add exception sub-process. Ideally should at least able to get back the error message and error stack trace, then see how to handle errors, e.g. send alert email, store error message in SFTP server or design advanced re-processing mechanism using data store.
?15) Security concept in CPI
First security concept is authentication. Should aware different authentication supported by SAP CPI. For example username/password, OAuth2 token or client-certificate based authentication. Second concept is authorization mean what access granted example developer role don't have admin access to manage CPI tenant setting or security artifact. Other security concept is message level encryption(encrypt and decrypt) and signature (sign and verify) that commonly used in file-based transfer like in SFTP, but some also apply encryption in API-based HTTP calls.
16) Explore and learn other adapter types based on need and interest
For example: Explore SFTP adapter if need work with files sending/polling, with external partners example Banks’ files. JDBC adapter if need connect and use SQL and stored procedure to interact with database tables.?SuccessFactors adapter if need query or post data to SuccessFactors API (either SOAP or OData). You get the idea, hence no need to list all CPI adapter type here.
Steps to Learn SAP CPI
17) 学而不思则罔,思而不学则殆
First want to share above ancient chinese proverb about learning method. Literally it mean Learning without thinking is useless, Thinking without learning is dangerous. First part refers to blindly learning and try to apply without much reflective thinking , because you cannot deeply understand the meaning of the book and cannot use the knowledge of the book reasonably and effectively, and even fall into confusion. Second part mean if you blindly fantasize/imagine some concepts without actually studying and researching, you will end up in wrong assumption and understanding, not doing it the right way, is comparable to building a tower on the sand, and you will get nothing. Only by combining learning and thinking, learn by useful knowledge and practical examples to strengthen the understanding, otherwise there will be little success.
18) SAP Cloud Platform Integration - The Comprehensive Guide
I recommed this ebook from SAP Press. I did gone through earlier version of this ebook and it is good ebook to read. If you ok with lot of reading, we are look at ebook with 900 pages, it is a comprehensive guide to provide good knowledge about SAP CPI, just that the content might not be the latest, as latest version of SAP CPI do keep on evolving and improving, but the fundamental still the same, good for basic understanding.
19) Search engine + SAP tutorial and community blogs post about SAP CPI
If you need learn particular topic/concept in SAP CPI, fire up your favorite search engine (google?) and search by keywords, likely you will greet with relevant useful blog post on SAP CPI topic. Do you know why blog post can be an effective learning source? Because blog post normally use example to show the concept of particular topic which strengthen understanding. Just that blog post is static in nature, if some concept need see it in action, might not easy to grapsh the concept if blog post didn't explain it well enough.
20) SAP Help Portal - SAP Cloud Integration
How could we left out SAP Help complete reference and documentation? If you want to find out the complete list of capabilities, features available and some official guides for SAP Cloud Integration, this will be the place.
21) SAP Integration Suite Course - Practical SAP Integration Suite 3.0
This Practical SAP Integration Suite 3.0 online video course designed and published by me (YeeLoonKhoo). It is a bundle of courses:
1) Practical SAP Cloud Integration
2) Practical SAP API Management
3) Practical SAP Advanced Event Mesh
I do recommend this SAP CI course because this course thoughtfully designed and prepared course content with practical example that you can hands-on try it out (say in your own SAP Integration Suite trial tenant), will help in strengthen your understanding, and acquire those CI skillset under your belt. Majority of points mentioned from point (1) till point (16) do covered in this SAP CI course. More content will be added to this course.
This course is designed with practicality in mind, in the video lesson I will guide you through my thinking process while developing and explaining the examples, You will gain learning+think as mentioned in point (17), the course sections and lectures examples can be used as reusable pattern to apply in real-world CI/CPI projects development needs. Check out this link Practical SAP Integration Suite to see list of sections and lessons listed.
Beside SAP CI, the bundle of include SAP APIM and SAP AEM & SAP B2B EDI course coming soon as well in Apr 2025.
22) Open SAP Course and SAP HANA Academy YouTube Playlist
Below are list of SAP published course I able to found, some is quite old and also more recent free open SAP course on HCI, CPI and Integration Suite. They are good for basic understanding, but I have the impression the content are more on high level side, not enough detail practical example step-by-step level.
23) SAP Training - CLD900 - SAP BTP Integration Suite
I not enroll in this SAP training before so not able to comment much. But from the training content, it seem more on SAP BTP Integration Suite as a whole, and not much on SAP cloud integration topic or example. If anyone enroll this training before can comment on this.
24) Int4 Book - Developing Groovy Scripts for SAP Cloud Platform Integration
You can also check out E-Bite Developing Groovy Scripts for SAP Cloud Platform Integration ebook by Vadim Klimov and Eng Swee Yeoh. I had enjoyed reading this ebook all about CPI Groovy development with in-depth analysis. In this ebook also show way to setup IntelliJ IDEA for local groovy script development and unit test. The approach in ebook to setup IntelliJ IDEA is different from approach used in CPI course at point (21). You can choose your preference as long as it serve the purpose, able to perform local groovy script development and unit test.
25) Figaf SAP CPI Course
You can also check out Figaf SAP CPI Course by Daniel Graversen at this link https://www.cpicourse.com/. From the course description, the content of the full course is 15 video lessons and some bonus material. Thanks Daniel and team's generosity and decided to make this CPI course for free! Can go check it out!
Anything Missing?
If anything missing can post in comment section to make this article more complete. Thanks.
Finally
Thanks for your attention and time to read till the end. Wish you gain/learn something in this article. Happy Learning! :)
Product | Technical | Generalist | Marketplaces | Integrations | Data
1 年Really useful to get a bit more practical high-end overview of all concepts and tools to get to know. thanks!
SAP S/4 HANA Fi & Co | Mobile App Developer | [Flutter-Dart, Python, Java]
1 年Thank you
Faculty at Aptech Computer Education
2 年Thank you so much for sharing this
Consultor de Integracion SAP - CPI | PI | PO | ABAP
2 年Thanks for sharing those tips and recommendations from your experience, and also those good resources at the end to keep learning!