conversion routine

13
Conversion Routines in BW Release 3.X ADDON.NDBWAW

Upload: carlos-miguel-pereira

Post on 12-Mar-2015

178 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Conversion Routine

Conversion Routines in BW

Release 3 .X

AD

DO

N.N

DB

WA

W

Page 2: Conversion Routine

SAP Online Help 13.08.03

Conversion Routines in BW 3.X 2

Copyright

© Copyright 2003 SAP AG. All rights reserved.

No part of this publication may be reproduced or transmitted in any form or for any purposewithout the express permission of SAP AG. The information contained herein may be changedwithout prior notice.Some software products marketed by SAP AG and its distributors contain proprietary softwarecomponents of other software vendors.

Microsoft®, WINDOWS®, NT®, EXCEL®, Word®, PowerPoint® and SQL Server® are registeredtrademarks of Microsoft Corporation.

IBM®, DB2®, DB2 Universal Database, OS/2®, Parallel Sysplex®, MVS/ESA, AIX®, S/390®,AS/400®, OS/390®, OS/400®, iSeries, pSeries, xSeries, zSeries, z/OS, AFP, Intelligent Miner,WebSphere®, Netfinity®, Tivoli®, Informix and Informix® Dynamic ServerTM are trademarks ofIBM Corporation in USA and/or other countries.

ORACLE® is a registered trademark of ORACLE Corporation.

UNIX®, X/Open®, OSF/1®, and Motif® are registered trademarks of the Open Group.

Citrix®, the Citrix logo, ICA®, Program Neighborhood®, MetaFrame®, WinFrame®,VideoFrame®, MultiWin® and other Citrix product names referenced herein are trademarks ofCitrix Systems, Inc.HTML, DHTML, XML, XHTML are trademarks or registered trademarks of W3C®, World WideWeb Consortium, Massachusetts Institute of Technology.

JAVA® is a registered trademark of Sun Microsystems, Inc.

JAVASCRIPT® is a registered trademark of Sun Microsystems, Inc., used under license fortechnology invented and implemented by Netscape.

MarketSet and Enterprise Buyer are jointly owned trademarks of SAP AG and Commerce One.SAP, SAP Logo, R/2, R/3, mySAP, mySAP.com and other SAP products and services mentionedherein as well as their respective logos are trademarks or registered trademarks of SAP AG inGermany and in several other countries all over the world. All other product and service namesmentioned are trademarks of their respective companies.

Page 3: Conversion Routine

SAP Online Help 13.08.03

Conversion Routines in BW 3.X 3

Icons

Icon Meaning

Caution

Example

Note

Recommendation

Syntax

Typographic Conventions

Type Style Description

Example text Words or characters that appear on the screen. These include fieldnames, screen titles, pushbuttons as well as menu names, paths andoptions.

Cross-references to other documentation.Example text Emphasized words or phrases in body text, titles of graphics and tables.

EXAMPLE TEXT Names of elements in the system. These include report names,program names, transaction codes, table names, and individual keywords of a programming language, when surrounded by body text, forexample, SELECT and INCLUDE.

Example text Screen output. This includes file and directory names and their paths,messages, source code, names of variables and parameters as well asnames of installation, upgrade and database tools.

EXAMPLE TEXT Keys on the keyboard, for example, function keys (such as F2) or theENTER key.

Example text Exact user entry. These are words or characters that you enter in thesystem exactly as they appear in the documentation.

<Example text> Variable user entry. Pointed brackets indicate that you replace thesewords and characters with appropriate entries.

Page 4: Conversion Routine

SAP Online Help 13.08.03

Conversion Routines in BW 3.X 4

Conversion Routines in BW............................................................................................................. 5

ALPHA Conversion Routine......................................................................................................... 6

BUCAT Conversion Routine ........................................................................................................ 6

EAN11 Conversion Routine ......................................................................................................... 7

GJAHR Conversion Routine ........................................................................................................ 7

ISOLA Conversion Routine.......................................................................................................... 8

MATN1 Conversion Routine ........................................................................................................ 8

NUMCV Conversion Routine ....................................................................................................... 8

PER15 Conversion Routine ......................................................................................................... 9

PER16 Conversion Routine ......................................................................................................... 9

PER17 Conversion Routine ....................................................................................................... 10

POSID Conversion Routine ....................................................................................................... 11

PROJ Conversion Routine......................................................................................................... 11

REQID Conversion Routine ....................................................................................................... 11

WBSEL Conversion Routine...................................................................................................... 12

SDATE Conversion Routine ...................................................................................................... 12

IDATE Conversion Routine........................................................................................................ 12

Page 5: Conversion Routine

SAP Online Help 13.08.03

Conversion Routines in BW 3.X 5

