Beruflich Dokumente
Kultur Dokumente
Applies to:
SAP BI 7.0 consultants having knowledge in SAP CRM 5.0 / SAP CRM 7.0. For more information, visit the
EDW homepage
Summary
This document specifies the detailed understanding for reconciling the SAP CRM Installed base data with the
SAP BW datasource 0CRM_SRV_IBASE_ATTR - CRM Installed Base Master Data (dataSource).
Author:
Suraj Tigga
Author Bio
Suraj Tigga is a Senior SAP BI / ABAP consultant at Capgemini Consulting, India. Suraj joined
Capgemini Consulting in 2008 and has worked on multiple SAP BI implementation and support
Projects.
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
Table of Contents
Scenario .............................................................................................................................................................. 3
Step-by-Step Solution ..................................................................................................................................... 3
Data Flow (CRM- BI) Installed Base ......................................................................................................................... 3
Reconciliation ABAP Code (Logic) ............................................................................................................................ 4
Execution ................................................................................................................................................................... 12
ABAP Code (Complete) ............................................................................................................................................. 15
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
Scenario
Oftentimes SAP CRM-BW projects has to face situations to reconcile the loaded to SAP BI from CRM .Since
no standard reports are available in SAP CRM which reconcile the CRM data to the data loaded to SAP BI .
This article focalizes to reconcile SAP CRM Installed Base data with the BW datasource
(0CRM_SRV_IBASE_ATTR - CRM IBase Master Data (DataSource)), which is further loaded to DSO
0CRM_IBCO (Installed Bases and Components).It primarily concentrates to create ABAP report which
focuses to get the relevant Installed Base data and then reconciling the report data (Can be schedules in
Background) with the BI report built on DSO 0CRM_IBCO.
Step-by-Step Solution
Complete solution is explained in three steps:
Data Flow (CRM-BI) Installed Base: Explains briefly about CRM Installed Base and their database tables.
Reconciliation ABAP Code (Logic): Briefly explains the flow logic of the ABAP code, with the display in
the ABAP report.
Execution: Executing the ABAP report in background. Further reconcile the BI BEx report data with ABAP
report data.
Text Item-Assign a text item as an installed base as a component, in which manual defining of short
text is possible
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
Room A01
Location 1
PC_010
Location 2
PC_022
Location 3
PC_125
Room A02
PC_010
Location 1
PC_010
Room B01
PC_010
Copier
ABC
201
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
Step 1: Go to transaction IB53 (Display Installed Base).Look for installed base 3618:
Component(Instance)
Superior Component
3619
3619
3621
3621
3623
3623
3625
3619
3619
3626
3619
3619
3628
3619
3619
3630
3619
3619
While mentioning all the following steps, I would consider the above installed base 3618.
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
Step 2: Selection Screen (Report Reconciliation (Installed Base CRM and BI))
Code:
selection-screen begin of block b1 with frame title text-001 .
* Selection screen input fields for Input
select-options:
s_ibase for ibib-ibase modif id op2 . " Installed Base
selection-screen end of block b1.
Step3: Retrieve the relevant installed base and installed base component details from
the applicable database tables:
Function Module
CRM_IBASE_GET_DETAIL
Objnr (Export Parameter) =
product_guid
Function Module
CRM_IBASE_GET_
PARTNER
COMM_IL_PRDBP (Master
Data of Relationship Type Partner)
IB_GUID_16 = REFGUID
DESTINGUID = PARTNER_GUID
CDBD_IBPART
General Data)
PARTNER = PARTNER
REF_PARTNER_NO =
PARTNER_GUID
ADDRNUMBER = ADDRNUMBER
ADRC (Addresses)
COMM_PRODUCT (Product)
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
Fetch all the relevant partner and address details for the components:
* Retrieve the product details
SELECT sourceguid
destinguid
link_partner_fct
FROM comm_il_prdbp
INTO TABLE t_comm_il_prdbp
FOR ALL ENTRIES IN t_source_guid
WHERE sourceguid EQ t_source_guid-objnr.
IF sy-subrc EQ 0.
* Retrieve Business partner values
SELECT partner
partner_guid
FROM
but000
INTO TABLE tl_but000_c
FOR ALL ENTRIES IN t_comm_il_prdbp
WHERE partner_guid EQ t_comm_il_prdbp-destinguid.
IF sy-subrc EQ 0.
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
Retrieve the partner and address details present in the Installed base:
wl_i_ibase_head-ibase
=
wa_ibib-ibase.
wl_i_ibase_head-guid_ibase = wa_ibib-ib_guid_16.
* Fetch the Partner GUID
CALL FUNCTION 'CRM_IBASE_GET_PARTNER'
EXPORTING
i_ibase_head
= wl_i_ibase_head
IMPORTING
e_partner_tab
= tl_e_partner_tab
EXCEPTIONS
not_specified
= 1
doesnt_exist
= 2
no_authority
= 3
OTHERS
= 4
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
.
IF sy-subrc EQ 0.
LOOP AT tl_e_partner_tab INTO wl_e_partner_tab.
MOVE-CORRESPONDING wl_e_partner_tab TO wa_e_partner_tab.
APPEND wa_e_partner_tab TO t_e_partner_tab.
CLEAR wa_e_partner_tab.
ENDLOOP.
ENDIF.
* Fetch the IBASE (HEADER LEVEL) details:
i_guid_16 = wa_ibib-ib_guid_16.
i_guid_32 = cl_ibase_service=>cl_convert_guid_16_32( i_guid_16 ).
SELECT refguid
ref_partner_fct
ref_partner_no
FROM cdbd_ibpart
INTO TABLE tl_cdbd_ibpart1
WHERE refguid EQ i_guid_32.
IF sy-subrc EQ 0.
LOOP AT tl_cdbd_ibpart1 INTO wl_cdbd_ibpart1.
* IBASE GUID
r_guid_32 = wl_cdbd_ibpart1-refguid.
w_ibase_guid_16 = cl_ibase_service=>cl_convert_guid_32_16( r_guid_32 ).
wa_cdbd_ibpart-ib_guid_16 = w_ibase_guid_16.
wl_cdbd_ibpart-ib_guid_16 = w_ibase_guid_16.
CLEAR : r_guid_32.
* Business Partner GUID
r_guid_32 = wl_cdbd_ibpart1-ref_partner_no.
w_partner_guid_16 = cl_ibase_service=>cl_convert_guid_32_16( r_guid_32 ).
wa_cdbd_ibpart-partner_guid = w_partner_guid_16.
wl_cdbd_ibpart-partner_guid = w_partner_guid_16.
MOVE-CORRESPONDING wl_cdbd_ibpart1 TO wa_cdbd_ibpart.
MOVE-CORRESPONDING wl_cdbd_ibpart1 TO wl_cdbd_ibpart.
APPEND wa_cdbd_ibpart TO t_cdbd_ibpart.
APPEND wl_cdbd_ibpart TO tl_cdbd_ibpart.
CLEAR: wa_cdbd_ibpart , wl_cdbd_ibpart1 , wl_cdbd_ibpart
w_partner_guid_16 , wl_cdbd_ibpart.
ENDLOOP.
, r_guid_32 ,
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
Note: Retrieve the Business Partner and Address details separately for Installed Base and components.
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
Execution
Step 1: Go to transaction SE38 and execute the ABAP Code YCRM_INSTALLED_BASE_BW in
background:
Step 2: Check the spool created for the ABAP Report Output:
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
Advantage of using the above method is we have a option of background schedule to execute the report
output and further validating the data with the SAP BW report.
For Validation of the data (Would take the sample example of Installed Base 3618).Reconciliation of the
report data can be done with various references either from RSA3 (Execution of the data source),DSO
(0CRM_IBCO) Output , or Query Execution. Here I would validate the report output data with the RSA3
transaction.
Step 1: Go to SE38 transaction and execute the report for the below mentioned selection:
Go to transaction RSA3 and execute the datasource 0CRM_SRV_IBASE_ATTR for Installed Base 3618:
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
Step 2: Validate the data between report output and RSA3 output:
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
*&---------------------------------------------------------------------*
*& Report YCRM_INSTALLED_BASE_BW
*&
*&---------------------------------------------------------------------*
*& Reconciliation of the CRM Installed Base data with the data loaded
*& to SAP BI using datasource 0CRM_SRV_IBASE_ATTR
*&---------------------------------------------------------------------*
REPORT
TABLES : ibib.
TYPE-POOLS : slis.
* Installed Base
TYPES: BEGIN OF typ_ibib ,
ib_guid_16 TYPE guid_16 ,
ibase
TYPE ib_ibase ,
ibtyp
TYPE ib_ibtyp ,
extid
TYPE ib_extid ,
authg
TYPE ib_authg ,
crnam
TYPE bu_crusr ,
crtim
TYPE icrts ,
END OF typ_ibib ,
* Partner Fucntion
BEGIN OF typ_crmc_partner_fct ,
partner_fct TYPE comt_partner_fct ,
END OF typ_crmc_partner_fct ,
* Address
BEGIN OF typ_adrc ,
addrnumber TYPE ad_addrnum,
street
TYPE ad_street ,
streetcode TYPE ad_strnum ,
house_num1 TYPE ad_hsnm1 ,
post_code1 TYPE ad_pstcd1 ,
city1
TYPE ad_city1 ,
city_code TYPE ad_citynum ,
country
TYPE land1 ,
region
TYPE regio ,
regiogroup TYPE regiogroup ,
END OF typ_adrc,
* Instance(Components)
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
BEGIN OF typ_instance ,
instance
TYPE ib_instance ,
guid_compc TYPE ib_recno_16 ,
END OF typ_instance ,
Master Data of Relationship Type Partner
BEGIN OF typ_comm_il_prdbp ,
sourceguid
TYPE comt_il_sourceguid ,
destinguid
TYPE comt_il_destinguid ,
link_partner_fct TYPE comt_link_partner_fct ,
END OF typ_comm_il_prdbp ,
Product GUID
BEGIN OF typ_source_guid ,
objnr TYPE ib_objnr_16 ,
END OF typ_source_guid ,
Business Partner
BEGIN OF typ_but000,
partner TYPE bu_partner ,
partner_guid TYPE bu_partner_guid ,
END OF typ_but000 ,
Business Partner and Address Number
BEGIN OF typ_but020 ,
partner
TYPE bu_partner ,
addrnumber
TYPE ad_addrnum ,
END OF typ_but020 ,
Comm_product
BEGIN OF typ_comm_product ,
product_guid
TYPE comt_product_guid ,
product_id
TYPE comt_product_id ,
product_type
TYPE comt_product_type ,
object_family
TYPE comt_product_object_family ,
logsys
TYPE comt_logsys,
END OF typ_comm_product ,
IBASE and Business Partner GUID link
BEGIN OF typ_cdbd_ibpart,
ib_guid_16
TYPE bu_partner_guid ,
ref_partner_fct
TYPE crmt_partner_fct ,
partner_guid
TYPE guid_16 ,
END OF typ_cdbd_ibpart.
DATA : wa_ibib
wa_crmc_partner_fct
wa_comm_il_prdbp
wa_adrc_c
wa_adrc_h
wa_instance
wa_i_comp
wa_e_comp_det
wa_et_status
wa_source_guid
wa_but000_c
wa_but000_h
wa_extract
wa_comm_product
wa_but020_c
wa_but020_h
wa_cdbd_ibpart
TYPE
TYPE
TYPE
TYPE
TYPE
TYPE
TYPE
TYPE
TYPE
TYPE
TYPE
TYPE
TYPE
TYPE
TYPE
TYPE
TYPE
typ_ibib ,
typ_crmc_partner_fct ,
typ_comm_il_prdbp ,
typ_adrc ,
typ_adrc ,
typ_instance ,
ibap_dat1 ,
ibap_comp2,
jstat ,
typ_source_guid ,
typ_but000 ,
typ_but000 ,
crmt_bw_srv_ibase_attr ,
typ_comm_product ,
typ_but020 ,
typ_but020 ,
typ_cdbd_ibpart ,
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
wa_ibap_struc1
wa_i_ibase_head
wa_e_partner_tab
TYPE ibap_struc1,
TYPE ibap_head1 ,
TYPE ibap_part2.
DATA : t_ibib
TYPE STANDARD TABLE OF typ_ibib INITIAL SIZE 0 ,
t_crmc_partner_fct TYPE STANDARD TABLE OF typ_crmc_partner_fct INITIAL SIZE 0
,
t_comm_il_prdbp
TYPE STANDARD TABLE OF typ_comm_il_prdbp INITIAL SIZE 0 ,
t_adrc_c
TYPE STANDARD TABLE OF typ_adrc INITIAL SIZE 0 ,
t_adrc_h
TYPE STANDARD TABLE OF typ_adrc INITIAL SIZE 0 ,
t_ibib1
TYPE ibib1 ,
t_ibibt1
TYPE ibibt1 ,
t_ibap_struc1
TYPE STANDARD TABLE OF IBAP_STRUC1 ,
t_instance
TYPE STANDARD TABLE OF typ_instance ,
t_i_comp
TYPE ibap_dat1 ,
t_e_comp_det
TYPE STANDARD TABLE OF ibap_comp2,
t_et_status
TYPE ttjstat ,
t_source_guid
TYPE STANDARD TABLE OF typ_source_guid ,
t_but000_c
TYPE STANDARD TABLE OF typ_but000 ,
t_but000_h
TYPE STANDARD TABLE OF typ_but000 ,
t_extract
TYPE STANDARD TABLE OF crmt_bw_srv_ibase_attr ,
t_comm_product
TYPE STANDARD TABLE OF typ_comm_product ,
t_but020_c
TYPE STANDARD TABLE OF typ_but020 ,
t_but020_h
TYPE STANDARD TABLE OF typ_but020 ,
t_cdbd_ibpart
TYPE STANDARD TABLE OF typ_cdbd_ibpart ,
t_e_partner_tab
TYPE STANDARD TABLE OF ibap_part2 .
* Fieldcatalogue :
DATA :
t_fieldcat
t_event
wa_layout_ven
TYPE slis_t_fieldcat_alv ,
TYPE slis_t_event ,
TYPE slis_layout_alv .
* Selection Screen
INCLUDE ysub_selection_screen.
* Sub Routines
INCLUDE ysub_subroutines.
******* START OF SELECTION ***************
START-OF-SELECTION.
* Retreive data from Installed Base tables
PERFORM sub_retrive_data.
* Prepare final data
PERFORM sub_prepare_extract_data.
******* END OF SELECTION *****************
END-OF-SELECTION.
* Display Output
PERFORM sub_display_output.
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
INCLUDE: YSUB_SELECTION_SCREEN
selection-screen begin of block b1 with frame title text-001 .
* Selection screen input fields for Input
select-options:
s_ibase for ibib-ibase modif id op2 . " Installed Base
selection-screen end of block b1.
INCLUDE: YSUB_SUBROUTINES
*&---------------------------------------------------------------------*
*& Include
YSUB_SUBROUTINES
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*&
Form SUB_RETRIVE_DATA
*&---------------------------------------------------------------------*
*
Retriece data from tables related to installed base
*----------------------------------------------------------------------*
form sub_retrive_data .
types :
begin of d_cdbd_ibpart,
refguid
type smo_guid ,
ref_partner_fct
type crmt_partner_fct ,
ref_partner_no
type crmt_partner_no ,
end of d_cdbd_ibpart.
data : l_ibase
wl_ibase_head
wl_ibap_struc1
tl_comm_il_prdbp
wl_comm_il_prdbp
tl_cdbd_ibpart
tl_cdbd_ibpart1
wl_cdbd_ibpart1
wl_cdbd_ibpart
tl_but020_h
tl_but020_c
wl_but020_h
wl_but020_c
tl_adrc_c
wl_adrc_c
tl_adrc_h
wl_adrc_h
tl_but000_h
wl_but000_h
tl_but000_c
wl_but000_c
tl_comm_product
wl_comm_product
tl_ibap_struc1
tl_ibibt1
tl_ibib1
type ib_ibase ,
type ibap_head1 ,
type ibap_struc1 ,
type standard table of typ_comm_il_prdbp ,
type typ_comm_il_prdbp ,
type standard table of typ_cdbd_ibpart ,
type standard table of d_cdbd_ibpart ,
type d_cdbd_ibpart ,
type typ_cdbd_ibpart ,
type standard table of typ_but020 ,
type standard table of typ_but020 ,
type typ_but020 ,
type typ_but020 ,
type standard table of typ_adrc ,
type typ_adrc ,
type standard table of typ_adrc ,
type typ_adrc ,
type standard table of typ_but000 ,
type typ_but000 ,
type standard table of typ_but000 ,
type typ_but000 ,
type standard table of typ_comm_product ,
type typ_comm_product ,
type ibap_struc1_tab ,
type ibibt1 ,
type ibib1 ,
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
wl_i_ibase_head
tl_e_partner_tab
wl_e_partner_tab
data: w_partner_guid_16
w_ibase_guid_16
i_guid_32
i_guid_16
r_guid_16
r_guid_32
type ibap_head1 ,
type ibap_part2_tab ,
type ibap_part2.
type
type
type
type
type
type
bu_partner_guid ,
guid_16 ,
guid_32 ,
guid_16 ,
guid_16 ,
guid_32 .
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
clear wa_instance.
wa_source_guid-objnr
= wl_ibap_struc1-objnr.
append wa_source_guid to t_source_guid.
clear wa_source_guid.
wl_ibap_struc1-ibase = wa_ibib-ibase.
append wl_ibap_struc1 to t_ibap_struc1 .
clear wl_ibap_struc1.
endloop.
delete adjacent duplicates from t_instance comparing instance guid_compc .
* Delete adjacent duplicates product GUID
delete adjacent duplicates from t_source_guid comparing objnr.
* Retrieve the product details
select sourceguid
destinguid
link_partner_fct
from comm_il_prdbp
into table t_comm_il_prdbp
for all entries in t_source_guid
where sourceguid eq t_source_guid-objnr.
if sy-subrc eq 0.
* Retrieve Business partner values
select partner
partner_guid
from
but000
into table tl_but000_c
for all entries in t_comm_il_prdbp
where partner_guid eq t_comm_il_prdbp-destinguid.
if sy-subrc eq 0.
loop at tl_but000_c into wl_but000_c.
move-corresponding wl_but000_c to wa_but000_c.
append wa_but000_c to t_but000_c.
clear: wa_but000_c , wl_but000_c.
endloop.
* Fetch the Address Number relevant to the Business Partner
select partner
addrnumber
from but020
into table tl_but020_c
for all entries in tl_but000_c
where partner eq tl_but000_c-partner.
if sy-subrc eq 0.
loop at tl_but020_c into wl_but020_c.
move-corresponding wl_but020_c to wa_but020_c.
append wa_but020_c to t_but020_c.
clear : wa_but020_c , wl_but020_c.
endloop.
* retrieve the address details
select addrnumber
street
streetcode
house_num1
post_code1
city1
city_code
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
country
region
regiogroup
from adrc
into table tl_adrc_c
for all entries in tl_but020_c
where addrnumber eq tl_but020_c-addrnumber.
if sy-subrc eq 0.
loop at tl_adrc_c into wl_adrc_c.
move wl_adrc_c to wa_adrc_c.
append wa_adrc_c to t_adrc_c.
clear : wl_adrc_c , wa_adrc_c.
endloop.
endif.
endif.
endif.
endif.
* Retrieve the values from COMM_PRODCUT
select product_guid
product_id
product_type
object_family
logsys
from comm_product
into table tl_comm_product
for all entries in t_source_guid
where product_guid eq t_source_guid-objnr.
if sy-subrc eq 0.
loop at tl_comm_product into wl_comm_product.
move-corresponding wl_comm_product to wa_comm_product.
append wa_comm_product to t_comm_product.
clear: wa_comm_product , wl_comm_product.
endloop.
endif.
endif.
wl_i_ibase_head-ibase
=
wa_ibib-ibase.
wl_i_ibase_head-guid_ibase = wa_ibib-ib_guid_16.
* Fetch the Partner GUID
call function 'CRM_IBASE_GET_PARTNER'
exporting
i_ibase_head
= wl_i_ibase_head
importing
e_partner_tab
= tl_e_partner_tab
exceptions
not_specified
= 1
doesnt_exist
= 2
no_authority
= 3
others
= 4
.
if sy-subrc eq 0.
loop at tl_e_partner_tab into wl_e_partner_tab.
move-corresponding wl_e_partner_tab to wa_e_partner_tab.
append wa_e_partner_tab to t_e_partner_tab.
clear wa_e_partner_tab.
endloop.
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
endif.
* Fetch the IBASE (HEADER LEVEL) details:
i_guid_16 = wa_ibib-ib_guid_16.
i_guid_32 = cl_ibase_service=>cl_convert_guid_16_32( i_guid_16 ).
select refguid
ref_partner_fct
ref_partner_no
from cdbd_ibpart
into table tl_cdbd_ibpart1
where refguid eq i_guid_32.
if sy-subrc eq 0.
loop at tl_cdbd_ibpart1 into wl_cdbd_ibpart1.
* IBASE GUID
r_guid_32 = wl_cdbd_ibpart1-refguid.
w_ibase_guid_16 = cl_ibase_service=>cl_convert_guid_32_16( r_guid_32 ).
wa_cdbd_ibpart-ib_guid_16 = w_ibase_guid_16.
wl_cdbd_ibpart-ib_guid_16 = w_ibase_guid_16.
clear : r_guid_32.
* Business Partner GUID
r_guid_32 = wl_cdbd_ibpart1-ref_partner_no.
w_partner_guid_16 = cl_ibase_service=>cl_convert_guid_32_16( r_guid_32 ).
wa_cdbd_ibpart-partner_guid = w_partner_guid_16.
wl_cdbd_ibpart-partner_guid = w_partner_guid_16.
move-corresponding wl_cdbd_ibpart1 to wa_cdbd_ibpart.
move-corresponding wl_cdbd_ibpart1 to wl_cdbd_ibpart.
append wa_cdbd_ibpart to t_cdbd_ibpart.
append wl_cdbd_ibpart to tl_cdbd_ibpart.
clear: wa_cdbd_ibpart , wl_cdbd_ibpart1 , wl_cdbd_ibpart
w_partner_guid_16 , wl_cdbd_ibpart.
endloop.
, r_guid_32 ,
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
if sy-subrc eq 0.
loop at tl_but020_h into wl_but020_h.
move-corresponding wl_but020_h to wa_but020_h.
append wa_but020_h to t_but020_h.
clear : wa_but020_h , wl_but020_h.
endloop.
* retrieve the address details
select addrnumber
street
streetcode
house_num1
post_code1
city1
city_code
country
region
regiogroup
from adrc
into table tl_adrc_h
for all entries in tl_but020_h
where addrnumber eq tl_but020_h-addrnumber.
if sy-subrc eq 0.
loop at tl_adrc_h into wl_adrc_h.
move wl_adrc_h to wa_adrc_h.
append wa_adrc_h to t_adrc_h.
clear : wl_adrc_h , wa_adrc_h.
endloop.
endif.
endif.
endif.
endif.
clear : tl_e_partner_tab.
endloop.
sort t_cdbd_ibpart by ib_guid_16 ref_partner_fct descending.
sort t_e_partner_tab by partner_number ascending.
endform.
" SUB_RETRIVE_DATA
*&---------------------------------------------------------------------*
*&
Form SUB_PREPARE_EXTRACT_DATA
*&---------------------------------------------------------------------*
*
Prepare the final data for which the ALV GRID would be displayed
*----------------------------------------------------------------------*
form sub_prepare_extract_data .
data : wl_top
wl_sub
wl_ptguid
w_unit
wl_partner
w_string
w_date
type
type
type
type
type
type
type
ib_parent ,
ib_root ,
crmt_ib_comp_guid ,
msehi ,
bu_partner ,
string ,
sy-datum.
= wa_ibib-ibase.
= wa_ibib-ib_guid_16 .
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
wa_extract-ibtyp
wa_extract-extid
wa_extract-header_guid
wa_extract-authg
wa_extract-ib_crnam
w_string
wa_extract-ib_created_at
wa_extract-ib_comp_flag
=
=
=
=
=
=
=
=
wa_ibib-ibtyp.
wa_ibib-extid.
wa_ibib-ib_guid_16 .
wa_ibib-authg.
wa_ibib-crnam.
wa_ibib-crtim+0(8).
w_string+0(8).
'H'.
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
wa_extract-ibtyp
wa_extract-extid
wa_extract-header_guid
wa_extract-authg
wa_extract-ib_crnam
w_string
wa_extract-ib_created_at
wa_extract-ib_comp_flag
=
=
=
=
=
=
=
=
wa_ibib-ibtyp.
wa_ibib-extid.
wa_ibib-ib_guid_16 .
wa_ibib-authg.
wa_ibib-crnam.
wa_ibib-crtim+0(8).
w_string+0(8).
'C'.
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
endform.
" SUB_DISPLAY_OUTPUT
*&---------------------------------------------------------------------*
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
*&
Form SUB_FIELDCAT_POPULATE
*&---------------------------------------------------------------------*
*
Populate the Fieldcatalogue
*----------------------------------------------------------------------*
form sub_fieldcat_populate .
* Definition of Fieldcatalogue
data : wl_fieldcat_phsdcpc1 type slis_fieldcat_alv.
* Clearing work area of fieldcatalogue
clear wl_fieldcat_phsdcpc1.
* IBASE Guid
wl_fieldcat_phsdcpc1-col_pos = '1'.
wl_fieldcat_phsdcpc1-fieldname = 'IBASE_GUID'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-002.
wl_fieldcat_phsdcpc1-outputlen = '35'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
* IBASE
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '2'.
wl_fieldcat_phsdcpc1-fieldname = 'IBASE'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-003.
wl_fieldcat_phsdcpc1-outputlen = '10'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
* IBASE Category
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '3'.
wl_fieldcat_phsdcpc1-fieldname = 'IBTYP'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-004.
wl_fieldcat_phsdcpc1-outputlen = '10'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
* External ID
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '4'.
wl_fieldcat_phsdcpc1-fieldname = 'EXTID'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-005.
wl_fieldcat_phsdcpc1-outputlen = '15'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
* Header GUID
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '5'.
wl_fieldcat_phsdcpc1-fieldname = 'HEADER_GUID'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-006.
wl_fieldcat_phsdcpc1-outputlen = '35'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
* Authorization Group (IBASE)
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '6'.
wl_fieldcat_phsdcpc1-fieldname = 'AUTHG'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-007.
wl_fieldcat_phsdcpc1-outputlen = '10'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
* User Created
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '7'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_CRNAM'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-008.
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
wl_fieldcat_phsdcpc1-outputlen = '15'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
Installed Base Creation Date
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '8'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_CREATED_AT'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-009.
wl_fieldcat_phsdcpc1-outputlen = '10'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
Partner Function
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '9'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_PTN_FCT'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-010.
wl_fieldcat_phsdcpc1-outputlen = '10'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
Business Partner ID
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '10'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_PTN_NUM'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-011.
wl_fieldcat_phsdcpc1-outputlen = '10'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
UUID in character form
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '11'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_PARTNERSET_1'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-012.
wl_fieldcat_phsdcpc1-outputlen = '35'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
UUID in Character Form
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '12'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_PARTNERSET_2'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-013.
wl_fieldcat_phsdcpc1-outputlen = '35'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
Street
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '13'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_STREET'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-014.
wl_fieldcat_phsdcpc1-outputlen = '10'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
Street Code
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '14'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_STREETCODE'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-015.
wl_fieldcat_phsdcpc1-outputlen = '10'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
House Number
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '15'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_HOUSE_NO'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-016.
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
wl_fieldcat_phsdcpc1-outputlen = '10'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
City postal code
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '16'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_POSTCODE'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-017.
wl_fieldcat_phsdcpc1-outputlen = '10'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
City
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '17'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_CITY'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-018.
wl_fieldcat_phsdcpc1-outputlen = '10'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
City code for city/street file
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '18'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_CITY_CODE'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-019.
wl_fieldcat_phsdcpc1-outputlen = '10'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
Country Key
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '19'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_COUNTRY'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-020.
wl_fieldcat_phsdcpc1-outputlen = '10'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
Region
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '20'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_REGION'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-021.
wl_fieldcat_phsdcpc1-outputlen = '10'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
Region group
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '21'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_REGIOGROUP'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-022.
wl_fieldcat_phsdcpc1-outputlen = '10'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
Geo location longitude
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '22'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_LONGITUDE'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-023.
wl_fieldcat_phsdcpc1-outputlen = '15'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
Geo location latitude
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '23'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_LATITUDE'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-024.
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
wl_fieldcat_phsdcpc1-outputlen = '15'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
Precision
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '24'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_PRECIS'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-025.
wl_fieldcat_phsdcpc1-outputlen = '10'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
IB: Component (instance)
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '25'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_COMP_NUMBER'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-026.
wl_fieldcat_phsdcpc1-outputlen = '10'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
IB: Identification
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '26'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_COMP_DEVI_ID'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-027.
wl_fieldcat_phsdcpc1-outputlen = '10'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
IB: Object Type
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '27'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_COMP_OBJ_TYPE'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-028.
wl_fieldcat_phsdcpc1-outputlen = '10'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
IB: Component Assignment
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '28'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_COMP_REFOBJ'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-029.
wl_fieldcat_phsdcpc1-outputlen = '35'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
Product ID
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '29'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_COMP_REFOB_ID'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-030.
wl_fieldcat_phsdcpc1-outputlen = '10'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
Product Type
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '30'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_COMP_REFTYP'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-031.
wl_fieldcat_phsdcpc1-outputlen = '10'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
Object Family
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '31'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_COMP_OBJFAM'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-032.
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
wl_fieldcat_phsdcpc1-outputlen = '4'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
Original System
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '32'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_COMP_LOGSYS'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-043.
wl_fieldcat_phsdcpc1-outputlen = '15'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
Language Key
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '33'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_COMP_MLANG'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-033.
wl_fieldcat_phsdcpc1-outputlen = '10'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
Sort string
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '34'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_COMP_SORTF'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-034.
wl_fieldcat_phsdcpc1-outputlen = '10'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
Amount
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '35'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_COMP_AMOUNT'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-035.
wl_fieldcat_phsdcpc1-outputlen = '10'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
Base Unit of Measure
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '36'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_COMP_UNIT'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-036.
wl_fieldcat_phsdcpc1-outputlen = '10'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
Characteristics for Installed Base or Component
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '37'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_COMP_FLAG'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-037.
wl_fieldcat_phsdcpc1-outputlen = '10'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
Checkbox
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '38'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_COMP_DEL'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-038.
wl_fieldcat_phsdcpc1-outputlen = '10'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
Parent
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '39'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_COMP_PARENT'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-039.
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
wl_fieldcat_phsdcpc1-outputlen = '10'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
* Top most component
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '40'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_COMP_ROOT'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-041.
wl_fieldcat_phsdcpc1-outputlen = '10'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
* IB: Component Assignment
clear wl_fieldcat_phsdcpc1.
wl_fieldcat_phsdcpc1-col_pos = '41'.
wl_fieldcat_phsdcpc1-fieldname = 'IB_COMP_PTGUID'.
wl_fieldcat_phsdcpc1-reptext_ddic = text-042.
wl_fieldcat_phsdcpc1-outputlen = '35'.
append wl_fieldcat_phsdcpc1 to t_fieldcat.
endform.
" SUB_FIELDCAT_POPULATE
*&---------------------------------------------------------------------*
*&
Form SUB_ALV_DISPLAY
*&---------------------------------------------------------------------*
*
ALV Display
*----------------------------------------------------------------------*
form sub_alv_display .
* Populate the Layout table
wa_layout_ven-box_tabname
= 'T_EXTRACT'.
* Display the Report Ouptut
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program
= sy-repid
is_layout
= wa_layout_ven
it_fieldcat
= t_fieldcat
tables
t_outtab
= t_extract
exceptions
program_error
= 1
others
= 2
.
endform.
" SUB_ALV_DISPLAY
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource
Related Content
help.sap.com
For more information, visit the EDW homepage
SAP BW - Reconcile SAP CRM Installed Base Data with SAP BW Datasource