Skip to Content
0
Former Member
Sep 13, 2013 at 07:33 PM

E:Statement "ENDMETHOD" missing

611 Views

Dear all,

The code below is generating: E:Statement "ENDMETHOD" missing. which I could not finf how or from where this can be deleted.

Could you give some insight how to go forward and let it work.

Thx.

PROGRAM trans_routine.

*---------------------------------------------------------------------*

* CLASS routine DEFINITION

*---------------------------------------------------------------------*

*

*---------------------------------------------------------------------*

CLASS lcl_transform DEFINITION.

PUBLIC SECTION.

* Attributs

DATA:

p_check_master_data_exist

TYPE RSODSOCHECKONLY READ-ONLY,

*- Instance for getting request runtime attributs;

* Available information: Refer to methods of

* interface 'if_rsbk_request_admintab_view'

p_r_request

TYPE REF TO if_rsbk_request_admintab_view READ-ONLY.

PRIVATE SECTION.

TYPE-POOLS: rsd, rstr.

* Rule specific types

TYPES:

BEGIN OF _ty_s_SC_1,

* InfoObject: 0MATERIAL Malzeme.

MATERIAL TYPE /BI0/OIMATERIAL,

* Field: RECORD.

RECORD TYPE RSARECORD,

END OF _ty_s_SC_1.

TYPES:

BEGIN OF _ty_s_TG_1,

* InfoObject: 0CP_CATEG Kategori.

CP_CATEG TYPE /BI0/OICP_CATEG,

END OF _ty_s_TG_1.

*$*$ begin of global - insert your declaration only below this line *-*

... "insert your code here

DATA: BEGIN OF GS_PROD_HIER,

PROD_HIER TYPE RSD_CHAVL,

PROD_CATEG TYPE RSD_CHAVL,

END OF GS_PROD_HIER,

GTH_PROD_HIER LIKE HASHED TABLE OF GS_PROD_HIER

WITH UNIQUE KEY PROD_HIER.

TYPES: BEGIN OF STRUC_BP_GRP,

BP_GRP TYPE RSD_CHAVL,

CUSTOMER TYPE RSD_CHAVL,

CRM_SALESORG TYPE RSD_CHAVL,

DISTR_CHAN TYPE RSD_CHAVL,

DIVISION TYPE RSD_CHAVL,

R3_SALESORG TYPE RSD_CHAVL,

END OF STRUC_BP_GRP.

DATA: BP_GRP_TAB TYPE SORTED TABLE OF STRUC_BP_GRP

WITH NON-UNIQUE KEY CUSTOMER.

DATA: L_HLP_CHAVL TYPE RSCHAVL.

*$*$ end of global - insert your declaration only before this line *-*

METHODS

compute_0CP_CATEG

IMPORTING

request type rsrequest

datapackid type rsdatapid

SOURCE_FIELDS type _ty_s_SC_1

segid type RSBK_SEGID

EXPORTING

RESULT type _ty_s_TG_1-CP_CATEG

monitor type rstr_ty_t_monitor

RAISING

cx_rsrout_abort

cx_rsrout_skip_record

cx_rsrout_skip_val

cx_rsbk_errorcount.

METHODS

invert_0CP_CATEG

IMPORTING

i_th_fields_outbound TYPE rstran_t_field_inv

i_r_selset_outbound TYPE REF TO cl_rsmds_set

i_is_main_selection TYPE rs_bool

i_r_selset_outbound_complete TYPE REF TO cl_rsmds_set

i_r_universe_inbound TYPE REF TO cl_rsmds_universe

CHANGING

c_th_fields_inbound TYPE rstran_t_field_inv

c_r_selset_inbound TYPE REF TO cl_rsmds_set

c_exact TYPE rs_bool.

ENDCLASS. "routine DEFINITION

*$*$ begin of 2nd part global - insert your code only below this line *

... "insert your code here

*$*$ end of 2nd part global - insert your code only before this line *

*---------------------------------------------------------------------*

* CLASS routine IMPLEMENTATION

*---------------------------------------------------------------------*

*

*---------------------------------------------------------------------*

CLASS lcl_transform IMPLEMENTATION.

*----------------------------------------------------------------------*

* Method compute_0CP_CATEG

*----------------------------------------------------------------------*

* This subroutine allows the mapping from source to target fields

* of a transformation rule using ABAP for application specific

* coding.

*----------------------------------------------------------------------*

* Customer comment:

*----------------------------------------------------------------------*

METHOD compute_0CP_CATEG.

