How to Upload CO-PA Hierarchie

10

Click here to load reader

description

dfsgfd

Transcript of How to Upload CO-PA Hierarchie

Page 1: How to Upload CO-PA Hierarchie

SAP (SAP America, Inc. and SAP AG) assumes no responsibility for errors or omissions in these materials.

These materials are provided “as is” without a warranty of any kind, either express or implied, including but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement.

SAP shall not be liable for damages of any kind including without limitation direct, special, indirect, or consequential damages that may result from the use of these materials.

SAP does not warrant the accuracy or completeness of the information, text, graphics, links or other items contained within these materials. SAP has no control over the information that you may access through the use of hot links contained in these materials and does not endorse your use of third party web pages nor provide any warranty whatsoever relating to third party web pages.

How to…

Upload CO-PA hierarchies BUSINESS INFORMATION WAREHOUSE

ASAP “How to…” Paper

Applicable Releases: BW 2.0B, 2.1C, 3.0, 3.1

February 2004

Page 2: How to Upload CO-PA Hierarchie

HOW TO … UPLOAD CO-PA HIERARCHIES

2004 SAP AMERICA, INC. AND SAP AG 1

1 Business Scenario

You have setup an operating concern and self defined hierarchies for CO-PA in a R/3 system. You want to use this hierarchy in the reporting of your connected BW system. The R/3 PlugIns provide DataSources and extraction modules only for the upload of certain hierarchies, e.g. cost center, cost element, account, customer, material, etc. No DataSources exist for self defined hierarchies in CO-PA.

2 The Result

In order to upload the self defined CO-PA hierarchies, you have to run a report to generate the corresponding DataSource. After you have replicated this DataSource to the BW system, you can upload the hierarchy with an InfoPackage and subsequently use it in your query definitions. The prerequisite for uploading a CO-PA hierarchy to BW is the existence of the Plugin PI 2001.1 or PI-A 2001.1.

In addition to the PlugIn, you also need the report enclosed in the Appendix of this document. It is planned to incorporate the report in the next version of the PlugIn. The report does not support the creation of DataSources for compounded InfoObjects, since the compound information for an InfoObject does not reside in the R/3 system any more (as in the BW release 1.2). The report also does not perform extensive consistency checks. It is therefore not recommended to adapt the report to fit your own requirements.

From Plug-In Release PI2004.1 the hierarchy extractor CO-PA was delivered in the standard release. The new hierarchy extractor in Profitability Analysis (CO-PA) allows you to load into SAP BW hierarchies for CO-PA characteristics that you have generated using the Define Characteristic Hierarchy function (transaction KES3). Therefore, from PI2004.1, you no longer have to use program ZRKEBWHIERARCHY to create the corresponding DataSource. In place of this program, you can use the new IMG activity Create Hierarchy DataSource (transaction KEB1) in the IMG under Data Transfer into the SAP Business Information Warehouse ? Setting for Application-Specific DataSources (PI) ? Profitability Analysis.

Page 3: How to Upload CO-PA Hierarchie

HOW TO … UPLOAD CO-PA HIERARCHIES

2004 SAP AMERICA, INC. AND SAP AG 2

3 The Step By Step Solution

3.1 Generate the DataSource in the R/3 system

1. Use SE38 to create a report and include the source coding from the Appendix.

If you want to have proper selection texts for the execution of the report, define the text elements for the selection texts as shown in the picture.

From release PI2004.1 you have not to implement this report in order to create a DataSource for CO-PA hierarchies. You can use new IMG activity Create Hierarchy DataSource (transaction KEB1).

2. (Only before release PI2004.1) Activate the report, and exec ute it. The parameters have to be filled as follows:

• Name of DataSource: User defined name for the DataSource

• Description: User defined description for the DataSource

• InfoObject: InfoObject of the hierarchy (has to be derived from BW)

• CO-PA characteristic: Name of the CO-PA

Page 4: How to Upload CO-PA Hierarchie

HOW TO … UPLOAD CO-PA HIERARCHIES

2004 SAP AMERICA, INC. AND SAP AG 3

characteristic as defined in the operating concern

• Operating concern: Name of the operating concern

3. If you want to transport the created DataSource, you have to assign a customer defined development class. You can enter the development class and a corresponding transport request in the popup.

3.2 Upload hierarchy into BW system

Page 5: How to Upload CO-PA Hierarchie

HOW TO … UPLOAD CO-PA HIERARCHIES

2004 SAP AMERICA, INC. AND SAP AG 4

1. Enter the Administrator Workbench, and select the view for the Source Systems.

Pick your Source System, and select DataSource Overview. Position on the node for Profitability Analysis and Replicate DataSources.

2. Verify that the hierarchy properties of the InfoObject you are using are maintained.

Page 6: How to Upload CO-PA Hierarchie

HOW TO … UPLOAD CO-PA HIERARCHIES

2004 SAP AMERICA, INC. AND SAP AG 5

3. Assign the DataSource to an InfoSource.

You can either do so by assigning an InfoSource to the DataSource in the SourceSystem view or …

… in the maintenance of the transfer rules in the InfoSource view.

Page 7: How to Upload CO-PA Hierarchie

HOW TO … UPLOAD CO-PA HIERARCHIES

2004 SAP AMERICA, INC. AND SAP AG 6

4. After you have assigned the DataSource to an InfoSource and activated the Transfer Rules, you can schedule an InfoPackage to upload the hierarchy from your R/3 system.

5. Activate the hierarchy to make it available for use in queries.

Appendix

