A/P预付款请求错误"基本证件卡和目标证件卡不匹配" C#

2020-09-05 07:38发布

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

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


添加文档时出现此错误"基本文档卡和目标文档卡不匹配"

 SAPbobsCOM.Documents oPDPMRequest =(SAPbobsCOM.Documents)fmCo.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseDownPayments);
 如果(oPDPMRequest.GetByKey(int.Parse(FldVal)))

   SAPbobsCOM.Documents oPDPMInvoice =(SAPbobsCOM.Documents)fmCo.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseDownPayments);
                    
  //设置预付款标题值
   oPDPMInvoice.CardCode = oPDPMRequest.CardCode;
   oPDPMInvoice.DocDueDate = DateTime.Now;
   oPDPMInvoice.DownPaymentPercentage = oPDPMRequest.DownPaymentPercentage;
   oPDPMInvoice.VatPercent = oPDPMRequest.VatPercent;
   oPDPMInvoice.DiscountPercent = 0;
   oPDPMInvoice.DocTotal = oPDPMRequest.DocTotal;
   oPDPMInvoice.DocRate = oPDPMRequest.DocRate;
   oPDPMInvoice.GroupNumber = oPDPMRequest.GroupNumber;
   oPDPMInvoice.DeferredTax = oPDPMInvoice.DeferredTax;

 //设置预付款类型
  oPDPMInvoice.DownPaymentType = SAPbobsCOM.DownPaymentTypeEnum.dptInvoice;

 //设置预付款行值
   oPDPMInvoice.Lines.BaseType = 22;
   oPDPMInvoice.Lines.BaseEntry = oPDPMRequest.DocEntry;

    如果(oPDPMInvoice.Add()!= 0)
     {
          Application.SBO_Application.MessageBox(fmCo.GetLastErrorDescription());
          返回;
       }
     其他
       {
         Application.SBO_Application.MessageBox("购买发票[" + fmCo.GetNewObjectKey()+"]已创建!");
       }
     }
 

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

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


添加文档时出现此错误"基本文档卡和目标文档卡不匹配"

 SAPbobsCOM.Documents oPDPMRequest =(SAPbobsCOM.Documents)fmCo.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseDownPayments);
 如果(oPDPMRequest.GetByKey(int.Parse(FldVal)))

   SAPbobsCOM.Documents oPDPMInvoice =(SAPbobsCOM.Documents)fmCo.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseDownPayments);
                    
  //设置预付款标题值
   oPDPMInvoice.CardCode = oPDPMRequest.CardCode;
   oPDPMInvoice.DocDueDate = DateTime.Now;
   oPDPMInvoice.DownPaymentPercentage = oPDPMRequest.DownPaymentPercentage;
   oPDPMInvoice.VatPercent = oPDPMRequest.VatPercent;
   oPDPMInvoice.DiscountPercent = 0;
   oPDPMInvoice.DocTotal = oPDPMRequest.DocTotal;
   oPDPMInvoice.DocRate = oPDPMRequest.DocRate;
   oPDPMInvoice.GroupNumber = oPDPMRequest.GroupNumber;
   oPDPMInvoice.DeferredTax = oPDPMInvoice.DeferredTax;

 //设置预付款类型
  oPDPMInvoice.DownPaymentType = SAPbobsCOM.DownPaymentTypeEnum.dptInvoice;

 //设置预付款行值
   oPDPMInvoice.Lines.BaseType = 22;
   oPDPMInvoice.Lines.BaseEntry = oPDPMRequest.DocEntry;

    如果(oPDPMInvoice.Add()!= 0)
     {
          Application.SBO_Application.MessageBox(fmCo.GetLastErrorDescription());
          返回;
       }
     其他
       {
         Application.SBO_Application.MessageBox("购买发票[" + fmCo.GetNewObjectKey()+"]已创建!");
       }
     }
 
付费偷看设置
发送
1条回答
d56caomao
1楼 · 2020-09-05 08:29.采纳回答

类型错误

 oPDPMInvoice.Lines.BaseType = 204;
  oPDPMInvoice.Lines.BaseLine = 0;
  oPDPMInvoice.Lines.BaseEntry = oPDPMRequest.DocEntry;
 

一周热门 更多>