设为首页 收藏本站
查看: 820|回复: 0

[经验分享] Basic SAP Data Types

[复制链接]

尚未签到

发表于 2015-9-18 10:10:58 | 显示全部楼层 |阅读模式
Basic SAP Data Types

6 out of 11 rated this helpful - Rate this topic

  The parameter types that the Microsoft BizTalk Adapter 3.0 for mySAP Business Suite supports are governed by the:

  • ABAP data types that SAP supports
  • Database data types that SAP supports
  This section presents a mapping between the ABAP and database data types, and their corresponding .NET and XML schema types.

NoteThe information in this section applies to RFCs, tRFCs, and BAPIs. SAP data types are always represented as strings (xsd:string) in IDOCs. This is to support the BizTalk Server flat file parser.  
  
  


Supported ABAP Data Types

  The Microsoft BizTalk Adapter 3.0 for mySAP Business Suite supports safe typing for some ABAP data types. When safe typing is enabled, these data types are represented as strings. You configure safe typing by setting the EnableSafeTyping binding property. Safe typing is disabled by default. For more information about the SAP adapter binding properties, see Working with BizTalk Adapter 3.0 for mySAP Business Suite Binding Properties.
  The following table shows how the ABAP data types are surfaced when safe typing is not enabled. (EnableSafeTyping is false). Data types that are surfaced differently when safe typing is enabled are marked with an asterisk (*).

ABAP Data TypeRFC TypeXSD type.NET typeFormat string  I (Integer)
  RFC_INT
  xsd:int
  Int32
  -
  Internal (RFC_INT1)
  RFC_INT1
  xsd:unsignedByte
  Byte
  -
  Internal (RFC_INT2)
  RFC_INT2
  xsd:short
  Int16
  -
  F (Float)
  RFC_FLOAT
  xsd:double
  Double
  -
  P (BCD number)
  RFC_BCD
  xsd:decimal if length <= 28
xsd:string if length > 28
  Decimal
String
  Decimal number. with 0 decimal places
Decimal number. with >0 decimal places
  C (Character)
  RFC_CHAR
  xsd:string
  String
  -
  D (Date: YYYYMMDD)*
  RFC_DATE
  xsd:dateTime
  DateTime
  Internally, the adapter deserializes the value into a DateTime object. It then invokes theDateTime.ToUniversalTime method to convert the value of this object to UTC. Finally the date component (DateTime.Date) is used to create the value that is sent to the SAP system. The SAP system treats this date value as local time.
  You should specify date values as UTC to avoid conversion.

  • For xsd:dateTime, the following pattern is recommended: "(\d\d\d\d-\d\d-\d\d)T(00:00:00)(.*)Z".
  • For DateTime objects set DateTime.Kind to DateTimeKind.Utc.
  T (Time: HHMMSS)*
  RFC_TIME
  xsd:dateTime
  DateTime
  Internally, the adapter deserializes the value into a DateTime object. It then invokes theDateTime.ToUniversalTime method to convert the value of this object to UTC. Finally the time component (DateTime.Time) is used to create the value that is sent to the SAP system. The SAP system treats this time value as local time.
  You should specify time values as UTC to avoid conversion.

  • For xsd:dateTime, the following pattern is recommended: "(0001-01-01)T(\d\d:\d\d:\d\d)(.*)".
  • For DateTime objects set DateTime.Kind to DateTimeKind.Utc.
  For example, if your local time is 9:15 am, express this as "(001-01-01)T(09:15:00)Z"
  N (Numeric string)*
  RFC_NUM
  xsd:int if lenrth <= 9
xsd:long if length > 9 and <= 19
xsd:string if length > 19
  Int32
long
String
  -
  X (Byte)
  RFC_BYTE
  xsd:base64Binary
  Byte[]
  -
  STRING
  RFC_STRING
  xsd:string
  String
  -
  XSTRING
  RFC_BYTE
  xsd:base64Binary
  Byte[]
  -
  *Indicates that the data type is surfaced differently when safe typing is enabled.