Conversion Routines in BWUseConversion routines are used in BW so that the characteristic values (key) of an InfoObject canbe displayed or used in a different format to how they are stored in the database. They can alsobe stored in the database in a different format to how they are in their original form, andsupposedly different values can be consolidated into one.

Conversion routines that are often implemented in BW are now described.

IntegrationIn BW, conversion routines essentially serve to simplify the input of characteristic values for aquery runtime. For example with cost center 1000, the long value with left-hand zeros0000001000 (from the database) is not to be entered, but just 1000. Conversion routines aretherefore linked to characteristics (InfoObjects) and can be used by them.

Conversion routines can also be set with data loading. Although it is important to note thatconversion routine are often already defined for DataSource fields (particularly from SAP sourcesystems). The properties of the replicated DataSource fields are displayed in the transferstructure or DataSource maintenance.

In many cases it is desirable to store the conversion routines of these fields in the correspondingInfoObject on the BW side too. It is therefore necessary, when defining transfer rules, toconsider the connection between the conversion routine of the InfoObject in the communicationstructure and the conversion routine of the transfer structure field.

When loading data you now have to consider that when extracting from SAP source systems thedata is already in the internal format and is not converted. When loading flat files and whenloading using a BAPI or DB Connect, the conversion routine displayed signifies that an INPUTconversion is executed before writing to the PSA. For example, the date field is delivered from aflat file in the external format‚10.04.2003’. If a conversion routine has been specified in thetransfer structure maintenance, this field can be converted to the internal format ‘20030410’ in thetransfer rules, according to that conversion routine.

Conversion routines ALPHA, NUMCV, and GJAHR check whether data exists in the correctinternal format before it is updated. For more on this see the extensive documentation in the BWsystem in the transaction for converting to conforming internal values (transactionRSMDCNVEXIT). If the data is not in the correct internal form an error message is issued. Thesethree conversion routines can be set so that a check is not executed but an INPUT conversion is.Make this setting using the Optional Conversion flag in transfer rules maintenance. Both thecheck and the conversion are executed in the transfer rules for the target field.

Business Content objects are delivered with conversion routines if they are also used by theDataSource in the source system. The external presentation is then the same in both systems.The conversion routines used for the R/3 DataSource fields are then transferred to the BWsystem when the DataSources from the SAP source systems are replicated.

FunctionsA conversion occurs according to the data type of the field when changing the content of a fieldfrom the display format into the SAP-internal format and vice versa, as well as for output usingthe ABAP WRITE instruction. The same is true for output using a SAP BW query.

If this standard conversion is unsuitable you can override it by specifying a conversion routine inthe underlying domains. You do this in SAP BW by specifying a conversion routine in InfoObjectmaintenance in the General Tab Page [Extern].

Page 6: Conversion Routine

SAP Online Help 13.08.03

Conversion Routines in BW 3.X 6

See Defining Conversion Routines [Extern]

ALPHA Conversion RoutineUseThe ALPHA conversion is used in the BW system for each presetting for charactercharacteristics. The ALPHA conversion routine is registered automatically when a characteristic iscreated. If you do not want to use this routine, you have to remove it manually.

The ALPHA conversion routine is used, for example, with account numbers or documentnumbers.

FunctionsWhen converting from an external into an internal format this checks whether the entry in theINPUT field is wholly numerical, whether it consists of digits only, possibly with blank spacesbefore and/or after. If yes, the sequence of digits is copied to the OUTPUT field, right-aligned,and the space on the left is filled with zeros (‘0’). Otherwise the sequence of digits is copied to theoutput field from left to right and the space to the right remains blank.

For conversions from an internal to an external format (function moduleCONVERSION_EXIT_ALPHA_OUTPUT) the process is reversed. Blank characters on the left-hand side are omitted from the output.

ExampleInput and output fields are each 8 characters long. A conversion from an external to an internalformat takes place: ...

1. '1234 ' � '00001234'

2. 'ABCD ' � 'ABCD '

BUCAT Conversion RoutineUseThe BUCAT conversion routine converts the internal presentation of the budget type(0BUD_CAT) into the external presentation (0BUD_CAT_EX), using the active entries in themaster data table for the budget type InfoObject (0BUD_CAT).

ExampleConversion from the external into the internal format:

'1' � 'IM000003'

Page 7: Conversion Routine

SAP Online Help 13.08.03

Conversion Routines in BW 3.X 7

EAN11 Conversion RoutineUseThe EAN11 conversion routine is used for European Article Numbers (EAN) and the AmericanUniversal Product Code (UPC).

FunctionsIt converts the external presentation, according to settings in transaction W4ES (in the R/3 sourcesystem), into the internal SAP presentation. In the SAP system, left-hand zeros are not saved as,according to EAN standards, these are not required. For example, the EAN ‘123’ is the same asthe EAN ‘00123’. As such, the left-hand zeros are dispensed with.

