IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> Java知识库 -> PO JAVA Mapping 映射运行时常量 -> 正文阅读

[Java知识库]PO JAVA Mapping 映射运行时常量

Special Access to Mapping Runtime Constants


Use

In some mapping programs it may be necessary to access fields in the message header. For this purpose, the mapping runtime saves the field values as key-value pairs.

Examples of Key-Value Pairs in the Map for Runtime Constants

Key

Value

MessageClass

ApplicationMessage

ProcessingMode

synchronous

ReceiverNamespace

http://com.sap/xi/example

The keys are derived from the field names of the fields in the message header.

Access Using String Constants Instead of Keys (Standard Case)

To be able to read the fields of the message header at runtime, you must access the map for the runtime constants. However, if you were to access the map by using the keys specified above and one of the keys were to change, the program code would be rendered invalid. For this reason, the mapping API provides string constants that can be used to access the map in place of the keys.

String Constants for Accessing the Runtime Constants in the Map

String Constant

Key

MESSAGE_CLASS

MessageClass

VERSION_MAJOR

VersionMajor

VERSION_MINOR

"VersionMinor"

PROCESSING_MODE

"ProcessingMode"

MESSAGE_ID

"MessageId"

REF_TO_MESSAGE_ID

"RefToMessageId"

CONVERSATION_ID

"ConversionId"

TIME_SENT

"TimeSent"

INTERFACE

"Interface"

INTERFACE_NAMESPACE

"InterfaceNamespace"

SENDER_PARTY

"SenderParty"

SENDER_PARTY_AGENCY

"SenderPartyAgency"

SENDER_PARTY_SCHEME

"SenderPartyScheme"

SENDER_SERVICE

"SenderService"

RECEIVER_NAME

"ReceiverName"

RECEIVER_NAMESPACE

"ReceiverNamespace"

RECEIVER_PARTY

"ReceiverParty"

RECEIVER_PARTY_AGENCY

"ReceiverPartyAgency"

RECEIVER_PARTY_SCHEME

"ReceiverPartyScheme"

RECEIVER_SERVICE

"ReceiverService"

MAPPING_TRACE

"MappingTrace"

How the access works varies according to where you want to query the runtime constants:

  • In?Java mappings?you work with the?get?-methods of the mapping API.

  • Within a?user-defined function?of a message mapping, you can access the map either by using the method?getTransformationParameters()?of the container object or by using the method?getParameters()?of the GlobalContainer object. See:?Container Object?.

  • If you are still working with the?SAP NetWeaver 2004/SAP?SAP NetWeaver 7.0?JAVA mapping API, you must code the method setParameter within a JAVA mapping to be able to access the map. More information:?Java-Mapping-API (SAP NetWeaver 2004?and 7.0)?.

Accessing the Runtime Constants by Using Keys (Special Case)

In certain exceptional and unavoidable cases, it may be necessary to use the keys to access the fields in the message header. This is always the case when you want to access the contents of the map by means of a variable. In the example below, a variable key?key?, which is to be used to read a field in the message header, is transferred to a user-defined function of a message mapping. You can only use a variable to access the map if the variable has the name of the key as its value and not the name of the string constant.

String headerField; java.util.Map map;

// get runtime constant map

map = container.getTransformationParameters();

// get value of header field by using variable key

headerField = (String) map.get(key);

For example, to read the message ID from the message header, the variable?key?must have the value MessageId and not MESSAGE_ID.

?


??

Managing Services in the Enterprise Services Repository?Special Access to Mapping Runtime Constants

Java Mapping for PI 7.1 using Abstract transformation class

  Java知识库 最新文章
计算距离春节还有多长时间
系统开发系列 之WebService(spring框架+ma
springBoot+Cache(自定义有效时间配置)
SpringBoot整合mybatis实现增删改查、分页查
spring教程
SpringBoot+Vue实现美食交流网站的设计与实
虚拟机内存结构以及虚拟机中销毁和新建对象
SpringMVC---原理
小李同学: Java如何按多个字段分组
打印票据--java
上一篇文章      下一篇文章      查看所有文章
加:2021-09-24 10:24:23  更:2021-09-24 10:25:58 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/23 19:09:56-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码