如何对XML符合人进行挑选以正确删除数据字段



当通过XSLT读取ABAP内部表字段中的XML内容时,有时无法读取该值或出现异常:在deerialization中中的错误。如果我现在是XML数据类型,如何为ABAP ITAB字段选择正确的数据类型?例如


XML数据类型....... | ....................................................................................................................................


字符串250 ............................................................................................................................................................................................................... | ....................................?


字符串250 .......................................................... yyy-mm-dd .. | .............................................?


字符串250 .................................................. | .date param-4 .... | ..............................?


字符串250 ....................................................................................................................................................................................... | .......................?


字符串250 .....................................................................................................................................................................................................................................................


字符串250 ...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................?


字符串250 .................................................................... number 9(7).................. | ......................


字符串250 ...................................................... number 9(6).............. |。....................


字符串250 .......................................................................................................................................................................................................................................


字符串250 ...................................................... number 9(5)............ |。...................?


字符串250 .............................................................. number d9(2)......... | .....................?


字符串250 ................................................................ number 9(19)......... | .......................?


字符串250 .............................................................. number 9(17)v9(2)| ....................................................................................?


字符串250 ................................................................................... delco价格| ........................................................................?


字符串250 .................................................................... delco金额| .................................................。


字符串250 ...................................................................数量客户发票金额| ......................................................................................................?


字符串250 ............................................................ number param-3 ........... ...................?


请注意

  • xml = version =" 1.0" encoding =" utf-8" standalone =" true"

  • PARM-3 =用字段格式使用的十进制分离器"或"。"

  • PARM-4 =使用字段格式使用的日期格式" dd-mm-yyyy"或" yyyy-mm-dd"

数字格式:

  • 9(x):带有领先零和没有符号的X位整数,例如9(2)" 01"

  • V:隐式十进制位置,例如9(2)V9(2)格式1.1为" 0110"

  • D:PARM-3指定的十进制标记,或者。例如9(2)D9(2)格式1.1为" 01,10"或" 01.10"

  • z:supress领导零,如果负面例如Z9(6)D9(2)" -1.10"

    %:包括百分比字符,例如Z9(2)D9(2)%" 20.00%"

  • delco价格:z9(x)d9(y)y是billingdocument/delivercompany/currencypricingminorunits,x是字段中的剩余数字

  • delco金额:z9(x)d9(y)y是BillingDocument/deliverCompany/Currencyminorunits,X是该领域的剩余数字

  • 客户发票金额:z9(x)d9(y)y是BillingDocument/InvoiceCustomer/Minorunits,X是数量该领域的剩余数字

您如何对XML进行挑选?据我了解,您在XML文件中没有复杂的类型,还是您?

您可以对这两个实际尝试(复杂类型和常规类型):

DATA: xml_utils TYPE REF TO if_ixml.xml_utils = cl_ixml=>create( ).
      xml_stream_factory TYPE REF TO if_ixml_stream_factory.xml_stream_factory = xml_utils->create_stream_factory( ).
DATA: xml_input_stream TYPE REF TO if_ixml_istream.xml_input_stream = xml_stream_factory->create_istream_uri( system_id = 'file://test.xml' ).
DAtA: example_data type z_s_your_structure.
" Deserialize XML 
CALL TRANSFORMATION id 
   SOURCE XML       = xml_input_stream 
   RESULT data_node = example_data.

有关更多信息,您可以检查这些链接,1,2。

相关内容

  • 没有找到相关文章

最新更新