UPC-E code short forms are converted into the long form.

The EAN11 conversion routine formats the internal presentation of each EAN type, according tosettings in transaction W4ES, for output. This ensures that the internal presentation does haveleft-hand zeros, or that UPC codes are converted to the short form.

GJAHR Conversion RoutineUseConversion routine GJAHR is used when entering the business year in order to allow anabbreviated, two-digit entry. A business year has four digits in the internal format.

FunctionsWhen converting from an external into an internal format this checks whether the entry in theINPUT field is wholly numerical, whether it consists of digits only, possibly with blank spacesbefore and/or after. ...

1. If a two-digit sequence of numbers is entered then these are put in the third and fourthspaces of the OUTPUT field. The left-hand spaces are filled with 19 or 20 according to thefollowing rule:

� Two-digit sequence < 50. Fill from left with 20.

� Two-digit sequence >= 50. Fill from left with 19.

2. A sequence that does not have two-digits is transferred to the output field from left to right.Blank characters are omitted.

ExampleConversion from the external into the internal format: ...

1. '12' � '2012'

2. '51' � '1951'

3. '1997' � '1997'

4. '991# � '991#

Page 8: Conversion Routine

SAP Online Help 13.08.03

Conversion Routines in BW 3.X 8

ISOLA Conversion RoutineUseConversion routine ISOLA converts the two-digit ISO language abbreviation INPUT into its SAP-internal OUTPUT presentation.

FunctionsThese are assigned using the LAISO and SPRAS fields in table T002. An INPUT that cannot beconverted (because it is not defined as T002-LAISO) produces an error message and triggers theUNKNOWN_LANGUAGE exception.

Because they are compatible, single-digit entries are supported in that they are transferred toOUTPUT unchanged. They are not checked against table T002.

The difference between upper and lower case letters is irrelevant with two-digitentries however with single-digit entries, upper and lower case letters stand fordifferent languages.

MATN1 Conversion RoutineUseThis conversion routine changes internal material numbers, stored in the system, into the externalmaterial numbers displayed in the interface and vice versa, according to settings in transactionOMSL.

With regard to the specific details of the conversion, read the help for the appropriate input field ofthe transaction.

NUMCV Conversion RoutineFunctionsWhen converting from an external into an internal format this checks whether the entry in theINPUT field is wholly numerical, whether it consists of digits only, possibly with blank spacesbefore and/or after. If yes, the sequence of digits is copied to the OUTPUT field, right-aligned,and the space on the left is filled with zeros (‘0’). Otherwise the blank characters are removedfrom the sequence of digits, the result is transferred, left-aligned, into the output field, and this isthen filled from the right with blank characters.

Converting from the internal format into the external format (conversion routineCONVERSION_EXIT_NUMCV_OUTPUT) does not produce any changes. The output field is setthe same as the input field.

Page 9: Conversion Routine

SAP Online Help 13.08.03

Conversion Routines in BW 3.X 9

ExampleInput and output fields are each 8 characters long. A conversion from an external to an internalformat takes place: ...

1. '1234 ' � '00001234'

2. 'ABCD ' � 'ABCD '

3. ' 1234 ' � '00001234'

4. ’ AB CD’ � ’ABCD ’

PER15 Conversion RoutineUseThe PER15 conversion serves to convert a five-figure calendar quarter in an external format(Q.YYYY, for example) into the internal format (YYYYQ). Y stands for year (here four-digits) andQ for quarter (single-digit: 1,2,3, or 4). The separator (‘.’ or ‘/’) has to correspond to the dateformat in the user settings.

FunctionsPermitted entries for the date format DD.MM.YYYY are QYY (two digits for year withoutseparator), Q.YY (two digits for year with separator), QYYYY (four digits for year withoutseparator), and Q.YYYY (four digits for year with separator). Permitted entries for the date formatYYYY/MM/DD would be YYQ, YY/Q, YYYYQ, YYYY/Q.

ExampleExamples where the date format in the user settings in DD.MM.YYYY. A conversion from theexternal to the internal format takes place: ...

1. '2.02' � '20022'

2. '31999' � '19993'

3. '4.2001' � '20014'

PER16 Conversion RoutineUseConversion routine PER16 is used with six-digit entries for (business year) periods.

FunctionsThe internal format for six-digit periods is YYYYPP (200206, for example, for period 6 of businessyear 2002). As the external format is converted to the internal format, this checks whether theentries in the INPUT parameter with external date formatting (separators, order) comply with usersettings. The separator (‘.’ or ‘/’) has to correspond to the date format in the user settings.

Page 10: Conversion Routine

