SAP BW .....all info @ one place
SAP BW relevant Information
Loading

Ref: SDN Wiki
Author: Sudhakar Mohan

How to create Info Object level( Characteristic Value ) Authorization for a Reporting User in BI 7.0

Scenario: There are 5 sales organizations and we are going to restrict a reporting user ( TEST ) to access only 2 sales organization data out of the 5. In this eg.1000 and 2000 are the sales organizations of the user TEST for which we are going to give access.So whenever the user TEST executes thereport,he will only be able to see the Sales organisations 1000 and 2000 in the report.

Step - 1: Mark the InfoObject Authorization Relevant & Activate it.

Step - 2: Go to Tcode - RSECADMIN
Under Maintenance - Enter the name of the Authorization Object and click Create Authorization.
Insert Sales Organization Info object as shown below. Also included the other SAP recommended objects 1.0TCAACTVT, 2.0TCAIPROV and 3.0TCAVALID.

Maintain the Values for these Objects. Select 0Salesorg and click Details.
Eg: Values 1000 and 2000 are maintained for Sales Organisation

Note : Also include all Authorisation Relevant Objects which are used in that infoprovider in addition to the above additional 3 objects otherwise you may get "No Authorisation" error when you execute the query.

Step - 3 : Tcode - RSU01 Assign User to Authorisation Object
Enter the name of the user to be assigned with the authorization object and click the change button.
The select the relevant authorization object and save.

Note : 0BI_ALL is the authorization object to access all the info objects which are authorization relevant.

Step - 4: Create Authorisation Variable in Query Designer
Create an Authorization Variable - Variable with Processing by Authorisation in Query Designer as Below for Sales Organisation.
Restrict the Sales Organisation with the Authorisation Variable and execute the query.


 

Ref: SDN Wiki
Author: Ramakrishna Gattikoppula

Scenario
In BW Queries very often there is a requirement to restrict a characteristic with some values to get the correct result. Let us say we have a requirement where we need to restrict the query to only those Departments for which the Department ID starts with D1 or D2. This will be very simple task when there are limited number of Departments IDs starting with D1 or D2, but what if there are many Departments whose ID starts with D1 or D2.

Solution
This Can be achieved using a Customer Exit Variable.

Following are the steps you need to perform to restrict the characteristic with values having certain pattern.

Step1: Create a New Variable(say ZVAR_DEPT) on the Characteristic Department with following properties.

Type of Variable: Characteristic Value.
Processing By: Customer Exit.
Variable Represents: Multiple Single Values.
Variable Entry is: Mandatory, Not Ready for Input and Cannot be changed in Query Navigation

Step 2: Restrict the Characteristic with the variable ZVAR_DEPT.

Step 3: Go to Transaction SE37 and enter "EXIT_SAPLRRS0_001". In the next screen double click on "ZXRSRU01", this will take you to the screen where you can define Customer exit code for Global Variables in Reporting.

Step 4: Include the following code in the Customer Exit code.

WHEN 'ZVAR_DEPT'.
IF I_STEP = 1.
DATA: ITAB1 TYPE STANDARD TABLE OF /BI0/SDEPT_ID WITH HEADER LINE.
SELECT * FROM /BI0/SDEPT_ID INTO TABLE ITAB1 WHERE DEPT_ID LIKE 'D1%' OR DEPT_ID LIKE 'D2%'.
CLEAR: L_S_RANGE.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
LOOP AT ITAB1.
L_S_RANGE-LOW = ITAB1-DEPT_ID.
APPEND L_S_RANGE TO E_T_RANGE.
ENDLOOP.
CLEAR L_S_RANGE.
ENDIF.


 

Ref: SDN Wiki.
Author: Davide Cavallari

Summary
We need to add a user-defined field to a LO-Cockpit DataSource. This field can change with no other field of the standard extract structure changing at the same time. We want this change to be registered by the DataSource's delta queue.

