/
Creating cancellation commission based on source document invoice

Creating cancellation commission based on source document invoice

Creating cancellation commission based on source document invoice

Functional Requirements

The trigger for the creation of a cancellation commission based on source document cancellation invoice, is the standard message handling of an invoice – like the normal commission / invoice.

The main difference between creation of a normal commission and creation of a cancellation commission is, that cancellation commission must be connected to the original commission. So, during creation the cancellation commission determines the original commission based on information in the invoice field VBRK-SFAKN (Cancelled Bill.Doc.). When the original commission is determined, the cancellation commission is created depending on the case based on the values of the original commission and the status of the original commission maybe will be changed.

During the creation processing also here defined values are taken from the settings and the source documents (invoice, VSS order, vehicle). But especially the commission values are not calculated new by formula builder. To ensure, that commission value result is 100% like the original commission, they are transferred “1:1” from the original commission. So the following main values are taken from original commission:

  • Commission date
  • All entries of commission participant table
  • All entries of the commission calculation table


Also, if these entries are copied from original commission most likely “1:1”, there could be small differences, because creation of cancellation commission must happen case depended, based on the actual status of the original commission.

  • Case A: Original commission is up to now not transferred to HR – “is open”
    • Commission date is copied 1:1; this is relevant because of “steering meaning” concerning the check of the employee’s validity
    • Partner entries are copied 1:1, just the flag “calculation relevant” always will be initial and the administration data will be updated with actual values
    • Calculation entries are copied 1:1, just the administration data will be updated with actual values
    • Status of the cancellation commission will be directly set to the target status of business operation CRCA (or function module logic) which should be a status from type “canceled”
    • Status of the original commission will be changed to the target status of business operation CANC (or function module logic) which should be a status from type “canceled”


  • The objective is that cancellation commission has the same value results, both commissions are no longer changeable and both commissions are not relevant for the transferred to HR


  • Case B: Original commission is already transferred to HR – “is in HR”
    • Commission date is copied 1:1; this is relevant because of “steering meaning” concerning the check of the employee’s validity
    • Partner entries are copied 1:1, just the administration data will be updated with actual values
    • Calculation entries are copied 1:1, just the posting information will be cleared and the administration data will be updated with actual values
    • Status of the cancellation commission will be directly set to the target status of business operation CRCA (or function module logic), which should be a status from type “ready to transfer to HR”
    • Status of the original commission will not be changed and so still is from type “already transferred to HR”
  • The objective is that cancellation commission has same value results, cancellation commission in best case should be no longer changeable, cancellation commission will be ready for transfer to HR and original commission is not changed in any way


Note

The values on data base level are also for cancellation commission stored always “positive” (okay, if there is negative value from original, this is also negative in commission). These values are also shown always “positive” at the screens. So, when implementing BAdI for the HR transfer you have to take care, that you multiply them by “-1” based on case commission / cancellation commission.


So, the header information of a cancellation commission most likely is similar to a normal commission. There is just an additional checkbox, showing that it is a cancellation.

Create cancelation commission - detail view

Concerning the register / table “conditions” also for cancellation commission nothing happens during the automatically creation. Register and table are initial empty.

Create cancelation commission - register “conditions”

Concerning the register / table “participants”, we have case depended the situation described above.

  • Case A: Original commission is up to now not transferred to HR – “is open”
Create cancelation commission - register “participants” in case original commission is still open
  • Case B: Original commission is already transferred to HR – “is in HR”
Create cancelation commission - register “participants” in case original commission is already transferred

Concerning the register / table “price/commission”, we should see the same information like in the original commission (because of copy all entries of commission calculation table 1:1.

Create cancelation commission - register “price/commission”

Note

Because the design of the HTML view will be defined customer individual by using own elements with own structures and own BAdI logic, we can’t ensure that we will see here always 1:1 the same information like in original commission. So, during creation of the HTML view (elements/structures/BAdI) you should always keep in mind, that also the cancellation case should show same information.

Note

Because in some cases the cancellation commission also has to update the original commission, the original commission must be changeable during cancellation commission creation. If this is not possible (e.g. original is locked by a user) the processing of the cancellation invoice message fails and must be reprocessed


Create cancelation commission - log in case of error