Documentos de Académico
Documentos de Profesional
Documentos de Cultura
*---------------------------------------------------------------------*
* 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.
*$*$ begin of global - insert your declaration only below this line *-*
DATA :
*** for the ZFI_AP_4 of Doc and Company
it_doc1 TYPE TABLE OF ty_doc1,
wa_doc1 TYPE ty_doc1,
*** for the ZLIS02HD of PO
it_doc2 TYPE TABLE OF ty_doc2,
wa_doc2 TYPE ty_doc2,
*** for the ZLIS03BF of Material Doc and Item
it_doc3 TYPE TABLE OF ty_doc3,
wa_doc3 TYPE ty_doc3,
*** for the consignment of Vender
it_doc4 TYPE TABLE OF ty_doc4,
wa_doc4 TYPE ty_doc4,
*** for IR
it_doc5 TYPE TABLE OF ty_doc5,
wa_doc5 TYPE ty_doc5,
*** for GR
it_doc6 TYPE TABLE OF ty_doc6,
wa_doc6 TYPE ty_doc6,
*$*$ end of global - insert your declaration only before this line *-*
METHODS
compute_0CREDITOR
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-CREDITOR
monitor type rstr_ty_t_monitor
RAISING
cx_rsrout_abort
cx_rsrout_skip_record
cx_rsrout_skip_val
cx_rsbk_errorcount.
METHODS
invert_0CREDITOR
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 *
*$*$ end of 2nd part global - insert your code only before this line *
*---------------------------------------------------------------------*
* CLASS routine IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS lcl_transform IMPLEMENTATION.
*----------------------------------------------------------------------*
* Method compute_0CREDITOR
*----------------------------------------------------------------------*
* This subroutine allows the mapping from source to target fields
* of a transformation rule using ABAP for application specific
* coding.
*----------------------------------------------------------------------*
* Customer comment:
*----------------------------------------------------------------------*
METHOD compute_0CREDITOR.
* IMPORTING
* request type rsrequest
* datapackid type rsdatapid
* SOURCE_FIELDS-AC_DOC_NO TYPE /BI0/OIAC_DOC_NO
* SOURCE_FIELDS-COMP_CODE TYPE /BI0/OICOMP_CODE
* SOURCE_FIELDS-ITEM_NUM TYPE /BI0/OIITEM_NUM
* SOURCE_FIELDS-FISCPER TYPE /BI0/OIFISCPER
* SOURCE_FIELDS-AC_DOC_TYP TYPE /BI0/OIAC_DOC_TYP
* SOURCE_FIELDS-ORG_DOC_NO TYPE /BI0/OIORG_DOC_NO
* SOURCE_FIELDS-ORG_DOC_YR TYPE /BI0/OIORG_DOC_YR
* SOURCE_FIELDS-PLANT TYPE /BI0/OIPLANT
* SOURCE_FIELDS-TXTLG TYPE RSTXTLG
* SOURCE_FIELDS-VENDOR TYPE /BI0/OIVENDOR
* SOURCE_FIELDS-DOC_NUM TYPE /BI0/OIDOC_NUM
* SOURCE_FIELDS-/BIC/ZTCODE TYPE /BIC/OIZTCODE
* EXPORTING
* RESULT type _ty_s_TG_1-CREDITOR
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.
IF SOURCE_FIELDS-VENDOR IS INITIAL.
*** for jugde the PI of company
read table IT_ZCOMP_COV into WA_ZCOMP_COV with key
/BIC/ZCOMP_COV = SOURCE_FIELDS-COMP_CODE.
IF sy-subrc = 0.
*** Fetch the ZFI_AP_4 of vender
READ TABLE it_ap ASSIGNING <fs_ap> WITH KEY
AC_DOC_NO = SOURCE_FIELDS-AC_DOC_NO
COMP_CODE = SOURCE_FIELDS-COMP_CODE
binary search.
if sy-subrc = 0.
RESULT = <fs_ap>-CREDITOR.
else.
if sy-subrc = 0.
RESULT = <fs_bf>-vendor.
else.
if sy-subrc = 0.
RESULT = <fs_hd>-VENDOR.
else.
endif.
ENDIF.
ELSE.
RESULT = SOURCE_FIELDS-VENDOR.
ENDIF.
IF RESULT = 'BYD��SH'.
RESULT = 'BYD_SH'.
ENDIF.
*$*$ end of routine - insert your code only before this line *-*
ENDMETHOD. "compute_0CREDITOR
*----------------------------------------------------------------------*
* Inverse method invert_0CREDITOR
*----------------------------------------------------------------------*
* 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_0CREDITOR.