Wednesday, August 19, 2015

BW Questions


Difference between Master data Activation and Attribute Change Run
    • Master Data Activation = Activation
    • Attribute Change Run = (Master Data Activation) + Extra features
  • Master Data Activation
    • When the data is loaded to the InfoObject, it is present in ‘M’ Version, which is modified version. Only after the infoObject is activated, it changes to Active (A) version and is available for reporting.
  • Attribute Change Run
    • It does the Master data activation, along with the following tasks
    • It realigns the Aggregates for the changed attributes. 
    • It is also used when Navigational Attributes are used in the Aggregates. Once the request is loaded to cube and Roll up has been done. So after doing Rollup, if the value of the Master Data changes, that will not be reflected in the aggregates. As, when a query is executed, it gets the data from the Aggregates. In our case, the master data value changed after rollup, so the value is different in Aggregate and Cube. So, if we do Attribute Change Run, whenever there is a change in the master data value, it informs the change of master data value.

Classification Datasources

Classification is the process of assigning objects to classes and characteristic values to these objects. It is the means by which an object is classified based on its properties.

Object - a predefined business entity such as vendor, material, equipment or customer.
Class - a grouping of characteristics. For each object , there can be more than one class.
Characteristic - a property of an object, this is the new field being added. For example a new characteristic might be the color for a material.
Characteristic value - the actual value of the characteristic, for example a material might be colored blue.

Points-To-Remember

  • Classification in ecc allows multiple values which is not supported in BW. If a characterstic is defined with mutliple values, we cannot extract that characterstic to BW. Eg: color is the characterstic of material, and it can have only value of blue. if it has blue and blank, it will not be extracted to BW. In that case, there should be 2 characterstics defined in ecc as color1 and color2 and each can have blue and black values.
  • When adding characterstics to datasources in ctbw, they can be added irrespective of their classes.
  • When the characteristics(attributes) are being added to the datasource in ECC in CTBW, there will be corresponding characteric/attribute datasources created for all attributes which are of type char. They can/will be transferred to BW. They are all text datasources.


Classification Tcodes
CL03     - Displays Classes
CT04     - Displays Chatacteristics
CTBW   - Datasource Generation

Function Module
BAPI_CLASS_SELECT_OBJECTS
This FM needs Class type and Class Name (CLASSNUM) in selection.
The output SELECTEDOBJECTS gives a list of all places where this specific class is used.
For example, class type :111 and class name : local_cust for customer , when executed , selectedobjects gives all the customers which have classifications maintained for local_cust.

Classification Tables
AUSP     - Characteristic Values - Has char. ID (ATINN) and values of objects too ( For eg: OBJECK                   has  material numbers with corresponding char. ids - This table connects datasource                             objects Material, Equipment numbers etc to char ids.)
CABN    - List of Characteristics - Characteristic ID and Characterstic Name
CAWN   - Characteristic values - Characteristic ID  and Values
CAWNT -  Value Texts               - Characteristic ID and Value Texts

Understanding the tables
When a class is created, it will have number of characterstics in it. Each characterstic is given an Internal Characteristic number ( CAWN - ATINN ) , name (CABN-ATNAM) and the number of values for which can be assigned to the characteristic are maintained with help of counter ( CAWN - ATZHL ).

Corresponding text of each internal characteristic / counter is present in table CAWNT.

Example,
For Object MATERIAL - There are 2 classes maintained. MATERAIL_PHY, MATERIAL_ORG.
For Class MATERIAL_PHY - It has 3 characterstics. (1) Color (2) Base (3) Shape.

So each characteristic here is given an internal characteristic number and name.
10000001 - Color , 10000002 - Base , 10000003 - Shape

Color (ATNAM) can have 5 possible values (ATZHL) - Blue ; Green ; Red ; Yellow ; Orange (ATWRT) . Base can have 2 values - Fiber , Glass . Shape can be 3 values - Square , Rectangle , Triangle.

So the tables entries will be as follows.

CAWN
ATINN - ATZHL - ATWRT
10000001 - 1 - BL
10000001 - 2 - GR
10000001 - 3 - RE
10000001 - 4 - YE
10000001 - 5 - OR
10000002 - 1 - FI
10000002 - 2 - GL
10000003 - 1 - SQ
10000003 - 2 - RC
10000003 - 3 - TR