In the following example we will see how to add a custom field for the sales rep specified in a sales document. We will assume that the sales rep is modeled as a line-item partner function, and we will therefore enhance the DataSource 2LIS_11_VDITM (Sales Document Item Data).

Related Content
Introduction
1. Enhancing the LIS communication structure
2. Customizing the extract structure
3. Implementing the extraction logic for delta process
4. Implementing the extraction logic for the initialisation run

Introduction
The extraction process for the Logistics DataSources (those found in the LO Customising Cockpit, transaction code LBWE) is pretty complex. No wonder that, when you need to add a custom field to one of such DataSources, you have to pay especially carefull attention in order to avoid losing data from the DataSource's extraction or delta queues. On top of that, if your custom field is delta relevant as well, you may well end up with a broken delta process, where document changes are not always sent to the delta queue.

Here delta relevant means that when this field changes, this change should be felt by the V3 delta process, even though no additional field in the standard extract structure changes. It can be difficult to figure out exactly which steps are needed to ensure that the delta process works--although there is some good piece information around, such as this one, all in all I find the documentation available is pretty fragmented.

In the following I will concisely discuss an example which illustrates how to add a custom field for the sales rep specified in a sales document. We will assume that the sales rep is modeled as a line-item partner function, which in our example will have the value 'Z1'. We will therefore enhance the DataSource 2LIS_11_VDITM (Sales Document Item Data). I will not give details as to use the LO Customising Cockpit (LBWE) or implement an enhancement through the CMOD, though. If you need information about these tools, you should probably look for some specific documents on these topics as well. I do not even expalain the concept of before- and after-image records--should you need such information please refer to the related content section at the end of this document.

1. Enhancing the LIS communication structure
First of all, we need to add an extra field (YYKAM, in the example) in the LIS communication structure for sales documents' item data (MCVBAP).

We will insert an append structure (ZAMCVBAPUS, in the example) into the include structure MCVBAPUSR, and insert the new field YYKAM into this append structure:



2. Customizing the extract structure
The custom field YYKAM is now available in the LO Customizing Cockpit (transaction code LBWE), so we can add it to the extract structure MC11VA0ITM:



3. Implementing the extraction logic for delta process
In this step we will implement the code for extracting the value of the sales rep when a sales order's line item is created, modified or deleted (delta process). In the last step, instead, we will implement the extraction logic needed when performing the initialisation of a delta process.

