There are scenarios where we might need to create settlement dynamically when a payment journal is created. As we are aware, SpecTrans is the table which is used for this requirement. This post gives an overview of the fields that are needed when this table is used for marking settlement.
As a first step, for our requirement a new payment journal is created with corresponding values. So how do we populate the values in SpecTrans which marks the settlement?This is where the fields SpecTransRecid/SpecTransTableId plays a role. These fields are mapped with the values of Tableid and RecId of the LedgerJournalTrans where the settlement is marked.
What is the use of the field RefRecid/RefTableId? In our scenario, the invoice and the actual settle amount are referred from the table CustTransOpen (from the relation CustTrans). So these fields have the values of TableId and RecId of CustTransOpen.
The field Balance01 denotes the amount that is being settled. If there is partial settlement , then this field has the value of settled amount.
Given below the code snippet which is used for Customer settlement.