当前位置:网站首页>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
边栏推荐
- Pinduoduo flag insertion remarks API
- Didi open source Delta: AI developers can easily train natural language models
- LeetCode20.有效的括号
- Why is your next computer a computer? Explore different remote operations
- What is the difference between Bi software in the domestic market
- RHCSA2
- Taobao flag insertion remarks | logistics delivery interface
- SAP UI5 FlexibleColumnLayout 控件介绍
- 太方便了,钉钉上就可完成代码发布审批啦!
- Four common problems of e-commerce sellers' refund and cash return, with solutions
猜你喜欢

leetcode:221. 最大正方形【dp状态转移的精髓】

About LDA model

SAP SEGW 事物码里的 ABAP Editor

Pinduoduo flag insertion remarks API

非技术部门,如何参与 DevOps?

Talk about my drawing skills in my writing career

SAP UI5 ObjectPageLayout 控件使用方法分享

开发者,云原生数据库是未来吗?

SAP ui5 objectpagelayout control usage sharing

Tips and tricks of image segmentation summarized from 39 Kabul competitions
随机推荐
Didi open source Delta: AI developers can easily train natural language models
stirring! 2022 open atom global open source summit registration is hot!
Simply take stock reading notes (3/8)
CF:A. The Third Three Number Problem【关于我是位运算垃圾这个事情】
逆波兰表达式
LeetCode20.有效的括号
How to connect the API interface of Taobao open platform (super detailed)
SAP SEGW 事物码里的导航属性(Navigation Property) 和 EntitySet 使用方法
[cloud native] use of Nacos taskmanager task management
由扫地增而引起的小叙
leetcode:221. 最大正方形【dp状态转移的精髓】
SAP self-development records user login logs and other information
OPPO小布推出预训练大模型OBERT,晋升KgCLUE榜首
JXL notes
Introduction to sap ui5 dynamicpage control
View and modify the MySQL data storage directory under centos7
Database connection pool & jdbctemplate
Docker configures redis and redis clusters
[cloud native] event publishing and subscription in Nacos -- observer mode
SAP 自开发记录用户登录日志等信息