SAP Note 1543274 explains how to extract the Next Possible Contract End Date for each contract.

This information is not stored in the REFX contract tables but is derived from several element such asthe contract end date, the renewal rules and the notice periods.

In theory this calculated date should be the same as the one that is visible in transaction RECN in field. (xxx)

I have implement the SAP Note but I noticed that the extractor derives an incorrect date.

After debugging the extractor I found that at one point in theextractor code all possible end dates since the beginning of the contract are stored in an internal table and then  the 1st date in used for the extraction.

This is incorrect as there are dates that are in the past.

To correct the issue I modified the PERFORM cn_next_end_get in the include file LREIS_MASTERDATA_EXTRACTIONF02 that is called by the extractor to delete from the derived list all dates in the past.

Look for the statement “SORT lt_rnsim BY rnextdate.” and insert a single statement after that.

  SORT lt_rnsim BY rnextdate.

*{   INSERT         DEVK900261                                        1
“Next Possible End Date (simulaiton) does not work as expected
“The result of the simulation contains all end dates since begin of contract
“Thus by selecting the 1st row in the sorted table a date in the past can
“be selected.
“This modification corrects this behaviour by deleting from the table all entries
“where rnextdate is in the past
  delete lt_rnsim where rnextdate < sy-datum.
  READ TABLE lt_rnsim INTO ls_rnsim INDEX 1.

Leave a Reply