The code for the delta extraction has to be written into the function EXIT_SAPLMCS1_002 (this function refers to the sales orders' line items) of the enhancement MCS10001 (SIS: Statistics update, sales documents). This can be done via the transaction CMOD:



Every time a line item is changed, deleted, or added, the EXIT function is called two times: one execution step processes the status of the data before the change (before-image), while the other the status after the change (after-image).

The field YY_KAM has to be filled with the value of the sales rep before or after the change, depending on whether the record is the before- or after-image. We can figure out which record is being processed through the field i_xmcvbap-supkz--its value being 1 for the before-image or 2 for the after-image record:

01.
*----------------------------------------------------------------------*
02.
* INCLUDE ZXMCVU02 *
03.
*----------------------------------------------------------------------*
04.
* importing VALUE(I_XMCVBAK) LIKE MCVBAKB STRUCTURE MCVBAKB
05.
*" VALUE(I_XMCVBUK) LIKE MCVBUKB STRUCTURE MCVBUKB
06.
*" VALUE(I_XMCVBAP) LIKE MCVBAPB STRUCTURE MCVBAPB
07.
*" VALUE(I_XMCVBUP) LIKE MCVBUPB STRUCTURE MCVBUPB
08.
*" VALUE(I_XMCVBKD) LIKE MCVBKDB STRUCTURE MCVBKDB
09.
*" VALUE(I_CONTROL) LIKE MCCONTROL STRUCTURE MCCONTROL
10.
*" EXPORTING
11.
*" VALUE(E_XMCVBAPUSR) LIKE MCVBAPUSR
12.
*" STRUCTURE MCVBAPUSR
13.
*----------------------------------------------------------------------*
14.
*
15.
* [...]
16.
*
17.
[...]
18.

19.
DATA lv_old_kz VALUE '1'.
20.
DATA lv_new_kz VALUE '2'.
21.
22.
[...]
23.
24.
CASE i_xmcvbap-supkz.
25.
26.
** before-image record
27.
WHEN lv_old_kz .
28.
29.
[...]
30.
31.
** after-image record
32.
WHEN lv_new_kz.
33.
34.
[...]
35.
36.
ENDCASE.
37.
[...]
Being the sales rep a partner function, its before- and after-image values will be read from internal tables YVBPA and XVBPA respectively. These two internal tables are defined and filled in the program SAPMV45A, and to access to their content we need to reference them through the ABAP instruction ASSIGN:

01.
FIELD-SYMBOLS:TYPE table.
02.
FIELD-SYMBOLS:TYPE table.
03.
04.
DATA lv_old_kz VALUE '1'.
05.
DATA lv_new_kz VALUE '2'.
06.
DATA tb_pa LIKE vbpavb OCCURS 0 WITH HEADER LINE.
07.
REFRESH tb_pa. CLEAR tb_pa.
08.
09.
CASE i_xmcvbap-supkz.
10.
11.
** before-image record
12.
WHEN lv_old_kz .
13.
""reference to before-image table
14.
ASSIGN ('(SAPMV45A)YVBPA[]') TO.
15.
IF sy-subrc EQ 0.
16.
tb_pa[] =.
17.
18.
[...]
19.
20.
ENDIF.
21.
22.
**after-image record
23.
WHEN lv_new_kz.
24.
""reference to after-image table
25.
ASSIGN ('(SAPMV45A)XVBPA[]') TO.
26.
IF sy-subrc EQ 0.
27.
tb_pa[] =.
28.
ENDIF.
29.
30.
ENDCASE.
31.
[...]
When users modify the sales rep in an order line item, they can enter the original value again. When this happens, the before-image and the after-image values for the field YYKAM have to be the same. In this case, however, the table YVBPA does not contain the before-image value, so we will need to fetch it from the after-image table XVBPA:
01.
** before-image record
02.
WHEN lv_old_kz .
03.
""reference to before-image table
04.
ASSIGN ('(SAPMV45A)YVBPA[]') TO.
05.
IF sy-subrc EQ 0.
06.
tb_pa[] =.
07.
08.
READ TABLE tb_pa WITH KEY parvw = 'Z1'.
09.
"Z1 is the sales rep's partner function
10.
IF sy-subrc ne 0.
11.
""when user does not change the sales rep, Y- table does not
12.
""contain the partner function Z1, so before-image state has to be
13.
""read from X- table.
14.
ASSIGN ('(SAPMV45A)XVBPA[]') TO.
15.
IF sy-subrc EQ 0.
16.
tb_pa[] =.
17.
ENDIF.
18.
ENDIF.
19.
20.
ENDIF.
Here is the complete example code:

01.
*----------------------------------------------------------------------*
02.
* INCLUDE ZXMCVU02 *
03.
*----------------------------------------------------------------------*
04.
* importing VALUE(I_XMCVBAK) LIKE MCVBAKB STRUCTURE MCVBAKB
05.
*" VALUE(I_XMCVBUK) LIKE MCVBUKB STRUCTURE MCVBUKB
06.
*" VALUE(I_XMCVBAP) LIKE MCVBAPB STRUCTURE MCVBAPB
07.
*" VALUE(I_XMCVBUP) LIKE MCVBUPB STRUCTURE MCVBUPB
08.
*" VALUE(I_XMCVBKD) LIKE MCVBKDB STRUCTURE MCVBKDB
09.
*" VALUE(I_CONTROL) LIKE MCCONTROL STRUCTURE MCCONTROL
10.
*" EXPORTING
11.
*" VALUE(E_XMCVBAPUSR) LIKE MCVBAPUSR
12.
*" STRUCTURE MCVBAPUSR
13.
*---------------------------------------------------------------------------*
14.
*
15.
* See SAP Note 216448 for information on 'before-' e 'after-image'
16.
*---------------------------------------------------------------------------*
17.
18.
FIELD-SYMBOLS:TYPE table.
19.
FIELD-SYMBOLS:TYPE table.
20.
21.
DATA lv_old_kz VALUE '1'.
22.
DATA lv_new_kz VALUE '2'.
23.
DATA tb_pa LIKE vbpavb OCCURS 0 WITH HEADER LINE.
24.
REFRESH tb_pa. CLEAR tb_pa.
25.
26.
CASE i_xmcvbap-supkz.
27.
28.
** before-image record
29.
WHEN lv_old_kz .
30.
""reference to before-image table
31.
ASSIGN ('(SAPMV45A)YVBPA[]') TO.
32.
IF sy-subrc EQ 0.
33.
tb_pa[] =.
34.
35.
READ TABLE tb_pa WITH KEY parvw = 'Z1'.
36.
IF sy-subrc ne 0.
37.
""when user does not change the sales rep, Y- table does not
38.
""contain the partner function Z1, so before-image state has to be
39.
""read from X- table.
40.
ASSIGN ('(SAPMV45A)XVBPA[]') TO.
41.
IF sy-subrc EQ 0.
42.
tb_pa[] =.
43.
ENDIF.
44.
ENDIF.
45.
46.
ENDIF.
47.
48.
** after-image record
49.
WHEN lv_new_kz.
50.
""reference to after-image table
51.
ASSIGN ('(SAPMV45A)XVBPA[]') TO.
52.
IF sy-subrc EQ 0.
53.
tb_pa[] =.
54.
ENDIF.
55.
56.
ENDCASE.
57.
58.
** we take the line-item value unless not present
59.
** in which case we take the header value
60.
READ TABLE tb_pa WITH KEY posnr = i_xmcvbap-posnr
61.
parvw = 'Z1'.
62.
IF sy-subrc NE 0.
63.
READ TABLE tb_pa WITH KEY posnr = '000000'
64.
parvw = 'Z1'.
65.
ENDIF.
66.
67.
IF sy-subrc EQ 0.
68.
MOVE tb_pa-lifnr TO e_xmcvbapusr-yykam.
69.
ENDIF.
4. Implementing the extraction logic for the initialisation run
The code in the EXIT above is only run when a sales document line is created, modified, or deleted (delta process). However, that code is not executed during the initialisation of the delta process, i.e. when all data from setup tables are loaded in BW.

In order for the extraction to take place also during the initialisation run, we need to implement the same extraction logic in the function EXIT_SAPLRSAP_001 (normally used to enhance non-LO transactional DataSources) of the enhancement RSAP0001 (Customer function calls in the service API).

Since we have already implemented the extraction logic for the delta process, we have to make sure that the code we put here is executed only when data are requested in full mode--i.e. when the field i_updmode has the value 'F' (transfer of all requested data), 'C' (initialization of the delta transfer), 'S' (simulation of initialzation of delta transfer), or 'I' (transfer of an opening balance for non-cumulative values, not relevant in our case), but not when its value is 'D' (transfer of the delta since the last request) and 'R' (repetition of the transfer of a data packet):

01.
[...]
02.
03.
CASE i_datasource.
04.
05.
[...]
06.
07.
WHEN '2LIS_11_VAITM'.
08.
DATA: s_mc11va0itm LIKE mc11va0itm.
09.
10.
LOOP AT c_t_data INTO s_mc11va0itm.
11.
wk_tabx = sy-tabix.
12.
13.
*-- The following code must be executed during initialisation only
14.
*-- (the extraction logic for delta update in EXIT_SAPLMCS6_002)
15.
*
16.
** we take the line-item value unless not present
17.
** in which case we take the header value
18.
19.
* only during initialisation
20.
IF i_updmode EQ 'F' OR " F Transfer of all requested data
21.
i_updmode EQ 'C' OR " C Initialization of the delta transfer
22.
i_updmode EQ 'S' OR " S Simulation of Initialzation of Delta Transfer
23.
i_updmode EQ 'I'. " I Transfer of an opening balance for non-cumulative values
24.
* D Transfer of the Delta Since the Last Request
25.
* R Repetition of the transfer of a data packet
26.
27.
SELECT SINGLE lifnr INTO l_lifnr
28.
FROM vbpa
29.
WHERE vbeln = s_mc11va0itm-vbeln AND
30.
posnr = s_mc11va0itm-posnr AND
31.
parvw = 'Z1'.
32.
33.
IF sy-subrc NE 0.
34.
SELECT SINGLE lifnr INTO l_lifnr
35.
FROM vbpa
36.
WHERE vbeln = s_mc11va0itm-vbeln AND
37.
posnr = '000000' AND
38.
parvw = 'Z1'.
39.
ENDIF.
40.
41.
IF sy-subrc EQ 0.
42.
MOVE l_lifnr TO s_mc11va0itm-yykam.
43.
ENDIF.
44.
ENDIF.


 

Available @ Best Practices for Web Intelligence XI Release 3.0 on Top of SAP NetWeaver BI

 

OLAP CACHE

Posted In: , , , . By Srinivas Neelam

Available @

  1. How To… Performance Tuning With the OLAP Cache
  2. OLAP: Cache Monitor - SAP Help

 


 

BI Quick Links: BI Service market place ; BI ABAP and NW SPs ; BI Best Practices

Learning: BI Developer Area ; BI E-Learning



Discuss: BI Forums ; BI Blogs ; BI Articles

How-To's: BI 7.0 ; BI 2004

SAP Help: BI NW 7.0 (2004s) ; BW NW 2004

BI Content: BI 7.0 ; BW 2004

 

Is it required to load data using 2LIS_03_BX datasource to get initialil stock opening balances...!!

2LIS_03_BX --> This structure is used to extract the stock data from MM Inventory Management for initialization to a BW system.

2LIS_03_BF --> This structure is used to extract the material movement data from MM Inventory Management (MM-IM) consistently to a BW system

2LIS_03_UM --> This structure is used to extract the revaluation data from MM Inventory Management (MM-IM) consistently to a BW system. Contains only value changes, no quantity changes.

Before you can extract data for revaluations to a BW system, you must ensure that the transaction/event key is active.
For this, see the following SAP Notes:
· 353042: How To: Activate transaction key (PROCESSKEY)
· 315880: Missing event control after PI-A installation


Usage of BX datasource is depends on business requirement.

Requirement1: For example data getting pulled from R/3 system. It contains 10 years of History Data.
Business requirement is want to see Inventory / Stocks data for last 2 years only.
In this case, to get opening balances can only get through BX datasource and compress WITH Maker update. after that we can load only last 2 years of historic data using BF & UM datasources and compress WITHOUT Marker update.

Requirement2: For example data getting pulled from R/3 system. It contains 2 years of History Data only and entire data needed from reporting.
In this case, we can use BX to pull opening stock balances and compress WITH Marker update and
Pull BF & UM for 2 years of historic data and compress WITHOUT Marker update. Same as above.

OR

Just Pull entire historic data - stock movements (2 years) using BF and UM datasources and compress WITH Marker update . It creates Opening Balances. In this case no need to Load BX datasource.

How To… Handle Inventory Management Scenarios in BW: https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f83be790-0201-0010-4fb0-98bd7c01e328

Drop your doubts as comments.... will get back to you....



 

How to Papers, related to BW direct download

Google
 

Recent Posts

SAP Jobs