SAP CPI Interview Questions
30 questions from beginner to advanced, each with a short answer and a real-world scenario. Tap a question to open it.
BEGINNER
Q01What is SAP CPI and what is its primary purpose?
Answer. SAP CPI (Cloud Platform Integration) is cloud-based middleware that connects SAP and non-SAP applications across on-premise and cloud environments using adapters, message transformation, and routing.
Scenario. A company syncs customer data from S/4HANA to Salesforce. CPI transforms XML to JSON and posts it via REST API, keeping both systems in sync without custom code in either application.
Q02What is an iFlow and what are its main components?
Answer. An iFlow (Integration Flow) is the graphical unit of integration logic in CPI. Its main components are Sender/Receiver participants, Channels (adapters), Processing steps (mapping, routing, scripting), and Start/End events.
Scenario. A PO approval iFlow: S/4HANA sends via IDoc adapter → Content Modifier adds a timestamp → Message Mapping converts IDoc XML to JSON → HTTPS adapter posts to the procurement portal.
Q03What types of adapters are available in SAP CPI?
Answer. HTTPS, SOAP, REST, OData (v2/v4), IDoc, RFC, SFTP, FTP, Mail (SMTP/IMAP), JMS, AMQP, Kafka, AS2, SuccessFactors, Ariba, and more. Adapters define the protocol, authentication, and message format at the channel level.
Scenario. Employee onboarding: SFTP adapter picks up a CSV from an HR vendor → SuccessFactors adapter checks for duplicates → SOAP adapter creates the employee in the legacy payroll system.
Q04What is the difference between synchronous and asynchronous processing?
Answer. Synchronous: the sender waits for a response and the connection stays open during processing. Asynchronous: the sender fires the message and disconnects immediately, which suits bulk or decoupled scenarios where no immediate reply is needed.
Scenario. A web shop fetches live stock from S/4HANA synchronously, so the page waits. Overnight invoice uploads use async JMS queues, so the shop disconnects while thousands of invoices process in the background.
Q05What is a Content Modifier and when would you use it?
Answer. Content Modifier sets, modifies, or deletes message headers, exchange properties, or the message body without scripting. Use it to inject timestamps, set dynamic target URLs, or extract values via XPath into properties.
Scenario. An invoice iFlow extracts InvoiceID from the payload via XPath into an exchange property. The SFTP adapter later names the archived file Invoice_${property.InvoiceID}.xml automatically.
Q06What is the Message Monitor and what information does it provide?
Answer. The Message Monitor is the operational dashboard in the CPI web UI. It shows all processed messages with status (Completed, Failed, Retry), payload, headers, error details, and step-by-step logs. It is the first place to check when troubleshooting.
Scenario. A nightly batch fails at 2 AM. The team filters for Failed messages, opens the log, and sees “SFTP host unreachable”. They fix connectivity and use Retry, with no need to retrigger the source system.
Q07What is the difference between an Exchange Property and a Message Header?
Answer. An Exchange Property is an internal variable that exists only within the iFlow and is never forwarded to the receiver. A Message Header is part of the message envelope and can be forwarded to the target. Use properties for processing flags and counters, headers for values the target must receive.
Scenario. A loop counter “RecordCount” is stored as a property (internal only). A header “X-Correlation-ID” is forwarded to the target REST API so it can trace the originating request end to end.
Q08What is XSLT Mapping and when would you prefer it over Graphical Mapping?
Answer. XSLT uses a stylesheet to transform XML. Prefer it when logic is complex: sorting, grouping, aggregates, or advanced conditionals. Prefer Graphical Mapping for simple field-to-field mappings that are easier to maintain visually.
Scenario. A retail integration converts an order XML grouped by category into a flat XML for the warehouse. The grouping and sorting is handled cleanly in XSLT with xsl:for-each-group, while simple field mappings use a separate graphical step.
Q09What is the role of Integration Advisor in SAP Integration Suite?
Answer. Integration Advisor creates and manages B2B Message Implementation Guidelines (MIGs) and Mapping Guidelines (MAGs) based on industry standards (EDIFACT, ANSI X12, IDoc). It auto-generates XSLT artifacts, removing manual B2B mapping work.
Scenario. A retailer exchanges EDIFACT ORDERS with 50 suppliers. Instead of hand-coding 50 XSLT maps, Integration Advisor creates one MIG for the standard and exports ready-to-deploy XSLT artifacts into CPI iFlows.
Q10What is the purpose of the Groovy Script step in SAP CPI?
Answer. Groovy Script provides custom logic when built-in steps are insufficient: complex payload manipulation, dynamic header construction, calling Java libraries, conditional logic, regex operations, and custom error messages.
Scenario. A banking iFlow must mask account numbers before forwarding to a reporting system. A Groovy script reads the JSON body, uses regex to replace the middle digits with asterisks, and writes the payload back, which a standard mapping step cannot do.
INTERMEDIATE
Q11Explain the Splitter and Aggregator pattern with a practical use case.
Answer. The Splitter breaks a bulk message into individual sub-messages for independent processing. The Aggregator collects processed sub-messages and reassembles them using a correlation expression and completion condition. Splitter types: General (XPath), IDoc, ZIP/multipart.
Scenario. An ERP sends a batch XML with 500 sales orders. The General Splitter creates 500 messages, each enriched with delivery data via an API call. The Aggregator recombines them into one batch XML posted to the logistics system.
Q12What security configurations are available for inbound and outbound connections?
Answer. Inbound (sender to CPI): Basic auth, Client Certificate (mTLS), OAuth 2.0 (Client Credentials / Auth Code), API Key. Outbound (CPI to receiver): Basic auth, OAuth 2.0, Client Certificate, Principal Propagation (SSO), SSH keys for SFTP. Credentials live in Security Material and are never hardcoded in iFlows.
Scenario. A bank partner sends files via AS2 with mutual TLS. Outbound to core banking uses OAuth 2.0 client credentials; the client secret is stored as a Secure Parameter and referenced in the channel, never visible in the iFlow.
Q13What is the difference between JMS and AMQP adapters?
Answer. JMS connects to the built-in SAP message broker inside CPI and provides reliable delivery and retry within the SAP ecosystem. AMQP connects to external brokers (Azure Service Bus, ActiveMQ, RabbitMQ). Choose JMS for decoupling within SAP, and AMQP when an external broker is shared across systems.
Scenario. Orders within CPI use JMS queues for reliable async retry. Cross-company events shared with non-SAP consumers use AMQP to connect to an Azure Event Hub shared by logistics, finance, and analytics teams.
Q14How do you implement error handling using the Exception Subprocess?
Answer. The Exception Subprocess activates when an unhandled exception occurs in the main flow. Inside it you can log the error, send alerts, call a notification API, or write to a dead-letter queue. For specific steps, attach it to a Local Integration Process.
Scenario. An iFlow posts invoices to a supplier portal. On HTTP 500, the Exception Subprocess logs the invoice number, triggers an SAP Alert, and archives the failed XML to an SFTP error folder so ops can reprocess it.
Q15What is the Router step and what types of routing conditions can you configure?
Answer. The Router directs a message to one of several branches based on conditions on the payload, headers, or exchange properties. Condition types: XPath (XML), JSONPath (JSON), header/property comparisons, and a Default route fallback. Only one branch executes per message.
Scenario. A Router checks the property “SourceSystem”. SAP_ECC → IDoc mapping branch. SALESFORCE → JSON-to-XML branch. Default → error notification queue for unrecognised sources.
Q16What is Externalized Configuration and why is it important for transport?
Answer. Externalized configuration extracts iFlow parameters (URLs, credential names, paths) so the same artifact deploys to Dev/QA/Prod unchanged; only parameter values differ per environment. Values are set in the Configure tab before deployment.
Scenario. One iFlow connects to S/4HANA with URL, credential alias, and path externalized. The DevOps pipeline supplies different parameter files per tenant, so promoting from Dev to Production needs no redesign.
Q17Explain how the SFTP sender adapter implements polling.
Answer. The adapter periodically checks the source for new files using a poll interval, directory path, file name pattern, and post-processing action (archive, delete, or keep). A lock mechanism prevents duplicate processing across overlapping poll cycles.
Scenario. A payroll provider drops salary files every Friday at 11 PM. The adapter polls /outbound/salary/ every 15 minutes for salary_*.csv. Processed files move to /outbound/processed/, preventing re-pickup and providing an audit trail.
Q18What is the Filter step and how does it differ from the Router step?
Answer. Filter removes content from within a message: it uses XPath to extract a subset of XML nodes and replaces the entire body with only the matching content. Router does not change the body; it decides which processing path the message takes. Filter trims the payload, Router branches execution.
Scenario. An ERP returns a 200-field product XML. A Filter step with XPath //ProductSummary keeps only name, price, and stock level, cutting bandwidth and downstream processing cost.
Q19How does the Request-Reply pattern work in SAP CPI?
Answer. Request-Reply is a synchronous mid-flow callout to an external service where a response is needed before the iFlow continues. The iFlow pauses, sends the request, receives the reply, then carries on with the enriched payload. It is used for data enrichment, separate from the final receiver.
Scenario. An order validation iFlow calls a credit-check REST service via Request-Reply. A Router then branches: score below 500 → rejection notification; above 500 → post the order to S/4HANA.
Q20What are Value Mappings in SAP CPI and how are they managed?
Answer. Value Mappings are lookup tables that map equivalent values between systems (e.g. SAP “DE” ↔ ISO “DEU” ↔ Salesforce “Germany”). They are managed in the CPI UI under Resources and shared across iFlows. The valueMapping() function performs runtime lookups, and table updates apply to all iFlows.
Scenario. SAP uses numeric product category codes while Shopify uses text slugs. A Value Mapping table stores the cross-reference. When categories are added, only the table changes, with no redeployment of the 15 iFlows that use it.
ADVANCED
Q21Describe ISA-M and how it guides SAP CPI architecture decisions.
Answer. ISA-M (Integration Solution Advisory Methodology) defines integration domains (A2A, B2B, B2G, C2B), styles, and use-case patterns. For each use case it recommends the right SAP Integration Suite capability: CPI for process integration, API Management for API-centric scenarios, Event Mesh for streaming. It prevents misusing CPI for scenarios that belong to other tools.
Scenario. An architect must integrate S/4HANA with a logistics provider (A2A → CPI iFlows) and publish APIs for mobile apps (API-centric → SAP API Management). ISA-M prevents both from being built as CPI iFlows.
Q22How would you design exactly-once delivery in SAP CPI?
Answer. Use three layers: (1) store a unique message ID in a Data Store for an idempotency check before processing; (2) use JMS queues for at-least-once delivery during outages; (3) enable JMS transactions so failed downstream processing rolls back queue consumption and allows safe retry. Together they give an exactly-once business effect.
Scenario. A payment iFlow reads PaymentID and checks the Data Store. Duplicate: end silently. New: write the ID → post to bank → commit the JMS message. If the bank call fails, the JMS transaction rolls back and retries, and the idempotency check prevents a double payment.
Q23Explain decoupled integration using JMS queues and how it improves resilience.
Answer. A sender iFlow posts to a JMS queue and terminates; a separate consumer iFlow processes from the queue. The sender is unaffected if the target is down, messages accumulate and process on recovery, consumers scale independently, and retry configuration is separated from sender logic.
Scenario. An e-commerce shop fires thousands of orders per hour while the warehouse has nightly maintenance. Without decoupling, orders fail. With JMS, the sender queues everything instantly and the consumer retries on recovery, so the shop never notices the downtime.
Q24What is Principal Propagation and when is it used?
Answer. Principal Propagation forwards the original authenticated user’s identity (SAML/OAuth token) through CPI to the backend instead of using a shared technical account. It is critical when backend access must follow the calling user’s permissions, preserving row-level security and audit trails end to end.
Scenario. An HR portal calls CPI with an employee’s OAuth token. CPI propagates the identity to S/4HANA via Cloud Connector, which returns only that employee’s payslips. With a shared technical account, all employees’ records could be returned, a serious GDPR violation.
Q25How do you handle large file processing without hitting CPI memory limits?
Answer. (1) Enable NIO streaming in the SFTP adapter so the file is processed as a stream, not loaded fully into memory. (2) Use a Splitter to break the file into chunks. (3) Use the ZIP Splitter for archives. (4) Avoid storing large payloads in exchange properties. Always test with production-volume data.
Scenario. A logistics company sends 2 million shipment records (~800 MB) daily via SFTP. NIO streaming plus a General Splitter in chunks of 5,000 records posts to the WMS in batches. Memory stays under 50 MB and the full file processes in under 20 minutes.
Q26Explain the SAP CPI Data Store, its use cases, and limitations.
Answer. The Data Store is a persistent key-value store inside the CPI tenant. Use cases: storing intermediate messages between executions, idempotency checks, caching reference data, stateful workflows. TTL is configurable. Limitations: not for high-volume storage, not a database replacement, no cross-tenant access, and performance degrades under heavy load.
Scenario. A procurement integration receives partial PO acknowledgements across several messages. Each execution writes line-item status to a Data Store keyed by PO+line. A scheduled iFlow checks whether all lines are acknowledged, then sends the consolidated ACK to the buyer.
Q27How would you implement a retry strategy with exponential back-off in SAP CPI?
Answer. CPI does not natively support exponential back-off, but you can build it: (1) a JMS queue with a retry count and dead-letter queue; (2) a Groovy script that reads the retry count, computes the delay (2^n × base seconds), and writes to a JMS retry queue with a delay header; (3) after max retries, route to the dead-letter queue and trigger an alert.
Scenario. An iFlow calls a partner API that rate-limits (HTTP 429). The Exception Subprocess reads RetryCount, computes the wait (30s, 60s, 120s, 240s), writes to the retry queue, and increments the counter. After 5 attempts: dead-letter queue plus an email alert to the integration team.
Q28What is the difference between a Local Integration Process and an Exception Subprocess?
Answer. A Local Integration Process (LIP) is a reusable iFlow fragment called via the ProcessCall step, like a subroutine, and runs in the caller’s thread. An Exception Subprocess activates only when an error occurs in the main process and is used for error recovery, not reuse. LIPs avoid copy-pasting common logic.
Scenario. 15 iFlows need the same PII masking logic. A LIP called “LIP_MaskPII” holds the Groovy script and each iFlow calls it via ProcessCall. When GDPR rules change, only the LIP is updated and redeployed.
Q29How do you approach performance tuning of SAP CPI iFlows in production?
Answer. (1) Use trace-level analysis to find slow steps. (2) Disable “Store Message” on steps unless debugging. (3) Use parallel multicast/splitter for independent paths. (4) Avoid N+1 lookup patterns in Groovy; use bulk API calls. (5) Use Value Mappings instead of scripts for code lookups. (6) Tune JMS prefetch counts and concurrency.
Scenario. An insurance claims iFlow takes 45s against a 10s SLA. Tracing shows 30s in Groovy making sequential REST calls per claim line. One bulk API call cuts that step to 4s, and a parallel Splitter brings the total to 7s.
Q30How does SAP CPI integrate with SAP Event Mesh, and when do you use event-driven over request-reply?
Answer. CPI connects to Event Mesh via the AMQP adapter (queues) or HTTP (CloudEvents). Use event-driven when multiple consumers must react independently or fan-out is needed. Use request-reply when an immediate response from a single system is required.
Scenario. S/4HANA publishes SalesOrderConfirmed to Event Mesh. Three subscribers react: CPI sends a confirmation email, the warehouse updates picking lists, and analytics refreshes the revenue dashboard, none aware of each other. With request-reply, S/4HANA would call each one serially and fail if any were down.
No comments:
Post a Comment