* IMPORTING

* request type rsrequest

* datapackid type rsdatapid

* SOURCE_FIELDS-MATERIAL TYPE /BI0/OIMATERIAL

* EXPORTING

* RESULT type _ty_s_TG_1-CP_CATEG

DATA:

MONITOR_REC TYPE rsmonitor.

*$*$ begin of routine - insert your code only below this line *-*

... "insert your code here

*-- fill table "MONITOR" with values of structure "MONITOR_REC"

*- to make monitor entries

... "to cancel the update process

* raise exception type CX_RSROUT_ABORT.

... "to skip a record"

* raise exception type CX_RSROUT_SKIP_RECORD.

... "to clear target fields

* raise exception type CX_RSROUT_SKIP_VAL.

FORM compute_key_field

TABLES MONITOR STRUCTURE RSMONITOR.

DATA: ABORT LIKE sy-subrc.

DATA: l_prod_categ LIKE RESULT.

DATA: l_matl_group TYPE /bi0/oimatl_group.

DATA: l_material LIKE SOURCE_FIELDS-material.

l_hlp_chavl = SOURCE_FIELDS-material.

IF NOT SOURCE_FIELDS-material IS INITIAL.

CALL FUNCTION 'RSAU_READ_MASTER_DATA'

EXPORTING

i_iobjnm = '0MATERIAL'

i_chavl = l_hlp_chavl

i_attrnm = '0MATL_GROUP'

IMPORTING

e_attrval = l_matl_group

EXCEPTIONS

read_error = 1

no_such_attribute = 2

wrong_import_parameters = 3

chavl_not_found = 4

OTHERS = 5.

CASE sy-subrc.

WHEN 1 OR 2 OR 3 OR 5.

* * Error during read --> Skip whole package

ABORT = 4.

* Copy error message into errorlog

MOVE-CORRESPONDING sy TO MONITOR.

APPEND MONITOR.

WHEN 4.

* Material Group not found

RESULT = space.

ABORT = 0.

WHEN 0.

* Material Group found successful

* Read Product Category for this Material Group

l_hlp_chavl = l_matl_group.

CALL FUNCTION 'RSAU_READ_MASTER_DATA'

EXPORTING

i_iobjnm = '0MATL_GROUP'

i_chavl = l_hlp_chavl

i_attrnm = '0PROD_CATEG'

IMPORTING

e_attrval = l_prod_categ

EXCEPTIONS

read_error = 1

no_such_attribute = 2

wrong_import_parameters = 3

chavl_not_found = 4

OTHERS = 5.

CASE sy-subrc.

WHEN 1 OR 2 OR 3 OR 5.

* * Error during read --> Skip whole package

ABORT = 4.

* Copy error message into errorlog

MOVE-CORRESPONDING sy TO MONITOR.

APPEND MONITOR.

WHEN 0 OR 4.

* Material Group found successful or not found

RESULT = l_prod_categ.

ABORT = 0.

ENDCASE.

ENDCASE.

ELSE.

RESULT = space.

ABORT = 0.

ENDIF.

sy-subrc = 0.

*$*$ end of routine - insert your code only before this line *-*

ENDMETHOD. "compute_0CP_CATEG

*----------------------------------------------------------------------*

* Inverse method invert_0CP_CATEG

*----------------------------------------------------------------------*

* This subroutine needs to be implemented only for direct access

* (for better performance) and for the Report/Report Interface

* (drill through).

* The inverse routine should transform a projection and

* a selection for the target to a projection and a selection

* for the source, respectively.

* If the implementation remains empty all fields are filled and

* all values are selected.

*----------------------------------------------------------------------*

* Customer comment:

*----------------------------------------------------------------------*

METHOD invert_0CP_CATEG.

* IMPORTING

* i_r_selset_outbound TYPE REF TO cl_rsmds_set

* i_th_fields_outbound TYPE HASHED TABLE

* i_r_selset_outbound_complete TYPE REF TO cl_rsmds_set

* i_r_universe_inbound TYPE REF TO cl_rsmds_universe

* CHANGING

* c_r_selset_inbound TYPE REF TO cl_rsmds_set

* c_th_fields_inbound TYPE HASHED TABLE

* c_exact TYPE rs_bool

*$*$ begin of inverse routine - insert your code only below this line*-*

... "insert your code here

*$*$ end of inverse routine - insert your code only before this line *-*

ENDMETHOD. "invert_0CP_CATEG

ENDCLASS. "routine IMPLEMENTATION