SAP Online Help 13.08.03

Conversion Routines in BW 3.X 10

Different abbreviated entries are possible and these will be correctly converted into the internalformat.

ExampleFor the external date formatting DD.MM.YYYY in the user settings, the following conversion takesplace from external to internal formats: ...

1. '12.1999' � '199912'

2. '1.1999' � '199901'

3. '12.99' � '199912'

4. '1.99' � '199901'

PER17 Conversion RoutineUseConversion routine PER17 is used with seven-digit entries for (business year) periods.

FunctionsThe internal format for seven-digit periods is YYYYPPP (2002006, for example, for period 006 ofbusiness year 2002). As the external format is converted to the internal format, this checkswhether the entries in the INPUT parameter with external date formatting (separators, order)comply with user settings. The separator (‘.’ or ‘/’) has to correspond to the date format in theuser settings.

Different abbreviated entries are possible and these are converted correctly into the internalformat.

ExampleFor the external date formatting DD.MM.YYYY in the user settings, the following conversion takesplace from external to internal formats: ...

1. '012.1999' � '1999012'

2. '12.1999' � '1999012'

3. '1.1999' � '1999001'

4. '012.99' � '1999012'

5. '12.99' � '1999012'

6. '1.99' � '1999001'

Page 11: Conversion Routine

SAP Online Help 13.08.03

Conversion Routines in BW 3.X 11

POSID Conversion RoutineUseThe POSID conversion routine converts the external presentation of the program position(0PROG_PO_EX) into the internal presentation (0PROG_POS), using the active master datatable entries for the program position InfoObject (0PROG_POS).

ExampleConversion from the external into the internal format:

P-2411 � P24110000

PROJ Conversion RoutineUseThere are extensive possibilities in the R/3 system project system for editing the externalpresentation of the project and PSP elements (project coding, editing mask). These features areincluded in the R/3 conversion routine. This comprehensive logic cannot be mapped in the BWsystem. For this reason, the characteristic 0PROJECT_EX exists in the attributes of InfoObject0PROJECT and the external description is stored there. As the external description is entered onthe screen, conversion routine 'CONVERSION_EXIT_PROJ_INPUT' reads the correspondinginternal description 0PROJECT and uses this for internal processing.

If no master data has been loaded into the BW (master data generated by uploading transactiondata), then the internal description has to be input in order to execute a query.

ExampleInternal format: 0PROJECT: ‘A0001’

External format: 0PROJECT_EX: 'A / 0001'

REQID Conversion RoutineUseThe REQID conversion routine converts the external presentation of the appropriation request(0APPR_REQU) into the internal presentation (0APPR_RE_ED), using the active entries in themaster data table for the appropriation request InfoObject (0APPR_RE_ED).

ExampleConversion from the external into the internal format:

P-2411-2 � P24110002

Page 12: Conversion Routine

SAP Online Help 13.08.03

Conversion Routines in BW 3.X 12

WBSEL Conversion RoutineUseThere are extensive possibilities in the R/3 system project system for editing the externalpresentation of the project and PSP elements (project coding, editing mask). These features areincluded in the R/3 conversion routine. This comprehensive logic cannot be mapped in the BWsystem. For this reason, the characteristic 0WBS_ELM_EX exists in the attributes of InfoObject0WBS_ELEMT and the external description is stored there. As the external description is enteredon the screen, conversion routine 'CONVERSION_EXIT_WBSEL_INPUT' reads thecorresponding internal description 0WBS_ELEMT and uses this for internal processing.

If no master data has been loaded into the BW (master data generated by uploading transactiondata), then the internal description has to be input in order to execute a query.

ExampleInternal Format: 0WBS_ELEMT: 'A0001-1'

External format: 0WBS_ELM_EX: 'A / 0001-1'

SDATE Conversion RoutineUseThis conversion routine assigns the appropriate internal date presentation (YYYYMMDD) to anexternal date (01.JAN.1994, for example).

Call up the test report RSSCA1T0 to be able to better visualize the functionality ofthis routine. This test report contains the complete date conversion with external aswell as internal presentations.

ExampleDate formatting definition in the user master record: DD.MM.YYYY

Conversion from the external into the internal format:

'02.JAN.1994' � '19940102'

IDATE Conversion RoutineUseThis conversion routine assigns the appropriate internal date presentation (YYYYMMDD) to anexternal date (01JAN1994, for example).

Page 13: Conversion Routine

SAP Online Help 13.08.03

Conversion Routines in BW 3.X 13

Call up the test report RSSCA1T0 to be able to better visualize the functionality ofthis routine. This test report contains the complete date conversion with external aswell as internal presentations.

ExampleConversion from the external into the internal format:

'02JAN1994' � '19940102'