通过服务层更新订单时查询语法错误

2020-09-13 10:33发布

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

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


嗨,

我可以通过服务层创建销售订单,但是当我尝试更新它时,会收到以下响应:

 {
    "错误":{
       "代码":-1000,
       "信息" : {
          " lang":" zh-cn",
          " value":"错误的请求-查询语法错误。"
       }
    }
 } 

我不知道我在做什么错。 你能指出我正确的方向吗?

我要发布到/Orders('68006')(PATCH)的JSON是:

 {
   " DocEntry":68006,
   " DocNum":1871012959,
   " DocDate":" 2018-09-20",
   " DocDueDate":" 2018-09-20",
   " CardCode":" C000020432",
   " CardName":" Sebastiaan Kortleven",
   " NumAtCard":" H1O634952BE",
   " DocTotal":76.9,
   " DocCurrency":" EUR",
   "注释": "",
   " TransportationCode":17
   "已确认":" tNO",
   "联邦税号": "",
   " DiscountPercent":0.0,
   " VatSum":0.0,
   "语言代码":16
   "总折扣":-76.9,
   " DocumentLines":[
     {
       " LineNum":0,
       " ItemCode":" V000271292",
       " ItemDescription":" Acuvue Vita(6 lenzen)",
       "数量":1.0,
       " ShipDate":" 2018-09-20",
       "价格":0.0,
       " PriceAfterVAT":29.5,
       " DiscountPercent":0.0,
       " WarehouseCode":" DROPSHIP",
       " AccountCode":" 700520",
       " VatGroup":" 21V",
       " BaseType":-1,
       " LineTotal":0.0,
       " VisualOrder":0,
       "单价":0.0,
       " LineStatus":" bost_Open",
       " LineType":" dlt_Regular",
       " RemainingOpenQuantity":1.0,
       " U_PHCtrBTW":"确定",
       " U_LOCBE_IS_ORIGCTR":"",
       " U_LOCBE_IS_TRANSAC":" 1",
       " U_LOCBE_IS_TRANSPO":" 3",
       " U_LOCBE_IS_TERMDEL":" EXW",
       " U_BECC_AcctName":"",
       " U_BasePriceExclSP":" 0",
       " U_BasePriceInclSP":" 0",
       " U_PackageID":"",
       " U_PackageName":"",
       " U_PONeeded":" Y",
       " U_LineReference":"",
       " U_ParentAccount":"",
       " U_BINAbsEntry":"",
       " U_SPPriceList":"",
       " U_SPCode":"",
       " U_WebLineNum":" 10",
       " U_FreeTxt":" Acuvue Vita",
       " U_EYE":" OD"
     },
     {
       " LineNum":1
       " ItemCode":" V000271201",
       " ItemDescription":" Acuvue Vita(6 lenzen)",
       "数量":1.0,
       " ShipDate":" 2018-09-20",
       "价格":0.0,
       " PriceAfterVAT":29.5,
       " DiscountPercent":0.0,
       " WarehouseCode":" DROPSHIP",
       " AccountCode":" 700520",
       " VatGroup":" 21V",
       " BaseType":-1,
       " LineTotal":0.0,
       " VisualOrder":1
       "单价":0.0,
       " LineStatus":" bost_Open",
       " LineType":" dlt_Regular",
       " RemainingOpenQuantity":1.0,
       " U_PHCtrBTW":"确定",
       " U_LOCBE_IS_ORIGCTR":"",
       " U_LOCBE_IS_TRANSAC":" 1",
       " U_LOCBE_IS_TRANSPO":" 3",
       " U_LOCBE_IS_TERMDEL":" EXW",
       " U_BECC_AcctName":"",
       " U_BasePriceExclSP":" 0",
       " U_BasePriceInclSP":" 0",
       " U_PackageID":"",
       " U_PackageName":"",
       " U_PONeeded":" Y",
       " U_LineReference":"",
       " U_ParentAccount":"",
       " U_BINAbsEntry":"",
       " U_SPPriceList":"",
       " U_SPCode":"",
       " U_WebLineNum":" 20",
       " U_FreeTxt":" Acuvue Vita",
       " U_EYE":" OS"
     },
     {
       " LineNum":2
       " ItemCode":" L000000158",
       " ItemDescription":" ClearVision多用途解决方案6 maanden(3x350ml)",
       "数量":1.0,
       " ShipDate":" 2018-09-20",
       "价格":0.0,
       " PriceAfterVAT":24.0,
       " DiscountPercent":0.0,
       " WarehouseCode":" DROPSHIP",
       " AccountCode":" 700520",
       " VatGroup":" 21V",
       " BaseType":-1,
       " LineTotal":0.0,
       " VisualOrder":2
       "单价":0.0,
       " LineStatus":" bost_Open",
       " LineType":" dlt_Regular",
       " RemainingOpenQuantity":1.0,
       " U_PHCtrBTW":"确定",
       " U_LOCBE_IS_ORIGCTR":"",
       " U_LOCBE_IS_TRANSAC":" 1",
       " U_LOCBE_IS_TRANSPO":" 3",
       " U_LOCBE_IS_TERMDEL":" EXW",
       " U_BECC_AcctName":"",
       " U_EYE":"",
       " U_BasePriceExclSP":" 0",
       " U_BasePriceInclSP":" 0",
       " U_PackageID":"",
       " U_PackageName":"",
       " U_PONeeded":" Y",
       " U_LineReference":"",
       " U_ParentAccount":"",
       " U_BINAbsEntry":"",
       " U_SPPriceList":"",
       " U_SPCode":"",
       " U_WebLineNum":" 30",
       " U_FreeTxt":" ClearVision多用途解决方案6个月"
     },
     {
       " ItemCode":" CARTRULE",
       "数量":-1.0,
       "价格":0.0,
       " PriceAfterVAT":10.0,
       " DiscountPercent":0.0,
       " WarehouseCode":" DROPSHIP",
       " AccountCode":" 708520",
       " VatGroup":" 21V",
       " LineTotal":0.0,
       "单价":0.0,
       " U_FreeTxt":" Maandlenzen + ClearVision vloeistof",
       " U_PackageID":" mc_rule_1",
       " U_PONeeded":" N"
     },
     {
       " ItemCode":"运输",
       "数量":1.0,
       "价格":0.0,
       " PriceAfterVAT":3.9,
       " DiscountPercent":0.0,
       " WarehouseCode":" DROPSHIP",
       " AccountCode":" 703520",
       " VatGroup":" 21V",
       " LineTotal":0.0,
       "单价":0.0,
       " U_PONeeded":" N"
     }
   ],
   " AddressExtension":{
     " ShipToStreet":" Naamsesteenweg",
     " ShipToStreetNo":" 248",
     " ShipToCity":" Heverlee",
     " ShipToZipCode":" 3001",
     " ShipToCountry":" BE",
     " BillToStreet":" Naamsesteenweg",
     " BillToStreetNo":" 248",
     " BillToCity":" Heverlee",
     " BillToZipCode":" 3001",
     " BillToCountry":" BE"
   },
   " U_LOCBE_NW":"",
   " U_OrderStatus":" N",
   " U_VoucherId":"",
   " U_OrderNum":"",
   " U_VOUCHERCODE":"",
   " U_OrderDate":"",
   " U_SecTrspInfo":"",
   " U_SecTrspID":"",
   " U_IsDelivered":"",
   " U_DlnNr":"",
   " U_COR_BW_FromDate":"",
   " U_COR_BW_ToDate":"",
   " U_TrackURL":"",
   " U_ShippingDate":"",
   " U_Company":"",
   " U_InvAddrRemark":"",
   " U_TrackBarcode":"",
   " U_IntRemark":"",
   " U_InvoiceRemark":"",
   " U_Remark":"",
   " U_PaidExternally":" N",
   " U_Mutualiteit":"",
   " U_SSN":"",
   " U_CreatedOnPC":"",
   " U_ContactEmail":"",
   " U_ContactPhone":"",
   " U_SubscriptionNr":"",
   " U_FiscRep_VAT":"",
   " U_CancelDate":"",
   " U_CanBeDelivered":" N",
   " U_MailCustomer":" Y",
   " U_OrigCustomer":"",
   " U_Afdeling":"",
   " U_Origin":" U",
   " U_LOCBE_IS_INTRREL":" N",
   " U_LOCBE_FIN":" N",
   " U_WebID":" 634152",
   " U_Site":" hana.123optic.com",
   " U_InCommission":" Y",
   " U_PayedBy":" 0",
   " U_PayMethodID":" 7000",
   " U_ContactPerson":" Sebastiaan Kortleven",
   " U_PayMethod":"超架",
   " U_IsPaid":" N",
   " U_UsedBalance":" 0",
   " U_ToPay":" 76.9",
   " U_PONeeded":" Y"
 }
 


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

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


