当前位置:网站首页>A specific example of ABAP type and EDM type mapping in SAP segw transaction code
A specific example of ABAP type and EDM type mapping in SAP segw transaction code
2022-07-05 12:55:00 【Wang Zixi】
The examples in this article focus on Edm Attribute ABAP Datetime Processing logic .Datetime Just mapping ABAP The type and EDM One of the examples of possible inconsistencies when typing .
about Edm.Datetime attribute , On the back end ,ABAP A field can be represented as a simple date or timestamp , It can be with or without decimal seconds .
therefore , stay Service Builder For one EDM.Datetime Properties of type , Additional information is needed to put this EDM Type maps to the correct in the backend ABAP Field type . If not mapped correctly , It will lead to wrong type assignment .
The correct type assignment is for MPC Automatic generation of is crucial , because DPC The implementation is based on MPC Types generated in the class .
stay Service Builder The initial solution to achieve this goal in is :
If precision = 0 also scale = 0, that ABAP internal type by type D.
If precision = 8 also scale = 0, that ABAP internal type by type P,length by 8 decimals by 0 (
timestamp without fractional seconds
)If scale = 7, that ABAP internal type by type P,length 11 decimals 7 (
timestamp with fractional seconds
)
In addition to using precision and scale Beyond attribute , You can also use Service Builder Medium ABAP Type Editor Come on Set up directly
Internal type . stay ABAP In the type editor , You can manually set the category to internal type , The following rules :
- Type Kind = Date, Length = 8, Decimals = 0 ( representative Simple Date, internal type by D)
- Type Kind = Packed, Length = 15, Decimals = 0 (timestamp without fractional seconds, internal type stay MPC Shown in type P length 8 decimals 0)
- Type Kind = Packed, Length = 21, Decimals = 7 (timestamp with fractional seconds, internal type stay MPC Shown in type P,length 11 decimals 7)
The above described rules are reflected in the screenshot below :
perhaps , You can use ABAP The type editor will be a Data Element
Assign to an attribute . stay ABAP In the type editor , You can manually turn Category
Set to Date
, And enter the data element name in the association type field .
When using RFC/BOR Import or assign DDIC Type , If the structure is assigned to the parent component ( That is to say Entity Type Or complex types ), Not in property Assign by level .
When used from DDIC Structure import options , The date field is handled as follows :
If the field's field is type
TZNTSTMPS
, Then there is no decimal second timestamp ,MPC The internal type of is type P, length 8, decimal point 0If the domain type of this field is
TZNTSMPl
, be MPC The internal type is P type , The length is 11 position , Would have a 7
边栏推荐
- Kotlin function
- Transactions from December 29, 2021 to January 4, 2022
- Sqoop import and export operation
- SAP UI5 DynamicPage 控件介绍
- Introduction to sap ui5 dynamicpage control
- stirring! 2022 open atom global open source summit registration is hot!
- 关于 SAP UI5 getSAPLogonLanguage is not a function 的错误消息以及 API 版本的讨论
- 【云原生】Nacos中的事件发布与订阅--观察者模式
- 自然语言处理系列(一)入门概述
- SAP SEGW 事物码里的 Association 建模方式
猜你喜欢
Compilation principle reading notes (1/12)
[cloud native] event publishing and subscription in Nacos -- observer mode
DNS的原理介绍
Taobao order amount check error, avoid capital loss API
RHCAS6
超高效!Swagger-Yapi的秘密
滴滴开源DELTA:AI开发者可轻松训练自然语言模型
A deep long article on the simplification and acceleration of join operation
SAP SEGW 事物码里的导航属性(Navigation Property) 和 EntitySet 使用方法
JDBC exercise - query data encapsulated into object return & simple login demo
随机推荐
你的下一台电脑何必是电脑,探索不一样的远程操作
stm32和电机开发(从架构图到文档编写)
Transactions on December 23, 2021
Alipay transfer system background or API interface to avoid pitfalls
Simply take stock reading notes (2/8)
CVPR 2022 | 基于稀疏 Transformer 的单步三维目标识别器
NFT: how to make money with unique assets?
Iterator details in list... Interview pits
10 minute fitness method reading notes (2/5)
函数传递参数小案例
MySQL 巨坑:update 更新慎用影响行数做判断!!!
Kotlin variable
太方便了,钉钉上就可完成代码发布审批啦!
SAP self-development records user login logs and other information
LeetCode20.有效的括号
What if wechat is mistakenly sealed? Explain the underlying logic of wechat seal in detail
【云原生】Nacos中的事件发布与订阅--观察者模式
Halcon 模板匹配实战代码(一)
SAP UI5 DynamicPage 控件介绍
#yyds干货盘点# 解决名企真题:搬圆桌