Showing posts with label oracle. Show all posts
Showing posts with label oracle. Show all posts

Tuesday, August 4, 2015

Converting Oracle DB format of date to SAP date format

There are many data flows picking up the data from "external database" based source systems in BW. One of most used DB system is Oracle. To connect BW system to Oracle DB a technology called DB Connect is very often used. As Oracle and SAP are different systems designed by two different companies there are many differences in there while comparing each other. The differences are there as well as from date and time related fields representation.

Therefore there are challenges while integrating data from Oracle DBs into SAP BW. Especially when converting date and time fields in Oracle and into format compatible with SAP BW. Let's take an Oracle date format for example. It has a format as DD-MMM-YY means it has 7 characters (e.g. today's date is represented by: 03-AUG-15). Whereas SAP format is 8 characters long in format YYYYMMDD (see Data Element SYDATUM; Domain SYDATS or Data Type DATS). If we just simply assign Oracle date field to SAP one it won't get proper data because the fields are not compatible.

Now; how to solve this? On SCN there are many discussions (e.g. here or here) on this. Most of it suggest parsing value as they come from Oracle and concatenate it at the end to field in SAP format of date. However this is not proper approach. The way how Oracle produce the format of the data field depends on national language settings (NLS) used with the database connection. Therefore the date field can come in many different flavors as per many configuration settings. What actually needs to be done is to force Oracle to produce the date field in desired format. This can be achieved by adding function TO_CHAR into e.g. SELECT statement while we extracting the data. E.g. a separate view can be created in Oracle to add TO_CHAR function. Such a SELECT statement would look like:

select  to_char(,'YYYYMMDD') as dat from where ;


For more information see:

518241 - DB Connect in BW for an external Oracle database

Friday, March 21, 2014

Oracle DB versioning

Oracle as database is quite popular within SAP customers. It is fact for many years. The reason why customers are running their SAP system on Oracle database is that Oracle is quite stable, scalable and SAP is really optimized for Oracle. Although both companies do not like each other very much when it comes to database SAP is really taking a lot of effort to optimize their software for Oracle. Not sure how long this will be true as SAP will certainly shift its focus on their own homegrown HANA database but for time being it is valid.

Speaking of BW there are many features that are optimized for BW running on Oracle DB. You can find a lot of SAP Notes discussing those features. There are many RSADMIN parameters just for Oracle as DB. Once you want to use some of these features you may need to check first fi you have valid version of Oracle DB for which feature is valid. This here comes the tricky part. Oracle DB versioning is different from its DB’s marketing names. You can see in the particular note (e.g. 1287382) that you need Oracle DB 11g. What you see in your SAP system under menu System-> Status is that you have 11.2.0.3.0. So is 11.2.0.3.0 really 11g? Well version number starts with 11 but what about g?

Unfortunately I haven’t found any official material on how to match between real version number and its marketing name. But speaking very high level we can match those two as follows:

name
number
Oracle v2
2.3
Oracle v3
3.1.3
Oracle v4
4.1.4.0-4.1.4.4
Oracle v5
5.0.22, 5.1.17, 5.1.22
Oracle v6
6.0.17-6.0.36
Oracle7
7.0.12–7.3.4
Oracle8
8.0.3–8.0.6
Oracle8i rel 1
8.1.5.0–8.1.5.1
Oracle8i rel 2
8.1.6.0–8.1.6.3
Oracle8i rel 3
8.1.7.0–8.1.7.4
Oracle9i rel 1
9.0.1.0–9.0.1.5
Oracle9i rel 2
9.2.0.1–9.2.0.8
Oracle Database 10g Rel 1
10.1.0.2–10.1.0.5
Oracle Database 10g Rel 2
10.2.0.1–10.2.0.5
Oracle Database 11g Rel 1
11.1.0.6–11.1.0.7
Oracle Database 11g Rel 2
11.2.0.1–11.2.0.4
Oracle Database 12c Rel 1
12.1.*


Source of information: Wikipedia page.