End Routine
End 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.
*$*$ 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
new_record__end_routine
IMPORTING
source_segid type rstran_segid
source_record type sytabix
EXPORTING
record_new type sytabix.
METHODS
end_routine
IMPORTING
request type rsrequest
datapackid type rsdatapid
segid type rsbk_segid
EXPORTING
monitor type rstr_ty_t_monitors
CHANGING
RESULT_PACKAGE type _ty_t_TG_1
RAISING
cx_rsrout_abort
cx_rsbk_errorcount.
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
*$*$ 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: Update of target fields depends on rule assignment in
* transformation editor. Only fields that have a rule assigned,
* are updated to the data target.
*----------------------------------------------------------------------*
* <-> result package
*----------------------------------------------------------------------*
METHOD end_routine.
*=== Segments ===
FIELD-SYMBOLS:
<RESULT_FIELDS> TYPE _ty_s_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.
*********************************************************
* edwsl001 acts as feeder source ~25 copybooks
* additional rows are inserted for applicants and co-applicants
* partner functions are determined to avoid selects
* generate external ids for applicant, product and application
* filter existing products
* fill commonly used objects to minimize selects
* all applications which have reached atleast select offer
**********************************************************
BEGIN OF ty_cb_hdr,
/bic/cmdscbid TYPE /bic/oicmdscbid,
bp_guid TYPE /bi0/oibp_guid,
createdon TYPE /bi0/oicreatedon,
END OF ty_cb_hdr,
BEGIN OF ty_fsq_item,
crm_itmgui TYPE /bi0/oicrm_itmgui,
crm_ohguid TYPE /bi0/oicrm_ohguid,
crm_prod TYPE /bi0/oicrm_prod,
crm_itmtyp TYPE /bi0/oicrm_itmtyp,
crm_objtyp TYPE /bi0/oicrm_objtyp,
/bic/cmdshlpan TYPE /bic/oicmdshlpan,
/bic/cmdsmtgan TYPE /bic/oicmdsmtgan,
/bic/cmdsmtgsn TYPE /bic/oicmdsmtgsn,
END OF ty_fsq_item,
BEGIN OF ty_prodcount,
/bic/cmdsextap TYPE /bic/oicmdsextap,
pcount TYPE i,
END OF ty_prodcount.
" 'BUS2000114'.
*** get other partners
SELECT *
FROM /bic/aquothl0600
INTO TABLE gt_transit
FOR ALL ENTRIES IN RESULT_PACKAGE
WHERE crm_ohguid = RESULT_PACKAGE-crm_ohguid
AND crm_objtyp = zif_bi_rep_constants=>obj_ty-fsquotation
AND ( /bic/cmdsbufct =
zif_bi_rep_constants=>ptnr_fct-booking_trans
OR /bic/cmdsbufct = zif_bi_rep_constants=>ptnr_fct-adjudicator
OR /bic/cmdsbufct =
zif_bi_rep_constants=>ptnr_fct-mortg_specialist )
AND /bic/cmdsmapa = abap_true.
SELECT
bpartner
bp_guid
/bic/cmdssrfno
FROM /bic/acmdsil0300
INTO TABLE gt_srfno
FOR ALL ENTRIES IN gt_quo_ptnr
WHERE bp_guid = gt_quo_ptnr-bp_guid.
ENDIF.
SELECT *
FROM /bic/acmdsil4700
INTO TABLE gt_collateral
FOR ALL ENTRIES IN RESULT_PACKAGE
WHERE crm_ohguid = RESULT_PACKAGE-crm_ohguid
AND /bic/cmdsobtyp = zif_bi_casper_consts=>object_ty-asset.
"'ASSET'.
ENDIF.
IF sy-subrc NE 0.
EXIT.
ENDIF.
**** Get all partners of quotation
LOOP AT gt_quo_partner ASSIGNING <quo_partner> FROM sy-tabix.
IF <quo_partner>-crm_ohguid NE <result_fields>-crm_ohguid.
EXIT.
ENDIF.
<data>-bp_guid = <quo_partner>-bp_guid.
<data>-bpartner = <quo_partner>-/bic/cmdsptf.
<data>-/bic/cmdsmapa = <quo_partner>-/bic/cmdsmapa.
**** get credit bureau header
READ TABLE gt_cb_hdr ASSIGNING <cb_hdr>
WITH KEY bp_guid = <quo_partner>-bp_guid
BINARY SEARCH.
IF sy-subrc = 0.
<data>-/bic/cmdscbid = <cb_hdr>-/bic/cmdscbid.
ENDIF.
** fill external id for applicants and application
READ TABLE gt_app_ext_id ASSIGNING <app_ext_id>
WITH KEY /bic/cmdsriden =
zif_bi_rep_constants=>ty_ext-applicant
/bic/cmdsmguid = <data>-bp_guid
crm_cskey = <result_fields>-csm_case
BINARY SEARCH.
IF sy-subrc = 0.
<data>-/bic/cmdsextbp = <app_ext_id>-/bic/cmdsextap.
ENDIF.
IF sy-subrc = 0.
<data>-/bic/cmdsextap = <app_ext_id>-/bic/cmdsextap.
ENDIF.
CLEAR: <data>-/bic/cmdsextap,<data>-/bic/cmdsextbp,
<data>-/bic/cmdsfpgui,<data>-/bic/cmdscbid,
<data>-bp_guid,<data>-bpartner.
IF <fsq_item>-crm_ohguid NE <result_fields>-crm_ohguid.
EXIT.
ENDIF.
<data>-crm_itmgui = <fsq_item>-crm_itmgui.
<data>-crm_prod = <fsq_item>-crm_prod.
<data>-crm_itmtyp = <fsq_item>-crm_itmtyp.
<data>-crm_objtyp = <fsq_item>-crm_objtyp.
<data>-/bic/cmdshlpan = <fsq_item>-/bic/cmdshlpan.
<data>-/bic/cmdsmtgsn = <fsq_item>-/bic/cmdsmtgsn.
<data>-/bic/cmdsmtgan = <fsq_item>-/bic/cmdsmtgan.
*$*$ end of routine - insert your code only before this line *-*
ENDMETHOD. "end_routine
*----------------------------------------------------------------------*
* Inverse 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.
*----------------------------------------------------------------------*
* Customer comment:
*----------------------------------------------------------------------*
METHOD inverse_end_routine.
* 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. "inverse_end_routine
METHOD new_record__end_routine.
ENDMETHOD.
ENDCLASS. "routine IMPLEMENTATION