Show TOC

 Creating Correspondence Histories

Use

You want to offer an application-specific correspondence history.

Prerequisites

The prerequisites for creating and outputting correspondence requests are met.

You created application-specific events for your application, as described in Display of the Correspondence History .

Procedure

  1. Define a class that you derive from the abstract class CL_FKK_CORR_DISP_HISTORY_DBA. This makes it possible for the system to read the data for the history from the database according to the selection conditions, and to modify the data to requirements of the application and format the data for display. You can create this derived class as either a local or global class. Using the PREPARE_HISTORY method, which you have to redefine, you format the data of the history in accordance with the requirements of the application.

  2. In your program for displaying the correspondence history, create an instance for managing the data of the history. This is done by calling the S_CREATE static method, of the above class. When doing so, you have to enter the type of this class and the type of the internal table for saving the formatted correspondence history. For a global class, the type of the class is the same as the name of the class. For a local class, the type is created using the following rule: \PROGRAM=programname\CLASS=classname , where the programname is the name of the program in which you created the local class, classname .

  3. By calling the SET_PARAMETERS method, set the parameters for limiting the selection of data from the database. Select the data by calling the IF_FKK_CORR_DISP_HISTORY_DBA~SELECT method.

    Calling the IF_FKK_CORR_DISP_HISTORY_DBA~GET_REF_TO_HISTORY method returns a reference to the internal table with the formatted data of the correspondence history. This can be used, for example, to check if the table has contents.

  4. Create an instance of the CL_FKK_CORR_DISPLAY_HISTORY class for managing a correspondence history, and enter the type of the class for managing the data in the I_CLASSTYPE_DB_ACCESS parameter. You can thereby display the data saved in the instance as a correspondence history. In addition, a function for refreshing the display is thereby offered in the correspondence history. When this function is triggered, the data is again read from the database, formatted, and displayed, while taking into account the selection parameters that were entered.

    Using the REGISTER_COMMAND method, you can remove standard functions of the correspondence history, adjust functions to the needs of the application, and add new, application-specific functions.

  5. By calling the FKK_CORR_DISPLAY_HISTORY_ALV function module, you can now display the saved data, with the functions adjusted to the application, in the form of a correspondence history. You can reference the instance for managing the correspondence history by using the I_RCL_DISPLAY_HISORY parameter. You enter the name of the program using the I_REPID parameter. The layout of the ALV list is stored under this name. This ensures that it is possible to manage different layouts for correspondence histories of different applications.

    Sequence Diagram 6: Displaying Correspondence History Based on Example

Result

The end user can display a correspondence history that is tailored to the particular application.

Example

Report RFKKCORR_DISPLAY_HISTORY shows a correspondence history that was implemented based on the procedure outlined above. The report shows all correspondence containers stored in the system, regardless of the application.

The derivation of the abstract class CL_FKK_CORR_DISP_HISTORY_DBA is entered as local class CL_DB_ACCESS. The name of the class in this case is \PROGRAM=RFKKCORR_DISPLAY_HISTORY\CLASS=CL_DB_ACCESS .

The Set Date of Receipt and Set Deferral Date functions are not offered. Correspondence recipients can be displayed only in the business partner role Business Partner General .