and Texts are maintianed in CAWNT

ATINN - ATZHL - ATWTB
10000001 - 1 - Blue
10000001 - 2 - Green
10000001 - 3 - Red
10000001 - 4 - Yellow
10000001 - 5 - Orange
10000002 - 1 - Fiber
10000002 - 2 - Glass
10000003 - 1 - Square
10000003 - 2 - Rectangle
10000003 - 3 - Triangle


Creating / Enhancing a Classification Datasource
ECC
Step 1
Check the characteristics present for the class in CL03

Step 2
Goto CTBW and you can see the below screenshot if there are datasources already defined. If not, define the datasource here first.


Selecting the datasource and clicking on the characterstics on the left side will give you existing characterstics associated with the datasource.
Check in CL03 for the chars. to be maintained and add them over here.



In edit mode, we can 'New Entries' where we can add the characters to the datasource.
One the characterstics are added, it will be in 'N' mode, click on 'datasource highlighted, and the datasource will be regenerated and the fields change to 'R'.

The datasource will be available in RSA6 and data can be checked in RSA3.

Note
  • In some cases, the editing should be done in development client and the characters might not be defined in the client with F4 help. so just copy the characteristic name from test client and add them
  • Individual characteristic datasources will be created for all the characteristics (not for time / key figures) and are  added to the datasource
  • Characteristics defined with multiple values cannot be added to the datasource. [ Go to individual characteristic in CT04 -> Basic Data -> Value Assignment should be 'Single Value ].
  • Sometimes, when you enter a new characteristic in CTBW, and click enters - nothing happens. That is fine. If you go back to the datasource and check you can see the newly added chars. Generate the datasource and everything should be fine.
  • CONVERSION_EXIT_ATINN_INPUT

    CONVERSION_EXIT_ATINN_OUTPUT


BW
Replicate the datasource in BW like another datasource replication. There is a different way to replicate classification datasources, where in all the necessary infoobjects will get generated, but I prefer creating my own infoobjects.



Data
The Master data objects have 'Classification' tabs/links defined in their tcodes where data can be seen,
For eg : Characterstics of Equipment can be seen in XD03 -> Equipment -> Extras -> Classification.



Some common issues
- Data was extracted from incorrect client

The infopackage fails with the above error. This can happen when clients are changed.
Go to CTBW in the source system and check the client number against the datasource.
Compare it with client in the system connected to BW system. They should be the same


Reference Notes
http://scn.sap.com/docs/DOC-62180
https://wiki.scn.sap.com/wiki/display/SAPMDM/Issues+in+fetching+internal+characteristics+of+materials

Saturday, August 8, 2015

Infosource

Infosoures 
A non-persistent structure consisting of InfoObjects for joining two transformations.

You always use an InfoSource when you want to perform two (or more) transformations consecutively in the data flow - without additional storage of the data.

My Notes 
Having read articles on Infosource, I am not able to completely understand the use. That might be because I didnot work on bw 3.5 where Infosources are mandatory and with out them, we cannot connect flows. Having worked from BW 7.0, I dont find them useful, as every where they say, we can use it to connect different datasources to a DSO, I would use a direct transformation.

Useful Links:


Monday, August 3, 2015

Code Snippets / Syntaxes





Getting Source System

Enabling/Disabling 3.X content

Declaring and using range table
DATA: lt_version TYPE RANGE OF rsobjvers,
      lw_version LIKE LINE OF lt_version,
lw_version-sign = 'I'.
lw_version-option = 'EQ'.
lw_version-low = 'A'.
APPEND lw_version TO lt_version.

Negative Number to String
String '-2.0481607392E8' to Number, Use DECFLOAT16/34.
DATA: lv_string TYPE string,
      lv_number TYPE DECFLOAT16.

lv_string = '-2.0481607392E8'.
lv_number = lv_string.

Dynamic Declaration of internal tables
FIELD-SYMBOLS : <fs_field> TYPE any.
DATA: g_field TYPE REF TO data.
DATA : g_name TYPE string.

g_name = 'RSBKDTP-DTP'.

CREATE DATA g_field TYPE (g_name).

ASSIGN g_field->* TO <fs_field>.