REPORT ZRKEBWHIERARCHY MESSAGE-ID RD. * do not change this program because it updates dictionary * tables without check of consistency. you have to do the check by * your own. so avoid to create inconsistencies and ask responsible

Page 8: How to Upload CO-PA Hierarchie

HOW TO … UPLOAD CO-PA HIERARCHIES

2004 SAP AMERICA, INC. AND SAP AG 7

* persons (no error handling implemented yet) type-pools: RKEA1, RSAP, RSAOT. * DataSource structure data: ls_datasource TYPE rsaot_s_osgen, lt_datasourcefields TYPE rsaot_t_osgenfd, ls_datasourcetext LIKE rsgenost, lt_datasourcetext TYPE rsaot_t_osgentext, ls_oshiecat TYPE rsaot_s_ohiecat, ls_ohiecom TYPE rsaot_s_ohiecom, lt_ohiecom TYPE rsaot_t_ohiecom, lt_mess TYPE rsaot_t_messages. data: g_err like sy-subrc, G_FIELDTAB TYPE RKEA1_FIELDTAB, g_s_FIELDTAB type RKEA1_FIELDTAB_ENTRY, G_TABNAME LIKE DD02L-TABNAME. SELECTION-SCREEN BEGIN OF BLOCK INPN WITH FRAME. PARAMETERS: P_DS LIKE ROOSOURCE-OLTPSOURCE OBLIGATORY, " DataSource P_DP(30) OBLIGATORY, " Description P_CH LIKE ROOSOURCE-BASOSOURCE OBLIGATORY. " Basis char. selection-screen end of block inpn. SELECTION-SCREEN BEGIN OF BLOCK INPC WITH FRAME. parameters: P_ER LIKE TKEBB-ERKRS OBLIGATORY. " Tabname ERGK

P_C1 LIKE TKEBWLF-FIELDNAME OBLIGATORY. " CO-PA Char. selection-screen end of block inpc. * Check CO-PA characteristic at selection-screen on p_c1. CONCATENATE 'CE0' p_er INTO G_TABNAME. * Get information about co-pa characteristic. we need rollname and * domname. CALL FUNCTION 'RKE_FILL_FIELD_TABLE' EXPORTING ERKRS = p_er TABNAME = G_TABNAME IMPORTING SUBRC = g_err TABLES FIELDTAB = G_FIELDTAB EXCEPTIONS LEDGER_NOT_DEF = 1 LEDGER_NOT_FOUND = 2 TABLE_NOT_FOUND = 3 OTHERS = 4.

Page 9: How to Upload CO-PA Hierarchie

HOW TO … UPLOAD CO-PA HIERARCHIES

2004 SAP AMERICA, INC. AND SAP AG 8

IF SY-SUBRC <> 0. MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF. loop at g_FIELDTAB into g_s_FIELDTAB where FIELDNAME = p_c1. endloop. IF SY-SUBRC <> 0. MESSAGE ID 'RD' TYPE 'E' NUMBER '301' WITH P_C1. ENDIF. start-of-selection. * DataSource header clear ls_datasource. ls_datasource-OLTPSOURCE = p_ds. ls_datasource-TYPE = 'HIER'. ls_datasource-APPLNM = 'CO-PA'. ls_datasource-BASOSOURCE = p_ch. ls_datasource-EXMETHOD = 'F1'. ls_datasource-EXTRACTOR = 'RKE_BIW_HIERARCHY_TRANSFER'. ls_datasource-STRUCTURE = 'ROHIEROS'. ls_datasource-TSTPNM = sy-uname. ls_datasource-TSTPDAT = sy-datum. ls_datasource-TSTPTIM = sy-uzeit. * DataSource text ls_datasourcetext-LANGU = SY-langu. ls_datasourcetext-OLTPSOURCE = p_ds. ls_datasourcetext-TXTSH = p_dp. ls_datasourcetext-TXTMD = p_dp. ls_datasourcetext-TXTLG = p_dp. append ls_datasourcetext to lt_datasourcetext. * Hierarchy information clear ls_oshiecat. ls_oshiecat-oltpsource = p_ds. ls_oshiecat-objvers = 'A'. ls_oshiecat-typehc = 'EIS'. ls_oshiecat-domanm = g_s_FIELDTAB-domname. ls_oshiecat-rollnm = g_s_FIELDTAB-rollname. ls_oshiecat-fhcatalog = 'RKE_BIW_HIERARCHY_CATALOG'. ls_oshiecat-hietabfl = 'X'. APPEND 'OLTPSOURCE' TO lt_datasourcefields.

Page 10: How to Upload CO-PA Hierarchie

HOW TO … UPLOAD CO-PA HIERARCHIES

2004 SAP AMERICA, INC. AND SAP AG 9

* Compound information * Entry for basis characteristic ls_ohiecom-oltpsource = p_ds. ls_ohiecom-objvers = 'A'. ls_ohiecom-fieldnm = p_ch. ls_ohiecom-fieldcmp = p_ch. ls_ohiecom-posit = '0001'. ls_ohiecom-dtelnm = g_s_fieldtab-rollname. APPEND ls_ohiecom TO lt_ohiecom. * Generate DataSource CALL FUNCTION 'RSA1_OLTPSOURCE_GENERATE' EXPORTING * I_TESTMODE = 'X' i_save_despite_warning = 'X' i_s_oltpsource = ls_datasource i_t_oltpsourcefields = lt_datasourcefields i_t_ostext = lt_datasourcetext i_s_oshiecat = ls_oshiecat i_t_ohiecom = lt_ohiecom I_NO_TRANSPORT = rsaot_c_flag-off i_with_dynpro = rsaot_c_flag-off.