Skip to Content
0
Former Member
Sep 11, 2007 at 12:35 PM

Please help - Transformation Question - End Routine

181 Views

Hi Experts,

I have the following code below and I get the following error when I try to save the routine

Error Message:

E:At "LOOP AT itab" one of the additions "INTO", "ASSIGNING" or "TRANSPORTING NO FIELDS" is required in the OO context. in the OO context.

I am trying to read Master data attribute CSM_RCOD from 0DPM_DCAS. Also, I was wondering if I had declared the variables at the right place.

Thanks in advance.

Regards,

bw_newbie

End Routine Code:

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 tys_TG_1,

  • InfoObject: 0DPM_DCAS Dispute Case Key.

DPM_DCAS TYPE /BI0/OIDPM_DCAS,

  • InfoObject: 0CSM_CHTI Changed At (Time Stamp).

CSM_CHTI TYPE /BI0/OICSM_CHTI,

  • InfoObject: 0DPM_STAT Item Status.

DPM_STAT TYPE /BI0/OIDPM_STAT,

  • InfoObject: 0COMP_CODE Company code.

COMP_CODE TYPE /BI0/OICOMP_CODE,

  • InfoObject: 0AC_DOC_NO Accounting document number.

AC_DOC_NO TYPE /BI0/OIAC_DOC_NO,

  • InfoObject: 0ITEM_NUM Number of line item within accounting docum

*ent.

ITEM_NUM TYPE /BI0/OIITEM_NUM,

  • InfoObject: 0FISCVARNT Fiscal year variant.

FISCVARNT TYPE /BI0/OIFISCVARNT,

  • InfoObject: 0DEBITOR Customer number.

DEBITOR TYPE /BI0/OIDEBITOR,

  • InfoObject: 0CURRENCY Currency Key.

CURRENCY TYPE /BI0/OICURRENCY,

  • InfoObject: 0CREDITOR Account number of supplier/vendor.

CREDITOR TYPE /BI0/OICREDITOR,

  • InfoObject: 0CUSTOMER Customer number.

CUSTOMER TYPE /BI0/OICUSTOMER,

  • InfoObject: 0DPM_CRAA Amount Credited.

DPM_CRAA TYPE /BI0/OIDPM_CRAA,

  • InfoObject: 0DPM_CURA Disputed Amount.

DPM_CURA TYPE /BI0/OIDPM_CURA,

  • InfoObject: 0DPM_PAIA Amount Paid.

DPM_PAIA TYPE /BI0/OIDPM_PAIA,

  • InfoObject: 0DPM_ORIA Original Disputed Amount.

DPM_ORIA TYPE /BI0/OIDPM_ORIA,

  • InfoObject: 0DPM_AUTA Amount Written Off Automatically.

DPM_AUTA TYPE /BI0/OIDPM_AUTA,

  • InfoObject: 0DPM_MANA Amount Cleared Manually.

DPM_MANA TYPE /BI0/OIDPM_MANA,

  • InfoObject: 0FISCPER Fiscal year / period.

FISCPER TYPE /BI0/OIFISCPER,

  • InfoObject: 0DPM_KOAR Partner Type.

DPM_KOAR TYPE /BI0/OIDPM_KOAR,

  • InfoObject: 0CSM_RCOD Reason.

CSM_RCOD TYPE /BI0/OICSM_RCOD,

  • InfoObject: 0CSM_TYPE Case Type.

CSM_TYPE TYPE /BI0/OICSM_TYPE,

  • InfoObject: 0CSM_ESCA Escalation Reason.

CSM_ESCA TYPE /BI0/OICSM_ESCA,

  • InfoObject: 0CSM_RESP Person Responsible.

CSM_RESP TYPE /BI0/OICSM_RESP,

  • Field: RECORD.

RECORD TYPE RSARECORD,

END OF tys_TG_1.

TYPES:

tyt_TG_1 TYPE STANDARD TABLE OF tys_TG_1

WITH NON-UNIQUE DEFAULT KEY.

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

... "insert your code here

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

METHODS

end_routine

IMPORTING

request type rsrequest

datapackid type rsdatapid

EXPORTING

monitor type rstr_ty_t_monitors

CHANGING

RESULT_PACKAGE type tyt_TG_1

RAISING

cx_rsrout_abort.

METHODS

inverse_end_routine

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

TYPES: BEGIN OF struct1.

INCLUDE STRUCTURE /BI0/PDPM_DCAS.

TYPES END OF struct1.

DATA: ITAB1 TYPE STANDARD TABLE OF STRUCT1

WITH HEADER LINE

WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.

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

----


  • CLASS routine IMPLEMENTATION

----


*

----


CLASS lcl_transform IMPLEMENTATION.

----


  • Method end_routine

----


  • Calculation of result package via end routine

  • Note: All not overwritten field values within the routine

  • are transferred from the corresponding source fields. This

  • means, all fields not supplied by the transformation source

  • are send with initial values to the transformation target.

----


  • <-> result package

----


METHOD end_routine.

*=== Segments ===

FIELD-SYMBOLS:

<RESULT_FIELDS> TYPE tys_TG_1.

DATA:

MONITOR_REC TYPE rstmonitor.

*$*$ 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.

  • TYPES: BEGIN OF struct1.

  • INCLUDE STRUCTURE /BI0/PDPM_DCAS.

  • TYPES END OF struct1.

  • DATA: ITAB11 TYPE STANDARD TABLE OF STRUCT1

  • WITH HEADER LINE

  • WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.

SELECT * FROM /BI0/PDPM_DCAS INTO CORRESPONDING FIELDS OF TABLE

ITAB1 WHERE OBJVERS = 'A' .

LOOP AT RESULT_PACKAGE.

READ TABLE ITAB1 WITH KEY /BI0/OIDPM_DCAS =

RESULT_PACKAGE-/BI0/OIDPM_DCAS.

IF SY-SUBRC EQ 0.

RESULT_PACKAGE-/BI0/OICSM_RCOD = ITAB1-/BI0/OICSM_RCOD.

ENDIF.

MODIFY RESULT_PACKAGE.

ENDLOOP.

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

ENDMETHOD. "end_routine

----


  • Method inverse_end_routine

----


*

  • 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.

*

----


*

----


METHOD inverse_end_routine.

$$ 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. "inverse_end_routine

ENDCLASS. "routine IMPLEMENTATION