on 2024 Jul 30 3:12 AM
首先於SAP介面上建立客戶發票(DR),建立後取得日記帳分錄為1800000008
接著欲使用API「Journal Entry – Clearing (Asynchronous)」達成類似在「過帳收款」頁面的沖帳行為,將部分金額11000結清轉入銀存11030002:
這邊先簡單化,先不考慮手續費問題:
使用官方文件 的Sample Payload for Partial Clearing,參數改成目前測試環境的。
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sfin="http://sap.com/xi/SAPSCORE/SFIN">
<soapenv:Header/>
<soapenv:Body>
<sfin:JournalEntryBulkClearingRequest>
<MessageHeader>
<ID>MSG_20240715_Partial</ID>
<CreationDateTime>2024-07-15T11:00:00.1234567Z</CreationDateTime>
<TestDataIndicator>false</TestDataIndicator>
</MessageHeader>
<JournalEntryClearingRequest>
<MessageHeader>
<ID>MSG_20240715_01</ID>
<CreationDateTime>2024-07-15T11:00:00.1234567Z</CreationDateTime>
<TestDataIndicator/>
</MessageHeader>
<JournalEntry>
<CompanyCode>FIVE</CompanyCode>
<AccountingDocumentType>DZ</AccountingDocumentType>
<DocumentDate>2024-07-15</DocumentDate>
<PostingDate>2024-07-15</PostingDate>
<CurrencyCode>TWD</CurrencyCode>
<DocumentHeaderText>Clearing API</DocumentHeaderText>
<CreatedByUser>5STAR API</CreatedByUser>
<APARItems>
<ReferenceDocumentItem>2</ReferenceDocumentItem>
<CompanyCode>FIVE</CompanyCode>
<AccountType>D</AccountType>
<APARAccount>1000000</APARAccount>
<FiscalYear>2024</FiscalYear>
<AccountingDocument>1800000008</AccountingDocument>
<AccountingDocumentItem>1</AccountingDocumentItem>
<PartialPaymentAmtInDspCrcy currencyCode="TWD">11000</PartialPaymentAmtInDspCrcy>
</APARItems>
</JournalEntry>
</JournalEntryClearingRequest>
</sfin:JournalEntryBulkClearingRequest>
</soapenv:Body>
</soapenv:Envelope>
API回傳錯誤訊息如下: 「交易貨幣 TWD 11,000 中的餘額過大無法自動更正」
此問題我認為是沒帶入銀存account,所以修改一下參數,加入GLItems 將銀行總帳科目帶入。
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sfin="http://sap.com/xi/SAPSCORE/SFIN">
<soapenv:Header/>
<soapenv:Body>
<sfin:JournalEntryBulkClearingRequest>
<MessageHeader>
<ID>MSG_20240715_Partial</ID>
<CreationDateTime>2024-07-15T11:00:00.1234567Z</CreationDateTime>
<TestDataIndicator>false</TestDataIndicator>
</MessageHeader>
<JournalEntryClearingRequest>
<MessageHeader>
<ID>MSG_20240715_01</ID>
<CreationDateTime>2024-07-15T11:00:00.1234567Z</CreationDateTime>
<TestDataIndicator/>
</MessageHeader>
<JournalEntry>
<CompanyCode>FIVE</CompanyCode>
<AccountingDocumentType>DZ</AccountingDocumentType>
<DocumentDate>2024-07-15</DocumentDate>
<PostingDate>2024-07-15</PostingDate>
<CurrencyCode>TWD</CurrencyCode>
<DocumentHeaderText>Clearing API</DocumentHeaderText>
<CreatedByUser>5STAR API</CreatedByUser>
<GLItems>
<ReferenceDocumentItem>1</ReferenceDocumentItem>
<CompanyCode>FIVE</CompanyCode>
<GLAccount>11030002</GLAccount>
<FiscalYear>2024</FiscalYear>
<AccountingDocument>1800000008</AccountingDocument>
<AccountingDocumentItem>1</AccountingDocumentItem>
</GLItems>
<APARItems>
<ReferenceDocumentItem>2</ReferenceDocumentItem>
<CompanyCode>FIVE</CompanyCode>
<AccountType>D</AccountType>
<APARAccount>1000000</APARAccount>
<FiscalYear>2024</FiscalYear>
<AccountingDocument>1800000008</AccountingDocument>
<AccountingDocumentItem>1</AccountingDocumentItem>
<PartialPaymentAmtInDspCrcy currencyCode="TWD">11000</PartialPaymentAmtInDspCrcy>
</APARItems>
</JournalEntry>
</JournalEntryClearingRequest>
</sfin:JournalEntryBulkClearingRequest>
</soapenv:Body>
</soapenv:Envelope>
先不考慮GLItems沒有提供Amount欄位可以輸入金額的問題,我以為她會將DR的11000自動帶入借方銀存科目。
結果得到如下錯誤訊息: 帳戶0011030002中沒有未結項目的管理
問題總結:
SAP Community 相關問題連結:
以下補充實際需求,需考慮手續費問題:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
8 | |
8 | |
7 | |
4 | |
4 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.