Safe Typing Enabled

  The following table shows the ABAP data types that are surfaced differently when safe typing is enabled (the EnableSafeTyping binding property is true).

ABAP Data TypeRFC TypeXSD type.NET typeFormat string  D (Date: YYYYMMDD)
  RFC_DATE
  xsd:string
  String
  SAP date format: YYYYMMDD.
  Characters are allowed for date digits, so the value is essentially an eight character string
  T (Time: HHMMSS)
  RFC_TIME
  xsd:string
  String
  SAP time format: HHMMSS.
  Characters are allowed for time digits, so the value is essentially a six character string
  N (Numeric string)
  RFC_NUM
  xsd:string
  String
  An n character string; where n = length of the numc field.
  ABAP data types that are not in this table are surfaced in the same way as when safe typing is not enabled.
Support for Date and Time Fields

  When safe typing is not enabled, ABAP Date (D) and Time (T) types are surfaced as xsd:dateTime; however, the pattern facet surfaced for the Date and Time types is different.

  • The pattern facet for Date is: (\d\d\d\d-\d\d-\d\d)T(00:00:00)(.*)
    For example, July 7, 2007 (2007-07-07) is represented as:
    (2007-07-07)T(00:00:00).
  • The pattern facet for Time is: (0001-01-01)T(\d\d:\d\d:\d\d)(.*)
    For example, 18:30:30 (6:30 pm and 30 seconds) is represented as:
    (0001-01-01)T(18:30:30).
How does the Adapter Represent Minimum and Maximum Time Values on Inbound Messages (from SAP)?

  The SAP adapter uses the following guidelines when it receives time values from the SAP system:

  • The adapter treats 000000 (hhmmss) and 240000 (hhmmss) as 0 hours, 0 mins, and 0 seconds.


Supported Database Data Types

  The way in which the Microsoft BizTalk Adapter 3.0 for mySAP Business Suite surfaces database data types also depends on whether safe typing is enabled. The following table shows how the adapter surfaces database data types when safe typing is not enabled (the EnableSafeTyping binding property is false). Data types that are surfaced differently when safe typing is enabled are marked with an asterisk (*).

Database Data TypeRFC TypeXSD.NET Type  ACCP (Posting Period)*
  RFC_NUM
  xsd:int
  Int32
  CHAR
  RFC_CHAR
  xsd:string
  String
  CLNT (Client)
  RFC_CHAR
  xsd:string
  String
  CURR (Currency field)
  RFC_BCD
  xsd:decimal



Note
The SAP adapter rounds off the decimal values based on the definition of the DECIMAL parameter. For example, if a DECIMAL parameter can accept up to five digits after the decimal point, a value such as 4.000028 is rounded off to 4.00003.  
  Decimal
  CUKY (Currency Key)
  RFC_CHAR
  xsd:string
  String
  DATS (Date field)*
  RFC_DATE
  xsd:dateTime
  Internally, the adapter deserializes the value into a DateTime object. It then invokes theDateTime.ToUniversalTime method to convert the value of this object to UTC. Finally the date component (DateTime.Date) is used to create the value that is sent to the SAP system. The SAP system treats this date value as local time.
  You should specify date values as UTC to avoid conversion. The following pattern is recommended: "(\d\d\d\d-\d\d-\d\d)T(00:00:00)(.*)Z".
  DateTime
  You should specify date values as UTC (DateTime.Kind = DateTimeKind.Utc) to avoid conversion.
  DEC (Amount)
  RFC_BCD
  xsd:decimal



Note
The SAP adapter rounds off the decimal values based on the definition of the DECIMAL parameter. For example, if a DECIMAL parameter can accept up to five digits after the decimal point, a value such as 4.000028 is rounded off to 4.00003.  
  Decimal
  FLTP (Floating point)
  RFC_FLOAT
  xsd:double
  Double
  INT1
  RFC_INT1
  xsd:unsignedbyte
  Byte
  INT2
  RFC_INT2
  xsd:short
  Int16
  INT4
  RFC_INT
  xsd:int
  Int32
  LANG (Language Key)
  RFC_CHAR
  xsd:string
  String
  LCHR
  RFC_STRING
  xsd:string
  String
  LRAW (long byte seq)
  RFC_BYTE
  xsd:base64binary
  Byte[]
  NUMC*
  RFC_NUM
  xsd:int
