从ABAP到JSON

2020-09-08 08:22发布

点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)您好,我正在尝试转换一个由我自己...

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


您好,我正在尝试转换一个由我自己填写的内部表,该表基于我创建的许多结构和深层结构(SE11)。

阅读此书: https://wiki.scn.sap.com/wiki/display/Snippets/One+more+ABAP+to+JSON+Serializer+and+Deserializer

并使用它:

 LV_JSON =/UI2/CL_JSON => SERIALIZE(DATA = it_main_tb COMPRESS = ABAP_TRUE pretty_name =/ui2/cl_json => pretty_mode-camel_case)。

但不使用camelCase格式化

 lv_json = [{" businesspartnercategory":" 2"," businesspartnergrouping":" ZNAC"," organizationbpname1":"RAZÓNSOCIAL"," organizationbpname2":" A"," organizationbpname3":" B"," organizationbpname4  ":" C"," toBusinesspartneraddress":{" cityname":" SANTIAGO"," country":" CL"," district" ... 

我需要这样:

 {
   " d":{
     " BusinessPartnerCategory":" 2",
     " BusinessPartnerGrouping":" ZNAC",
     " OrganizationBPName1":" RAZON SOCIAL",
     " OrganizationBPName2":" A",
     " OrganizationBPName3":" B",
     " OrganizationBPName4":" C",
     " SearchTerm1":"",
     " to_BusinessPartnerAddress":{
       "结果":[
         {
           " CityName":" SANTIAGO",
           " Country":" CL",
           "区":" 02",
           "语言":" ES",
           "邮政编码":" 8320000",
           " StreetName":" HOLANDA 99",
           " to_EmailAddress":{
             "结果":[
               {
                 " EmailAddress":" email@email.com"
               }
             ]
           }
         }
       ]
     },
 

因此所有" _"都将被删除,并且无法使用cameCase格式化

我的课堂通话怎么了? 有什么想法吗?