Bootstrap

SAP PI 开发常见问题

本文章将持续更新,记录开发过程中各种稀奇古怪的问题及解决方案。

(Help资源库:SAP Help Portal

1、RFC问题

MP: exception caught with cause com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.aii.adapter.rfc.afcommunication.RfcAFWException: RfcAdapter: receiver channel has static errors:  caused by: com.sap.aii.adapter.rfc.RfcAdapterException: error initializing RfcClientPool:com.sap.aii.adapter.rfc.core.repository.RfcRepositoryException: RfcException: [null]
    message: ##.#####,####
    Return code: RFC_SYS_EXCEPTION(3)
    error group: 103
    key: RFC_ERROR_LOGON_FAILURE

检查RFC类型Communication Channel的配置,优先检查 IP、密码等配置错误

2、REST Oauth 2.0 Token验证失败

MP: exception caught with cause com.sap.aii.adapter. rest.ejb.common.exception. HttpCallException: HTTP OAUTH 2.0 RESOURCE OWNER PASSWORD CREDENTIALS GRANT call to http://xxxxx/services/oauth2/token?xxxx not successful. Error while processing Authorization request!

如果通过Postman等第三方工具验证没问题的情况下,优先排查对方系统的账号及密码是否有特殊字符的情况,因为SAP PI 的密码处理时对特殊字符转义异常,避免 # !等

3、JSON字符串转义问题

Special character '&' in string by JSON format was converted to - &amp ;

如果报文中涉及特殊字符,建议强制使用 CDATA 包含,这样就不会出现转换问题了。

4、ID JNLP打开后显示空白,无法正常加载(DBeaver影响,卸载即可)

生产机ID JNLP 突然出问题,无法正常打开,后通过JAVA Web Application的调试,发现 client.jar 加载异常。

相关参考信息:SAP Help Portal

经过排查,最近安装了多个软件,依次删除后,发现DBeaver 数据库管理软件会影响PI控件。

5、Peer sent alert: Alert Fatal: handshake failure

此类问题多半是验证问题,包括证书SSL/TSL版本不兼容问题等。

详细报错信息可通过xpi_inspector 检查。

Using XPI Inspector to troubleshoot HTTP SSL conne... - SAP CommunityUpdate 16 Feb 2016: Added additional step to restart channel to refresh the cached certificate. Added link to second part of the blog series on client authentication.icon-default.png?t=O83Ahttps://community.sap.com/t5/technology-blogs-by-members/using-xpi-inspector-to-troubleshoot-http-ssl-connections-part-1-server/ba-p/13201335

Using XPI Inspector to troubleshoot HTTP SSL conne... - SAP CommunityIntroduction In my previous blog Using XPI Inspector to troubleshoot HTTP SSL connections (Part 1 - Server Authentication) , I covered the example of troubleshooting SSLicon-default.png?t=O83Ahttps://community.sap.com/t5/technology-blogs-by-members/using-xpi-inspector-to-troubleshoot-http-ssl-connections-part-2-client/ba-p/13177956

当然,优先考虑SAP NOTES,一般会有解释。

排除证书问题,可参考:

2538934 - Handshake is failing in AS Java when connecting to a server which only
supports TLS_ECDHE ciphers

6、调用RFC后,第一步BI段数据值就错乱

排查字段清单不匹配、特殊字符的问题,如果是REST 方式,检查SM59 TCP/IP 连接配置中 Unicode 配置 (必须勾选Unicode),RFC Sender Channel 同样要勾选 Unicode。

(折腾两天才找到问题点,汗)

7、REST - Target XSD requires a value

Values missing in queue context. Target XSD requires a value for this element, but the target-field mapping does not create one.

详细报错:Transmitting the message using connection RFC_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error encountered while executing mapping: com.sap.aii.af.service.mapping.MappingException: Mapping failed in runtimeRuntime Exception when executing application mapping program com/sap/xi/tf/_MM_IFPP223_Res_; Details: com.sap.aii.mappingtool.tf7.IllegalInstanceException; Cannot create target element /ns1:ZZPP_GET_SIP_FORECAST_DATA.Response. Values missing in queue context. Target XSD requires a value for this element, but the target-field mapping does not create one. Check whether the XML instance is valid for the source XSD, and whether the target-field mapping fulfils the requirement of the target XSD

或者:

PI 无异常报错,但是在Response环节 AM Caption 数据正常 BI caption 是空的。

这两种报错都是因为在Receiver CC中 Data Format 处理有问题,这里主要是 返回数据格式设置中 Element Name and Element Namespace 设置有问题。

我们需要根据 MM Response 中的设置。比如我们这边是根据MT做Mapping,就需要使用MT对应的namespace。

(碰巧,我都遇到了,无语)

;