*---------------------------------------------------------------------*
* 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
start_routine
IMPORTING
request type rsrequest
datapackid type rsdatapid
segid type rsbk_segid
EXPORTING
monitor type rstr_ty_t_monitors
CHANGING
SOURCE_PACKAGE type _ty_t_SC_1
RAISING
cx_rsrout_abort
cx_rsbk_errorcount.
METHODS
inverse_start_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 *
*$*$ end of 2nd part global - insert your code only before this line *
*---------------------------------------------------------------------*
* CLASS routine IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS lcl_transform IMPLEMENTATION.
*----------------------------------------------------------------------*
* Method start_routine
*----------------------------------------------------------------------*
* Calculation of source package via start routine
*----------------------------------------------------------------------*
* <-> source package
*----------------------------------------------------------------------*
METHOD start_routine.
*=== Segments ===
FIELD-SYMBOLS:
<SOURCE_FIELDS> TYPE _ty_s_SC_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.
*$*$ 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.
IF sy-subrc = 0.
if <source_fields>-vendor is INITIAL.
*** Fetch FI Doc and company for not consignment
wa_doc1-org_doc_no = <source_fields>-ac_doc_no.
wa_doc1-comp_code = <source_fields>-comp_code.
APPEND wa_doc1 TO it_doc1.
CLEAR wa_doc1.
wa_doc5-org_doc_yr = <source_fields>-org_doc_yr.
wa_doc5-org_doc_no = <source_fields>-org_doc_no.
APPEND wa_doc5 TO it_doc5.
CLEAR wa_doc5.
endif.
ELSE.
*** Fetch FI Doc and company for not consignment
if <source_fields>-vendor is INITIAL.
wa_doc1-org_doc_no = <source_fields>-ac_doc_no.
wa_doc1-comp_code = <source_fields>-comp_code.
APPEND wa_doc1 TO it_doc1.
CLEAR wa_doc1.
wa_doc5-org_doc_yr = <source_fields>-org_doc_yr.
wa_doc5-org_doc_no = <source_fields>-org_doc_no.
APPEND wa_doc5 TO it_doc5.
CLEAR wa_doc5.
ELSE.
wa_doc3-org_doc_no = <source_fields>-/bic/zuonr+4(10).
wa_doc3-org_doc_yr = <source_fields>-/bic/zuonr+14(4).
wa_doc3-doc_item = <source_fields>-txtlg(6).
APPEND wa_doc3 TO it_doc3.
CLEAR wa_doc3.
ENDIF.
else.
*** fetch not consignment
IF <source_fields>-AC_DOC_TYP = 'WE' OR
<source_fields>-AC_DOC_TYP = 'WL' and <source_fields>-DOC_NUM
is not initial .
wa_doc2-org_doc_no = <source_fields>-DOC_NUM.
APPEND wa_doc2 TO it_doc2.
CLEAR wa_doc2.
ENDIF.
endif.
ENDIF.
"ȡ���Ƿ����߹�Ӧt�ж� hzg 2015-5-18
*else.
*
* delete SOURCE_PACKAGE index i_tabix.
*
*endif.
ENDLOOP.
ENDIF.
IF it_doc5 IS NOT INITIAL.
EXCEPTIONS
name_error = 1
input_invalid = 2
OTHERS = 3
.
IF sy-subrc <> 0.
ENDIF.
endif.
EXCEPTIONS
name_error = 1
input_invalid = 2
OTHERS = 3
.
IF sy-subrc <> 0.
ENDIF.
endif.
*$*$ end of routine - insert your code only before this line *-*
ENDMETHOD. "start_routine
*----------------------------------------------------------------------*
* Inverse method inverse_start_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.
*----------------------------------------------------------------------*
* Customer comment:
*----------------------------------------------------------------------*
METHOD inverse_start_routine.