Ansicht
Dokumentation

EXIT_RELARCH_ANALYSE_EABL_001 - User Exit for Analysis of Meter Reading Results

EXIT_RELARCH_ANALYSE_EABL_001 - User Exit for Analysis of Meter Reading Results

Addresses (Business Address Services)   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

You can use this user exit to define your own routines to check whether print document lines can be archived.

Table XYT_ERDK contains the header data of the print documents. Report REPDAR_ANALYSE_LINES considers the lines in this table to be archiveable (retention period expired, document printed, and so on).

If you want to exclude print document lines from archiving as the result of your own checks, delete the corresponding entry from table XYT_ERDK.

Example

A retention period of 90 days has been defined for print document lines in Customizing. However, you want a retention period of 180 days (starting from the creation date) to apply to certain contract accounts that are stored in a customer-defined table (Z_PRDOCL_VKONT) hinterlegt sind, soll die Verweildauer jedoch bei 180 Tagen, bezogen auf das Erstellungsdatum liegen:

*.. Data definition
  TABLES: z_prdocl_vkont.

  DATA: v_sy_date       LIKE sy-datum,
        v_comp_date     LIKE sy-datum,
        v_unit_day      LIKE t006-msehi,
        wa_prdocl_vkont LIKE z_prdocl_vkont,
        wa_erdk         like erdk,
        i_prdocl_vkont  LIKE z_prdocl_vkont occurs 0.

*.. Determine SI unit for day configured in R/3 System
  CALL FUNCTION 'TIME_UNITS'
    IMPORTING
      day             = v_unit_day
    EXCEPTIONS
      si_unit_missing = 1
      others          = 2.

*.. Calculate comparison date
  v_sy_date = sy-datum.
  CALL FUNCTION 'START_TIME_DETERMINE'
    EXPORTING
      duration   = '90'
      unit       = v_unit_day
    IMPORTING
      start_date = v_comp_date
    CHANGING
      end_date   = v_sy_date
    EXCEPTIONS
      others = 1.

*.. Determine contract accounts for which longer retention period
*.. should apply
  SELECT * INTO TABLE i_prdocl_vkont FROM z_prdocl_vkont.

*.. Check whether print document headers can be archived
  LOOP AT xyt_erdk INTO wa_erdk.
    READ TABLE i_prdocl_vkont INTO wa_prdoch_vkont
                              WITH KEY vkont = wa_erdk-vkont.
    IF sy-subrc = 0.
*... Contract acct exists in exception table; Check whether extended
*... retention period has also expired
      IF wa_erdk-erdat > v_comp_date.
*.... Retention period still valid, print document lines cannot
*.... be archived yet
        DELETE xyt_erdk.
      ENDIF. "IF wa_erdk-erdat > v_comp_date
    ENDIF. "IF sy-subrc = 0
  ENDLOOP. "LOOP AT xyt_erdk INTO wa_erdk

Notes

Save your coding in Include file ZXE26AU01.





Parameters

STOP_DATE

Exceptions

Function Group

XE26A

ABAP Short Reference   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.

Length: 4491 Date: 20240604 Time: 002824     sap01-206 ( 38 ms )