嗨,

我可以通过服务层创建销售订单,但是当我尝试更新它时,会收到以下响应:

 {
    "错误":{
       "代码":-1000,
       "信息" : {
          " lang":" zh-cn",
          " value":"错误的请求-查询语法错误。"
       }
    }
 } 

我不知道我在做什么错。 你能指出我正确的方向吗?

我要发布到/Orders('68006')(PATCH)的JSON是:

 {
   " DocEntry":68006,
   " DocNum":1871012959,
   " DocDate":" 2018-09-20",
   " DocDueDate":" 2018-09-20",
   " CardCode":" C000020432",
   " CardName":" Sebastiaan Kortleven",
   " NumAtCard":" H1O634952BE",
   " DocTotal":76.9,
   " DocCurrency":" EUR",
   "注释": "",
   " TransportationCode":17
   "已确认":" tNO",
   "联邦税号": "",
   " DiscountPercent":0.0,
   " VatSum":0.0,
   "语言代码":16
   "总折扣":-76.9,
   " DocumentLines":[
     {
       " LineNum":0,
       " ItemCode":" V000271292",
       " ItemDescription":" Acuvue Vita(6 lenzen)",
       "数量":1.0,
       " ShipDate":" 2018-09-20",
       "价格":0.0,
       " PriceAfterVAT":29.5,
       " DiscountPercent":0.0,
       " WarehouseCode":" DROPSHIP",
       " AccountCode":" 700520",
       " VatGroup":" 21V",
       " BaseType":-1,
       " LineTotal":0.0,
       " VisualOrder":0,
       "单价":0.0,
       " LineStatus":" bost_Open",
       " LineType":" dlt_Regular",
       " RemainingOpenQuantity":1.0,
       " U_PHCtrBTW":"确定",
       " U_LOCBE_IS_ORIGCTR":"",
       " U_LOCBE_IS_TRANSAC":" 1",
       " U_LOCBE_IS_TRANSPO":" 3",
       " U_LOCBE_IS_TERMDEL":" EXW",
       " U_BECC_AcctName":"",
       " U_BasePriceExclSP":" 0",
       " U_BasePriceInclSP":" 0",
       " U_PackageID":"",
       " U_PackageName":"",
       " U_PONeeded":" Y",
       " U_LineReference":"",
       " U_ParentAccount":"",
       " U_BINAbsEntry":"",
       " U_SPPriceList":"",
       " U_SPCode":"",
       " U_WebLineNum":" 10",
       " U_FreeTxt":" Acuvue Vita",
       " U_EYE":" OD"
     },
     {
       " LineNum":1
       " ItemCode":" V000271201",
       " ItemDescription":" Acuvue Vita(6 lenzen)",
       "数量":1.0,
       " ShipDate":" 2018-09-20",
       "价格":0.0,
       " PriceAfterVAT":29.5,
       " DiscountPercent":0.0,
       " WarehouseCode":" DROPSHIP",
       " AccountCode":" 700520",
       " VatGroup":" 21V",
       " BaseType":-1,
       " LineTotal":0.0,
       " VisualOrder":1
       "单价":0.0,
       " LineStatus":" bost_Open",
       " LineType":" dlt_Regular",
       " RemainingOpenQuantity":1.0,
       " U_PHCtrBTW":"确定",
       " U_LOCBE_IS_ORIGCTR":"",
       " U_LOCBE_IS_TRANSAC":" 1",
       " U_LOCBE_IS_TRANSPO":" 3",
       " U_LOCBE_IS_TERMDEL":" EXW",
       " U_BECC_AcctName":"",
       " U_BasePriceExclSP":" 0",
       " U_BasePriceInclSP":" 0",
       " U_PackageID":"",
       " U_PackageName":"",
       " U_PONeeded":" Y",
       " U_LineReference":"",
       " U_ParentAccount":"",
       " U_BINAbsEntry":"",
       " U_SPPriceList":"",
       " U_SPCode":"",
       " U_WebLineNum":" 20",
       " U_FreeTxt":" Acuvue Vita",
       " U_EYE":" OS"
     },
     {
       " LineNum":2
       " ItemCode":" L000000158",
       " ItemDescription":" ClearVision多用途解决方案6 maanden(3x350ml)",
       "数量":1.0,
       " ShipDate":" 2018-09-20",
       "价格":0.0,
       " PriceAfterVAT":24.0,
       " DiscountPercent":0.0,
       " WarehouseCode":" DROPSHIP",
       " AccountCode":" 700520",
       " VatGroup":" 21V",
       " BaseType":-1,
       " LineTotal":0.0,
       " VisualOrder":2
       "单价":0.0,
       " LineStatus":" bost_Open",
       " LineType":" dlt_Regular",
       " RemainingOpenQuantity":1.0,
       " U_PHCtrBTW":"确定",
       " U_LOCBE_IS_ORIGCTR":"",
       " U_LOCBE_IS_TRANSAC":" 1",
       " U_LOCBE_IS_TRANSPO":" 3",
       " U_LOCBE_IS_TERMDEL":" EXW",
       " U_BECC_AcctName":"",
       " U_EYE":"",
       " U_BasePriceExclSP":" 0",
       " U_BasePriceInclSP":" 0",
       " U_PackageID":"",
       " U_PackageName":"",
       " U_PONeeded":" Y",
       " U_LineReference":"",
       " U_ParentAccount":"",
       " U_BINAbsEntry":"",
       " U_SPPriceList":"",
       " U_SPCode":"",
       " U_WebLineNum":" 30",
       " U_FreeTxt":" ClearVision多用途解决方案6个月"
     },
     {
       " ItemCode":" CARTRULE",
       "数量":-1.0,
       "价格":0.0,
       " PriceAfterVAT":10.0,
       " DiscountPercent":0.0,
       " WarehouseCode":" DROPSHIP",
       " AccountCode":" 708520",
       " VatGroup":" 21V",
       " LineTotal":0.0,
       "单价":0.0,
       " U_FreeTxt":" Maandlenzen + ClearVision vloeistof",
       " U_PackageID":" mc_rule_1",
       " U_PONeeded":" N"
     },
     {
       " ItemCode":"运输",
       "数量":1.0,
       "价格":0.0,
       " PriceAfterVAT":3.9,
       " DiscountPercent":0.0,
       " WarehouseCode":" DROPSHIP",
       " AccountCode":" 703520",
       " VatGroup":" 21V",
       " LineTotal":0.0,
       "单价":0.0,
       " U_PONeeded":" N"
     }
   ],
   " AddressExtension":{
     " ShipToStreet":" Naamsesteenweg",
     " ShipToStreetNo":" 248",
     " ShipToCity":" Heverlee",
     " ShipToZipCode":" 3001",
     " ShipToCountry":" BE",
     " BillToStreet":" Naamsesteenweg",
     " BillToStreetNo":" 248",
     " BillToCity":" Heverlee",
     " BillToZipCode":" 3001",
     " BillToCountry":" BE"
   },
   " U_LOCBE_NW":"",
   " U_OrderStatus":" N",
   " U_VoucherId":"",
   " U_OrderNum":"",
   " U_VOUCHERCODE":"",
   " U_OrderDate":"",
   " U_SecTrspInfo":"",
   " U_SecTrspID":"",
   " U_IsDelivered":"",
   " U_DlnNr":"",
   " U_COR_BW_FromDate":"",
   " U_COR_BW_ToDate":"",
   " U_TrackURL":"",
   " U_ShippingDate":"",
   " U_Company":"",
   " U_InvAddrRemark":"",
   " U_TrackBarcode":"",
   " U_IntRemark":"",
   " U_InvoiceRemark":"",
   " U_Remark":"",
   " U_PaidExternally":" N",
   " U_Mutualiteit":"",
   " U_SSN":"",
   " U_CreatedOnPC":"",
   " U_ContactEmail":"",
   " U_ContactPhone":"",
   " U_SubscriptionNr":"",
   " U_FiscRep_VAT":"",
   " U_CancelDate":"",
   " U_CanBeDelivered":" N",
   " U_MailCustomer":" Y",
   " U_OrigCustomer":"",
   " U_Afdeling":"",
   " U_Origin":" U",
   " U_LOCBE_IS_INTRREL":" N",
   " U_LOCBE_FIN":" N",
   " U_WebID":" 634152",
   " U_Site":" hana.123optic.com",
   " U_InCommission":" Y",
   " U_PayedBy":" 0",
   " U_PayMethodID":" 7000",
   " U_ContactPerson":" Sebastiaan Kortleven",
   " U_PayMethod":"超架",
   " U_IsPaid":" N",
   " U_UsedBalance":" 0",
   " U_ToPay":" 76.9",
   " U_PONeeded":" Y"
 }
 


付费偷看设置
发送
2条回答
当学会了学习
1楼 · 2020-09-13 11:09.采纳回答

塞巴斯蒂安你好,

您不需要订单实体的单引号。 DocEntry是数字的,因此您的PATCH必须是这样的:

/Orders(68006)

在发布问题之前,请尝试查看https://address:50000/Service%20Layer%20API%20Reference.html上的文档,那里已经有很清楚的描述:

顺便说一句,这是一个PATCH请求,而不是PUT。 如果只想更新几个属性,则无需发布整个对象。 在PATCH中,仅显示在正文中的信息将被更新,其他属性不会受到影响。

haha101010
2楼-- · 2020-09-13 11:11

非常感谢!

一周热门 更多>

点击此处---> EasySAP.com 一起学习S4 HANA ...

相关问答