how to display unposted values as zero values in reporting

Upload: piedone64

Post on 03-Apr-2018

261 views

Category:

Documents


1 download

TRANSCRIPT

  • 7/28/2019 How to Display Unposted Values as Zero Values in Reporting

    1/15

    How to

    Display Unposted Values as

    Zero Values in Reporting

    BUSINESS INFORMATION WAREHOUSE

    ASAP How to Paper

    Applicable Releases: BW 2.0B, 2.1C

    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 impliedwarranties 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 thatmay 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 thesematerials. SAP has no control over the information that you may access through the use of hot links contained in these materialsand does not endorse your use of third party web pages nor provide any warranty whatsoever relating to third party web pages.

  • 7/28/2019 How to Display Unposted Values as Zero Values in Reporting

    2/15

    HOWTO DISPLAY UNPOSTED VALUESAS ZERO VALUESIN REPORTING

    May 2001

    1998 SAP AMERICA, INC. AND SAP AG TABLEOF CONTENTS

  • 7/28/2019 How to Display Unposted Values as Zero Values in Reporting

    3/15

    HOWTO DISPLAY UNPOSTED VALUESAS ZERO VALUESIN REPORTING

    1 Business Scenario

    The BEx does not normally show characteristics that have no values. However, it occurs quite

    frequently that an enterprise requires zero values to be shown in reports although these zero valuesare not delivered in the DataSources. An example of this is a report on a chart of accounts. Even ifcertain accounts have not been posted with values, they still ought to be shown as having the value0 in the report.

    Normally this can be achieved by the use of structures. However, this involves incorporating allaccounts that need to be displayed into the structure. This makes the query more complex and alsoincreases maintenance efforts. Queries with complex structures also tend to run more slowly thanqueries with drilldowns.

    The following describes a procedure for generating zero values from master data. There are two

    alternatives: In the first alternative the values are saved in an InfoCube; in the second alternative thezero values are generated using a RemoteCube.

    2001 SAP AMERICA, INC. AND SAP AG

  • 7/28/2019 How to Display Unposted Values as Zero Values in Reporting

    4/15

    HOWTO DISPLAY UNPOSTED VALUESAS ZERO VALUESIN REPORTING

    2 The Result

    The result is a report with a drilldown for the 'plant' and 'workcenter' characteristics. Values are

    displayed for all combinations of the 'plant' and 'workcenter' characteristics. If there is no value in thecube, zero values are shown.

    Obviously, such a procedure does not distinguish between unposted zero values and posted zerovalues.

    The following graphic shows the report without generated zero values:

    The following graphic shows the same report with zero values for all other 'plant' and 'workcenter'master data combinations. It is also filtered by workcenter in order to retain a printable structure.

    2001 SAP AMERICA, INC. AND SAP AG

  • 7/28/2019 How to Display Unposted Values as Zero Values in Reporting

    5/15

    HOWTO DISPLAY UNPOSTED VALUESAS ZERO VALUESIN REPORTING

    3 The Step By Step Solution

    3.1 Generate a generic DataSource for necessary master data combinations

    This step describes how to generate a generic DataSource for all master data combinations thathave zero values. The zero values can then be stored in the InfoCube using this genericDataSource.

    The following describes how to generate a generic DataSource for zero values for the InfoObjects0PLANT and 0WORKCENTER.

    2001 SAP AMERICA, INC. AND SAP AG

  • 7/28/2019 How to Display Unposted Values as Zero Values in Reporting

    6/15

    HOWTO DISPLAY UNPOSTED VALUESAS ZERO VALUESIN REPORTING

    1. Determine the master data

    tables for 0PLANT and0WORKCENTER. One place youcan find these is in the relevantInfoObject maintenance screen

    in the index tab 'Masterdata/texts'. In our example themaster data tables are/BI0/PPLANT and/BI0/PWORKCENTER.

    2. Use transaction SE11 to

    generate a database view.Choose the master data tablesdetermined above as underlyingtables in this view. Because thecharacteristic 0WORKCENTER ispaired with the characteristic0PLANT, you must insert a JOINcondition. Do not do this ifcharacteristics are notcompounded. This forms theCartesian product of theinvolved characteristic values.

    2001 SAP AMERICA, INC. AND SAP AG

  • 7/28/2019 How to Display Unposted Values as Zero Values in Reporting

    7/15

    HOWTO DISPLAY UNPOSTED VALUESAS ZERO VALUESIN REPORTING

    3. You must choose the keys of

    0PLANT and 0WORKCENTER asfields for the view.

    4. In the selection conditions forthe view, you must specify thatonly active elements of bothtables be selected. You do thisby limiting the field OBJVERS tothe value 'A'. You can alsomake other limitations heresuch as suppressing initialvalues.

    5. Now save and activate the

    database view.

    2001 SAP AMERICA, INC. AND SAP AG

  • 7/28/2019 How to Display Unposted Values as Zero Values in Reporting

    8/15

    HOWTO DISPLAY UNPOSTED VALUESAS ZERO VALUESIN REPORTING

    6. Use transaction SBIW in the BW

    system to specify a DataSourcefor transaction data that usesthe database method justcreated as an extraction

    method.

    7. The extraction method chosen

    is 'Extraction from view'. Enterthe view created above andsave it.

    2001 SAP AMERICA, INC. AND SAP AG

  • 7/28/2019 How to Display Unposted Values as Zero Values in Reporting

    9/15

    HOWTO DISPLAY UNPOSTED VALUESAS ZERO VALUESIN REPORTING

    8. You can now use another

    screen to choose which of theDataSource fields areselectable. Choose both fields.

    9.The DataSource has now beensuccessfully created. You mustnow inform BW about it. You dothis using the menu option'Replicate DataSources'. Thiscan be reached by going to theindex 'Source Systems' in theAdministrator Workbench andcalling up the context menu forthe entry that is the sourcesystem for the BW. AfterDataSources have been

    replicated the DataSource canbe assigned to an InfoSource.

    2001 SAP AMERICA, INC. AND SAP AG

  • 7/28/2019 How to Display Unposted Values as Zero Values in Reporting

    10/15

    HOWTO DISPLAY UNPOSTED VALUESAS ZERO VALUESIN REPORTING

    10. To do this, choose an existing

    InfoSource or create a newone. You must specify the BWsystem itself as the sourcesystem. You can directly

    assign 0PLANT and0WORKCENTER in the transferrules. The key figure0QUANTITY and thecorresponding unit 0UNIT areset to constant values. Aroutine is defined for0CALMONTH that determinesthe calendar month from thecurrent system date.

    11. Activate the InfoSource. This

    can now be used to fill anInfoCube.

    The routine for determining 0CALMONTH from the system date is defined as followed. The line inblue is the only one that needs to be added manually. The rest is generated by the system and isonly given here so that you can see the entire coding.

    FORM COMPUTE_CALMONTH

    USING RECORD_NO LIKE SY-TABIX

    TRAN_STRUCTURE TYPE TRANSFER_STRUCTURE

    G_S_MINFO TYPE RSSM_S_MINFO

    CHANGING RESULT LIKE /BIC/CSZGDTEST01-CALMONTH

    G_T_ERRORLOG TYPE rssm_t_errorlog_int

    RETURNCODE LIKE SY-SUBRC

    ABORT LIKE SY-SUBRC. "set ABORT 0 to cancel datapackage

    2001 SAP AMERICA, INC. AND SAP AG

  • 7/28/2019 How to Display Unposted Values as Zero Values in Reporting

    11/15

    HOWTO DISPLAY UNPOSTED VALUESAS ZERO VALUESIN REPORTING

    *$*$ begin of routine - insert your code only below this line *-*

    * DATA: l_s_errorlog TYPE rssm_s_errorlog_int.

    RESULT = sy-datum(6).

    * returncode 0 means skip this recordRETURNCODE = 0.

    * abort 0 means skip whole data package !!!

    ABORT = 0.

    *$*$ end of routine - insert your code only before this line *-*

    ENDFORM.

    3.2 Link the InfoSource to an InfoCube

    3.2.1 Alternative 1: Fill a BasicCube with the InfoSource

    In this step the InfoSource data fills a separate InfoCube. The additional zero values generated aretherefore not mixed with the actual transaction data.

    12. Copy the InfoCube whose zero

    values you want to display toanother InfoCube.

    13. Connect this InfoCube with the

    InfoSource defined above. You

    do this with update rules.

    2001 SAP AMERICA, INC. AND SAP AG

  • 7/28/2019 How to Display Unposted Values as Zero Values in Reporting

    12/15

    HOWTO DISPLAY UNPOSTED VALUESAS ZERO VALUESIN REPORTING

    14. This zero value InfoCube can

    be filled using a correspondingInfoPackage.

    15. In the example you can see

    that the InfoPackage is startedon a monthly basis. When thisis done, the initial values foreach month are written to thecube.

    3.2.2 Alternative 2: Connect an InfoSource to a RemoteCubeIn this step the InfoSource data fills a separate InfoCube. The additional zero values generated aretherefore not mixed with the actual transaction data. However, in contrast to alternative 1, the data isnot physically saved - rather it is only read when required.

    This has negative effects on performance if there is a large amount of data or many concurrentusers.

    2001 SAP AMERICA, INC. AND SAP AG

  • 7/28/2019 How to Display Unposted Values as Zero Values in Reporting

    13/15

    HOWTO DISPLAY UNPOSTED VALUESAS ZERO VALUESIN REPORTING

    In this case there might be no point in assigning the current date to the characteristic 0CALMONTHin the transfer rules. If necessary, modify the transfer rules appropriately. E.g. you could set0CALMONTH to 01.1900 and then include this value as a filter or restriction in your query definition.

    The example shown here will be run-capable from BW 2.0B SP 15/ BW 2.1C SP 7.

    16. Copy the InfoCube whose zerovalues you want to display toanother InfoCube. Create it asa RemoteCube and assign it tothe InfoSource createdpreviously.

    3.3 MultiCube

    The MultiCube is used for combining the cubes created in the previous sections into one cube forreporting purposes.

    2001 SAP AMERICA, INC. AND SAP AG

  • 7/28/2019 How to Display Unposted Values as Zero Values in Reporting

    14/15

    HOWTO DISPLAY UNPOSTED VALUESAS ZERO VALUESIN REPORTING

    17. Create a MultiCube. Its

    underlying InfoCubes are theBasisCube plus the alternative1 InfoCube OR the alternative2 InfoCube.

    18. Take all available

    characteristics and key figuresinto the MultiCube. TheMultiCube refers to data fromboth underlying InfoCubes.

    You can definethis using the button'Identification'.

    19. Create dimensions in the

    MultiCube to which you assignindividual characteristics.

    2001 SAP AMERICA, INC. AND SAP AG

  • 7/28/2019 How to Display Unposted Values as Zero Values in Reporting

    15/15

    HOWTO DISPLAY UNPOSTED VALUESAS ZERO VALUESIN REPORTING

    20. Save and activate the

    MultiCube. If you now start areport on the MultiCube, thedrilldowns for 0PLANT and0WORKCENTER in the report

    will display not only thecharacteristic valuecombinations with values inthe cube, but also zero valuesfor all other characteristicvalue combinations.

    4 Remarks

    The Cartesian product of all involved characteristic values can grow quite large. In this case it mightmake sense to create a DataSource per characteristic. In the example given, you would create aDataSource for 0PLANT and a separate DataSource for 0WORKCENTER.

    Link these DataSources to an appropriate InfoCube. This cube should be a copy of the InfoCubewhose zero values you want to display. Make sure that you fill all characteristics that are used inrestrictions or in the query filter with meaningful values. You could use dummy values, e.g. 01.1900for 0CALMONTH, and include this dummy value into the restriction and/or filter.

    Include the resulting InfoCubes into a MultiCube as described in step 3.2.

    2001 SAP AMERICA, INC. AND SAP AG