Skip to Content
0
Former Member
Nov 14, 2012 at 09:12 PM

Query Error With Custom Persistent Class

62 Views

Hi, I am new to OO programming and trying to create a persistent class and call the query manager with parameters. I am getting the error 'The method is implemented in a subclass' as an exception. I created the persistent class ZCL_SOURCE_RECORD off of table EORD which generated actor class ZCA_SOURCE_RECORD and base class ZCB_SOURCE_RECORD. I must have missed something in the setup. Here is my program logic to call the method:

REPORT zptp_source_list.

************************************************************************
* T A B L E S *
************************************************************************
TABLES: eord, usr01.

************************************************************************
* D A T A D E F I N I T I O N *
************************************************************************
DATA: gt_eord TYPE eord_tty,
ft_select TYPE rsparams_tt,
query_mng TYPE REF TO if_os_query_manager,
query_by_eord TYPE REF TO if_os_query,
lt_records TYPE osreftab,
ierr TYPE REF TO cx_root,
agent TYPE REF TO zca_source_record.

FIELD-SYMBOLS <wa_eord>.


************************************************************************
* S E L E C T - O P T I O N S *
* P A R A M E T E R S *
************************************************************************
SELECTION-SCREEN BEGIN OF BLOCK a1.
*SELECT-OPTIONS s_matnr FOR eord-matnr.
*SELECT-OPTIONS s_werks FOR eord-werks.
PARAMETERS p_matnr TYPE eord-matnr.
PARAMETERS p_werks TYPE eord-werks.
SELECT-OPTIONS s_lifnr FOR eord-lifnr.
SELECT-OPTIONS s_erdat FOR eord-erdat.
SELECT-OPTIONS s_ernam FOR eord-ernam.
SELECT-OPTIONS s_vdatu FOR eord-vdatu.
SELECT-OPTIONS s_bdatu FOR eord-bdatu.
SELECT-OPTIONS s_flifn FOR eord-flifn.
SELECT-OPTIONS s_notkz FOR eord-notkz.
SELECTION-SCREEN END OF BLOCK a1.

************************************************************************
* I N I T I A L I Z A T I O N *
************************************************************************
INITIALIZATION.

************************************************************************
* S T A R T - O F - S E L E C T I O N *
************************************************************************
START-OF-SELECTION.

PERFORM get_data.

*&---------------------------------------------------------------------*
*& Form GET_DATA
*&---------------------------------------------------------------------*
* Get data for output
*----------------------------------------------------------------------*

FORM get_data .

agent = zca_source_record=>agent.

TRY.
query_mng = cl_os_system=>get_query_manager( ).
query_by_eord = query_mng->create_query(
i_filter = `MATNR = PAR1 AND WERKS = PAR2` ).

lt_records = agent->if_os_ca_persistency~get_persistent_by_query(
i_query = query_by_eord
i_par1 = p_matnr
i_par2 = p_werks ).

LOOP AT lt_records ASSIGNING <wa_eord>.
ENDLOOP.

CATCH cx_root INTO ierr.
MESSAGE ierr TYPE 'I'.
ENDTRY.

ENDFORM.

Any ideas?

Regards,

Todd