CL_DBSEL_CATS - Data Selection for Work Time Sheet (CATS/CATSXT)

BAL Application Log Documentation   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.

Functionality

This class is used for selecting working time data in the CATSDB format (classic time sheet) and CATSXT_WA (time sheet for service providers).

This class is particularly aimed at providing CATS data for reporting in conjunction with the logical database PNPCE. It can also be used as a standalone solution.

The CATS data is selected in the GET_TIME_SHEET_DATA method for one or more personnel numbers.

Selection conditions for the CATS data selection can be provided in two different ways:

  1. Transfer in the constructer using the IM_SELECTION_CRITERIA parameter.
  2. The calling report contains an INCLUDE CATS_REPORT_MANAGER statement.This include contains the definition of a selection screen with selection criteria for the CATSDB table.

    When an object in this class is created, the constructer automatically gets the selection conditions that were entered on the selection screen.

    However, to enable this, the IM_SELECTION_CRITERIA parameter must be blank.

    The CATS_REPORT_MANAGER include also contains all the required data declarations for the use of this class.

Example

RCATS_DISPLAY_ACTIVITIES.

RCATSXT_DISPLAY_ACTIVITIES.
* Reports use the logical database PNP.

include cats_report_manager.

FORM INITIALIZATION.
* Fill field selection tab if only certain catsdb fields are required
* call method gr_report->add_to_field_selection
* exporting
* im_fieldname = 'PERNR'.

* call method gr_report->add_to_field_selection
* exporting
* im_fieldname = 'WORKDATE'
* im_last_field = 'X'.
ENDFORM.

FORMT START_OF_SELECTION.
* Object constructor retrieves selection criteria from the selection
* screen and prepares for DB selection
create object gr_dbsel.
exporting
im_calling_program = sy-repid.
* im_field_selection = gr_report->field_selection_tab.
ENDFORM.

FORM GET_PERSA.
* collect all relevant personnel numbers
append persa-pernr to pernr_sel_tab.
ENDFORM.

FORM END_OF_SELECTION.
* Get CATS data
call method gr_dbsel->get_time_sheet_data
exporting
im_personnel_number_tab = pernr_sel_tab
importing
ex_catsxt_data = catsxt_tab
ex_catsdb_data = catsdb_tab
ex_docflow = docflow_tab.

perform write_catsxt_data using catsxt_tab.
ENDFORM.

Further information

See also the documentation on the methods:

CONSTRUCTOR and

GET_TIME_SHEET_DATA


SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up   ABAP Short Reference  
This documentation is copyright by SAP AG.


Length: 3342 Date: 20120526 Time: 133257     triton ( 73 ms )