cancel
Showing results for 
Search instead for 
Did you mean: 

Clear Incoming Payments via API

M_Zimmermann
Explorer
0 Kudos

Hello everybody,

I want to clear incoming cash payments via the Journal Entry - Clearing API on S/4HANA Cloud, but according to this question this isn't working at the moment.

For this reason I wanted to use a workaround but I'm currently stuck.

I want to create a Customer Payment (DZ) via the Journal Entry - Post and the use it to clear the RV journal entry.

The RV journal entry looks like this:

The posting of the journal entry looks like this:

<?xml version="1.0"?><br><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sfin="http://sap.com/xi/SAPSCORE/SFIN"><br>  <soapenv:Header/><br>  <soapenv:Body><br>    <sfin:JournalEntryBulkCreateRequest><br>      <MessageHeader><br>        <ID>MSG_1</ID><br>        <CreationDateTime>2021-12-06T12:00:00Z</CreationDateTime><br>      </MessageHeader><br>      <JournalEntryCreateRequest><br>        <MessageHeader><br>          <ID>MSG_2</ID><br>          <CreationDateTime>2021-12-06T12:00:00Z</CreationDateTime><br>        </MessageHeader><br>        <JournalEntry><br>          <!-- Accounting Document Direct Input --><br>          <OriginalReferenceDocumentType>BKPFF</OriginalReferenceDocumentType><br>          <!-- FI Posting --><br>          <BusinessTransactionType>RFBU</BusinessTransactionType><br>          <!-- Customer Payment --><br>          <AccountingDocumentType>DZ</AccountingDocumentType><br>          <CreatedByUser>TEST_USER</CreatedByUser><br>          <CompanyCode>1010</CompanyCode><br>          <DocumentDate>2021-12-06</DocumentDate><br>          <PostingDate>2021-12-06</PostingDate><br>          <Item><br>            <!-- Bank1 Main Account --><br>            <GLAccount>11001000</GLAccount><br>            <AmountInTransactionCurrency currencyCode="EUR">23.8</AmountInTransactionCurrency><br>            <DebitCreditCode>S</DebitCreditCode><br>            <HouseBank>DEBK1</HouseBank><br>            <HouseBankAccount>DEAC1</HouseBankAccount><br>          </Item><br>          <DebtorItem><br>            <ReferenceDocumentItem>1</ReferenceDocumentItem><br>            <Debtor>1000000</Debtor><br>            <AmountInTransactionCurrency currencyCode="EUR">-23.8</AmountInTransactionCurrency><br>            <DebitCreditCode>H</DebitCreditCode><br>          </DebtorItem><br>        </JournalEntry><br>      </JournalEntryCreateRequest><br>    </sfin:JournalEntryBulkCreateRequest><br>  </soapenv:Body><br></soapenv:Envelope><br>

After the posting of the new journal entry, I'm clearing it like this:

<?xml version="1.0"?><br><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sfin="http://sap.com/xi/SAPSCORE/SFIN"><br>  <soapenv:Header/><br>  <soapenv:Body><br>    <sfin:JournalEntryBulkClearingRequest><br>      <MessageHeader><br>        <ID>MSG_1</ID><br>        <CreationDateTime>2020-06-27T12:00:00.1234567Z</CreationDateTime><br>        <TestDataIndicator>false</TestDataIndicator><br>      </MessageHeader><br>      <JournalEntryClearingRequest><br>        <MessageHeader><br>          <ID>MSG_2</ID><br>          <CreationDateTime>2020-06-27T12:00:00.1234567Z</CreationDateTime><br>        </MessageHeader><br>        <JournalEntry><br>          <CompanyCode>1010</CompanyCode><br>          <!-- currently not sure about the correct one --><br>          <AccountingDocumentType>DZ</AccountingDocumentType><br>          <DocumentDate>2021-12-08</DocumentDate><br>          <PostingDate>2021-12-08</PostingDate><br>          <CurrencyCode>EUR</CurrencyCode><br>          <APARItems><br>            <AccountType>D</AccountType><br>            <!-- Debitor --><br>            <APARAccount>1000000</APARAccount><br>            <FiscalYear>2021</FiscalYear><br>            <!-- RV --><br>            <AccountingDocument>9400000019</AccountingDocument><br>            <AccountingDocumentItem>1</AccountingDocumentItem><br>          </APARItems><br>          <APARItems><br>            <AccountType>D</AccountType><br>            <!-- Debitor --><br>            <APARAccount>1000000</APARAccount><br>            <FiscalYear>2021</FiscalYear><br>            <!-- DZ created via API --><br>            <AccountingDocument>1400000032</AccountingDocument><br>            <AccountingDocumentItem>2</AccountingDocumentItem><br>          </APARItems><br>        </JournalEntry><br>      </JournalEntryClearingRequest><br>    </sfin:JournalEntryBulkClearingRequest><br>  </soapenv:Body><br></soapenv:Envelope><br>

This is working but my problem is that the posted journal entry uses as 11 (credit memo) as posting key but I need 15 (incoming payment):

In this blog is mentioned that the posting key is determined automatically but there is no way to trigger the usage of the posting key 15.

Do you guys have any idea how to solve this issue?

OwenLiu
Product and Topic Expert
Product and Topic Expert
0 Kudos

We helped you to accept the answer, since there were no updates after 7 days.

You can unaccept it anytime if you have further questions.

Accepted Solutions (1)

Accepted Solutions (1)

Javier_del-Peso
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Manuel,

The API documentation states it's for scope items :

Accounting and Financial Close (J58)

Accounting and Financial Close (O58)

So it's not to be used for incoming payments but for GL journal entries. Typically incoming payments will be posted through bank statement, lockbox or manual processing. There's also a cash application app solution with Machine Learning Cash Application with Machine Learning – summary info | SAP Blogs

Regards,

Javier del Peso

Answers (0)