xsd:long
xsd:string
  Int32 if length <=9
Int64 if length >9 and <=19
String if length > 19
  PREC (Accuracy)
  RFC_INT2
  xsd:short
  Int16
  QUAN (Quantity)
  RFC_BCD
  xsd:decimal



Note
The SAP adapter rounds off the decimal values based on the definition of the DECIMAL parameter. For example, if a DECIMAL parameter can accept up to five digits after the decimal point, a value such as 4.000028 is rounded off to 4.00003.  
  Decimal
  RAW (byte sequence)
  RFC_BYTE
  xsd:base64binary
  Byte[]
  RAWSTRING (variable length)
  RFC_BYTE
  xsd:base64binary
  Byte[]
  STRING (variable length)
  RFC_STRING
  xsd:string
  String
  TIMS (Time field)*
  RFC_TIME
  xsd:datetime
  Internally, the adapter deserializes the value into a DateTime object. It then invokes theDateTime.ToUniversalTime method to convert the value of this object to UTC. Finally the time component (DateTime.Time) is used to create the value that is sent to the SAP system. The SAP system treats this time value as local time.
  You should specify time values as UTC to avoid conversion. The following pattern is recommended: "(0001-01-01)T(\d\d:\d\d:\d\d)(.*)Z".
  For example, if your local time is 9:15 am, express this as "(001-01-01)T(09:15:00)Z"
  DateTime
  You should specify time values as UTC (DateTime.Kind = DateTimeKind.Utc) to avoid conversion.
  UNIT (Unit for Qty)
  RFC_CHAR
  xsd:string
  String
  [Unsupported]
  --
  --
  String
  *Indicates that the adapter surfaces the data type differently when safe typing is enabled.
Safe Typing Enabled

  The following table shows the database data types that are surfaced differently when safe typing is enabled (the EnableSafeTyping binding property is true).

Database Data TypeRFC TypeXSD.NET typeString Value Format  ACCP (Posting Period)
  RFC_NUM
  xsd:string
  String
  Character string
  NUMC
  RFC_NUM
  xsd:string
  String
  Character string
  DATS (Date field)
  RFC_DATE
  xsd:string
  String
  YYYYMMDD
  TIMS (Time field)
  RFC_TIME
  xsd:string
  String
  HHMMSS
  Data types that are not in this table are surfaced in the same way as when safe typing is not enabled.


Supported XSD Facets

  The SAP adapter supports the following XSD facets.

RFC TypeXSD Facet (EnableSafeTyping = false)XSD Facet (EnableSafeTyping = true)  RFC_BCD
  XSD pattern facet
  Zero decimal places: "([\\-]{0,1})(([0-9]{1," + digitsBeforeDecimal + "}))"
  One or more decimal places: "([\\-]{0,1})(([0-9]{0," + digitsBeforeDecimal + "}\\.[0-9]{0," + digitsAfterDecimal + "})|([0-9]{1," + digitsBeforeDecimal + "}))"
  same
  RFC_NUM
  XSD totalDigits facet if length <=19
  XSD pattern facet if length > 19
  XSD maxLength facet (depends on the length of the value on SAP)
  RFC_DATE
  XSD pattern facet
  "(\d\d\d\d-\d\d-\d\d)T(00:00:00)(.*)"
  Pattern contains time 00:00:00 to be compatible with xsd:datetime
  XSD maxLength facet = 8
  RFC_TIME
  XSD pattern facet
  "(0001-01-01)T(\d\d:\d\d:\d\d)(.*)"
  Pattern contains date 0001-01-01 to be compatible with xsd:datetime
  XSD maxLength facet = 6
  RFC_CHAR
  XSD maxLength facet
  same

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-115246-1-1.html 上篇帖子: 修复被360安全卫士删除的SAP服务 下篇帖子: sap rfc digest
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表