Delete Rental Agreement History

Each time an activity is performed on a rental line or related to a rental line, this creates a record in 'Rental Transaction. Display History' (STS498) which is stored in table STRHIS.

These history records are never deleted automatically, but you can delete them using 'Rental Agreement History. Delete' (STS375). We recommend that you run this program on a regular basis, to avoid large amount of data in this table. One single agreement line can result in many records in this table, for example, created when creating, activating, delivering, terminating, and returning an agreement. Also, any related WO creates records for each activity made.

Before you start

Decide up to which date you want to delete records in this table. In Follow these steps, and the example, you have more information about the basis of deletion.

Follow these steps

Follow these steps to delete records in table STRHIS:
  1. Open 'Rental Agreement History. Delete' (STS375).
  2. Set a start date (optional) and a to date.

    All records in STRHIS with a start date (GTSTAT) and a to date (GTTDAT) within the set range are deleted, if they fulfill the criteria.

    Apart from the records within the set date range, records with a start date equal to 0 are also considered, if the to date in STRHIS is within the date range set in (STS375).

    Records with a to date equal to 0 or 99999999 are also considered, if the start date in STRHIS is within the date range set in (STS375).

    If start date is left blank, both start date and to date in STRHIS is validated against the set to date in (STS375). Records with both start and to date older or equal to the set to date are considered.

    The start date and to date are also displayed in (STS498).

    Criteria for records to be deleted:
    1. For rental agreement records (GTRORC=0):

      If the rental agreement number (GTRORN) on the record in STRHIS no longer exists in (STS100), table STAGHE, the record is deleted in STRHIS.

      If the rental agreement number (GTRORN) on the record in STRHIS exists in (STS100), table STGHE with status equal to 90 or higher, the record is deleted in STRHIS.

    2. For work requests related to rental (GTRORC=6):

      Status 70 in STRHIS indicates that it is a work request, but it can also be status 99.

      If the work request number (GTRORN) on the record in STRHIS no longer exists in (MOS170), table MWOPLP, the record is deleted in STRHIS.

    3. For work orders related to rental (GTRORC=6):

      Status 75 in STRHIS indicates that it is a work request, but it can also be status 99.

      If the work order number (GTRORN) on the record in STRHIS no longer exists in (MOS100), table MMOHED, the record is deleted in STRHIS.

      If the work order number (GTRORN) on the record in STRHIS exists in (MOS100), table MMOHED with a status equal to 90 or higher, the record is deleted in STRHIS.

    4. Records with status 01, created when balance ID for item and serial number are created, are removed without considering RORN.
  3. Confirm in (STS375) with Enter.

    This starts the deletion of selected records.

    'Archiving. Open Toolbox' (AMS100) indicates by status 20 when the job is running and by status 00 when it is completed.

Example

Running (STS375) with this selection: Start date=blank and To date=2021-12-31.

This deletes records with a start date equal to or older than 2021-12-31 if the to date is also equal to or older than 2021-12-31 and if RORN is not active.

Records with a start date 0 are deleted if the to date of the record is older or equal to 2021-12-31. Records with a to date 0 or 99999999 are deleted if the start date of the record is older or equal to 2021-12-31.

Records with a start date 0 are created in STRHIS when WOP is released.

Records with a start and to date 0 are created when the rental agreement line is deleted.

Records with a to date 99999999 are created when balance ID for item or serial number is created, and they have no relation to a reference order number.