使用SAP B1 Service Layer创建Incoming payment时遇G/L account无效错误
SAP B1 Service Layer创建收款单报错排查:G/L account is not valid
通过SAP B1 Service Layer创建Incoming Payment时,收到如下错误:
G/L account is not valid [PaymentAccounts.AccountCode][line: 1]
请求JSON原文:
{ "DocType": "rAccount", "DueDate": "2023-03-31", "DocDate": "2023-03-31", "ProjectCode": "005", "BPLID": 1, "JournalRemarks": "APL APLIC AUT MAIS", "HandWritten": "tNO", "Printed": "tNO", "LocalCurrency": "tNO", "SplitTransaction": "tNO", "ApplyVAT": "tNO", "CurrencyIsLocal": "tNO", "Proforma": "tNO", "IsPayToBank": "tNO", "PaymentPriority": "bopp_Priority_6", "PaymentType": "bopt_None", "CashAccount": "1.01.01.01.01", "CashSum": 28709.6, "PaymentAccounts": { "AccountCode": "1.01.01.02.34", "SumPaid": 28709.6, "GrossAmount": 28709.6 } }
排查与解决步骤
修正
PaymentAccounts的结构
SAP B1 Service Layer要求PaymentAccounts是数组类型,而非单个对象。原JSON中直接用{}包裹单个科目,系统无法正确解析,需改为[]数组格式。验证科目编码有效性
- 确认
1.01.01.02.34科目在SAP B1客户端【科目表】中存在,注意编码的分隔符、大小写完全匹配; - 检查该科目是否属于请求中指定的
BPLID=1公司代码,SAP B1科目按公司分配,跨公司科目无法使用; - 确保科目处于激活状态,未被冻结或停用。
- 确认
确认科目类型合规
PaymentAccounts对应的科目必须是客户统驭科目(用于核销应收账款),不能使用现金类或其他非统驭科目。若选错科目类型,系统会判定科目无效。
修正后的示例JSON
{ "DocType": "rAccount", "DueDate": "2023-03-31", "DocDate": "2023-03-31", "ProjectCode": "005", "BPLID": 1, "JournalRemarks": "APL APLIC AUT MAIS", "HandWritten": "tNO", "Printed": "tNO", "LocalCurrency": "tNO", "SplitTransaction": "tNO", "ApplyVAT": "tNO", "CurrencyIsLocal": "tNO", "Proforma": "tNO", "IsPayToBank": "tNO", "PaymentPriority": "bopp_Priority_6", "PaymentType": "bopt_None", "CashAccount": "1.01.01.01.01", "CashSum": 28709.6, "PaymentAccounts": [ { "AccountCode": "1.01.01.02.34", "SumPaid": 28709.6, "GrossAmount": 28709.6 } ] }
内容的提问来源于stack exchange,提问作者Guilherme Luzin
相关产品推荐
相关产品推荐

