Anda di halaman 1dari 3

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: 0LOC_CURRCY Moneda local. LOC_CURRCY TYPE /BI0/OILOC_CURRCY, * InfoObject: 0EXRATEXACC Tipo cambio de moneda exacto p.contabiliz *aciones FI. EXRATEXACC TYPE /BI0/OIEXRATEXACC, * InfoObject: 0DOC_CURRCY Moneda del documento. DOC_CURRCY TYPE /BI0/OIDOC_CURRCY, * InfoObject: 0KNVAL Valor de la condicin. KNVAL TYPE /BI0/OIKNVAL, * Field: RECORD. RECORD TYPE RSARECORD, END OF _ty_s_SC_1. TYPES: BEGIN OF _ty_s_TG_1, * InfoObject: ZPASUBREP Resultado de Subreparto. /BIC/ZPASUBREP TYPE /BIC/OIZPASUBREP, END OF _ty_s_TG_1. *$*$ 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 compute_ZPASUBREP IMPORTING request datapackid SOURCE_FIELDS *-*

type rsrequest type rsdatapid type _ty_s_SC_1

EXPORTING RESULT type _ty_s_TG_1-/BIC/ZPASUBREP monitor type rstr_ty_t_monitor RAISING cx_rsrout_abort cx_rsrout_skip_record cx_rsrout_skip_val. METHODS invert_ZPASUBREP 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 *************************************************************** * Clases condicin de COSTO VENTAS, variables temporales *************************************************************** DATA: CLASE_CONDICION TYPE STANDARD TABLE OF /BIC/MZPACLCND WITH HEADER LINE . DATA: BEGIN OF COSTO_VENTAS OCCURS 0, CHRT_ACCTS TYPE /BIC/MZPACLCND-CHRT_ACCTS, /BIC/ZPACLCND TYPE /BIC/MZPACLCND-/BIC/ZPACLCND, OBJVERS TYPE /BIC/MZPACLCND-OBJVERS, CHANGED TYPE /BIC/MZPACLCND-CHANGED, /BIC/ZPARECUR TYPE /BIC/MZPACLCND-/BIC/ZPARECUR, /BIC/ZPAINDIC TYPE /BIC/MZPACLCND-/BIC/ZPAINDIC, END OF COSTO_VENTAS . *$*$ end of 2nd part global - insert your code only before this line *---------------------------------------------------------------------* * CLASS routine IMPLEMENTATION *---------------------------------------------------------------------* * *---------------------------------------------------------------------* CLASS lcl_transform IMPLEMENTATION. METHOD compute_ZPASUBREP. * * * * * * IMPORTING request type rsrequest datapackid type rsdatapid SOURCE_FIELDS-LOC_CURRCY TYPE /BI0/OILOC_CURRCY SOURCE_FIELDS-EXRATEXACC TYPE /BI0/OIEXRATEXACC SOURCE_FIELDS-DOC_CURRCY TYPE /BI0/OIDOC_CURRCY *

* * *

SOURCE_FIELDS-KNVAL TYPE /BI0/OIKNVAL EXPORTING RESULT type _ty_s_TG_1-/BIC/ZPASUBREP 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. *0LOC_CURRENCY Moneda local *0EXRATE_ACC Tp.cambio *0KNVAL Valor condicin *0DOC_CURRCY Moneda doc. * Conversin a moneda local IF SOURCE_FIELDS-DOC_CURRCY <> SOURCE_FIELDS-LOC_CURRCY. RESULT = SOURCE_FIELDS-EXRATEXACC * SOURCE_FIELDS-KNVAL. ELSE. RESULT = SOURCE_FIELDS-KNVAL. ENDIF.

*$*$ end of routine - insert your code only before this line *-* ENDMETHOD. "compute_ZPASUBREP *----------------------------------------------------------------------* * Method invert_ZPASUBREP *----------------------------------------------------------------------* * * 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 invert_ZPASUBREP. *$*$ 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. ENDCLASS. "invert_ZPASUBREP "routine IMPLEMENTATION