当前位置:网站首页>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
边栏推荐
- Research: data security tools cannot resist blackmail software in 60% of cases
- A possible investment strategy and a possible fuzzy fast stock valuation method
- RHCSA7
- 155. Minimum stack
- 【云原生】Nacos中的事件发布与订阅--观察者模式
- 实战模拟│JWT 登录认证
- 深度长文探讨Join运算的简化和提速
- 自然语言处理系列(一)入门概述
- RHCSA1
- Why is your next computer a computer? Explore different remote operations
猜你喜欢
Alipay transfer system background or API interface to avoid pitfalls
使用 jMeter 对 SAP Spartacus 进行并发性能测试
从39个kaggle竞赛中总结出来的图像分割的Tips和Tricks
逆波兰表达式
OPPO小布推出预训练大模型OBERT,晋升KgCLUE榜首
Preliminary exploration of basic knowledge of MySQL
CVPR 2022 | 基于稀疏 Transformer 的单步三维目标识别器
Database connection pool & jdbctemplate
A few years ago, I outsourced for four years. Qiu Zhao felt that life was like this
SAP UI5 ObjectPageLayout 控件使用方法分享
随机推荐
Comprehensive upgrade of Taobao short video photosynthetic platform
Kotlin流程控制、循环
Simply take stock reading notes (1/8)
Transactions on December 23, 2021
跨平台(32bit和64bit)的 printf 格式符 %lld 输出64位的解决方式
Docker configures redis and redis clusters
Insmod prompt invalid module format
Redis master-slave configuration and sentinel mode
Kotlin process control and circulation
前几年外包干了四年,秋招感觉人生就这样了..
Lepton 无损压缩原理及性能分析
SAP self-development records user login logs and other information
Taobao short video, why the worse the effect
Taobao order interface | order flag remarks, may be the most stable and easy-to-use interface
Wechat enterprise payment to change access, open quickly
RHCAS6
How do e-commerce sellers refund in batches?
太方便了,钉钉上就可完成代码发布审批啦!
JDBC exercise - query data encapsulated into object return & simple login demo
Transactions from December 27 to 28, 2021