Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
105 views1 page

Lookups and Code BI - Prem - (Sap BW Powered Hana)

This document describes a solution for SAP BI developers to easily find lookups and code patterns during development. It allows searching for lookups of a specific data provider across transformations, and finding where patterns like country codes or breakpoints appear in code. The solution works for both BW 3.5 and BI 7.0. It provides sample outputs of transformation lookups and pattern matches to simplify change impact analysis and code reviews. The document also includes the ABAP source code for the program that implements this lookup and pattern finding functionality.

Uploaded by

singhashwini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
105 views1 page

Lookups and Code BI - Prem - (Sap BW Powered Hana)

This document describes a solution for SAP BI developers to easily find lookups and code patterns during development. It allows searching for lookups of a specific data provider across transformations, and finding where patterns like country codes or breakpoints appear in code. The solution works for both BW 3.5 and BI 7.0. It provides sample outputs of transformation lookups and pattern matches to simplify change impact analysis and code reviews. The document also includes the ABAP source code for the program that implements this lookup and pattern finding functionality.

Uploaded by

singhashwini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Process chain Interrupting

Prem-(Sap BW Powered Hana) (Teaching :-(07738888904) search


Process Chain Design
Sidebar PREM.KOLIPAKA
Variable Types in Bex Query

lookups and code BI


Meta chain errors

Brief abstract of the Solution


Time Stamp-error
The solution is intended to help SAP BI Developers / consultants etc to easily find out BI lookups, code patterns etc during development, high level
design, analysis, reviews etc.
Process Chain -Job Sch…
To Be noted

Process chain Restarting - Solution works for both BW3.5 and BI 7.0

- Lookups in ABAP programs, Function modules, BSP applications etc cannot be analysed
Process Chains-3
Scenario 1 : Lookups
Imagine a scenario in which a DSO C is looked up while loading data from DSO A to DSO B and the code for lookup is written in the transformation from
RSPCM-2 DSO A to DSO B. In a complex project there can be multiple transformations that are looking up the same DSO (see diagram below).

Process Chain Email Aler…

Process chain1

1. Remove # (Not Assign…

lookups and code BI 1

Transformations in SAP …

Plant Maintenance 1
Now if a requirement comes wherein we needs to change the structure of DSO C, then we need to manually adjust all these lookup codes accordingly to
ensure that everything is working fine after the change. The analysis will be too difficult because there is no direct way to find out in which all places the
0ANALYSIS_PATTERN DSO is looked up. The solution comes handy in this case. You can execute the program by giving DSO C as input and it will give as output all the
Transformations/Update rules where C is looked up. (see sample screen shots below)

What is the difference be…

'Error loading template 0…

Bex queries outpu… 1

Replace # with empty in t…

Step by Step on Changin…


Sample Output of the program

Changing the Source Sy…

New Functionalities for D…

How to Transport Bex Q…

LBWR

AR

ROOSFIELD-3
In case you need to find the lookups of a master data, then the program should be executed as shown below

ROOSFIELD-2

ROOSFIELD

INDIAN MAP IN XCELSI…

BPC- Architecture

INFOSET IN BI Senario 2: Analysis (finding patterns)

Imagine there is a logic change for the country TAIWAN wherein you need to replace an existing logic with a new logic. You know that in the existing
BPC-VEDEO2 logics, in which all transformations its present, the code will be written in IF clauses with a condition for country Taiwan, but you don't know exactly in
which all transformations the code is present. The solution is useful in this scenario. You can enter patterns and execute the program to find out in which
all transformations(see fig below)
BPC video1

How to create user in SAP

SHORT DUMP IN … 2

ERRORS IN SAP BI

BPC-Deleting an Appset

Scenario 3: Reviews (finding patterns)


BPC-LINKL
The pattern finder functionality is also useful during reviews. On scenario is to find out Break-points that are transported to production accidently which
can adversely affect performance of code sometimes. The pattern finder can be used to find out all the codes in production where break points are left
BPC -Master Data accidently (see fig below)

BPC Introduccion

BPC -Create Custom Me…

BPC -Export BPC Transa…

BPC -When to use the W…

*****************Actual Source Code for the Program********************************************

***********************************************************************
* PROGRAM # LOOKUP_FINDER *
* RELEASE # 1.0 *
* DATE WRITTEN # 04/04/2008 *
* MODULE # BW/BI *
* TYPE # Executable Report *
* Author # Lijo John *
***********************************************************************
* TITLE # Program to find out lookups *
* *
* PURPOSE # The program takes the technical name of a *
* dataprovider as input and displays the *
* Transformations or update rules where it is *
* looked up. The output gives details like source *
* and target of lookup, transformation id, rule id*
* and the line number, It can also be used to *
* find patterns e.g:break-point, *TWD* etc in *
* routines *
* *
***********************************************************************
* LOGICAL DATABASE # N/A *
* FUNCTION KEYS # None *
***********************************************************************

***********************************************************************
REPORT lookup_finder LINE-SIZE 600.

***********************************************************************
***Type pools/Tables declerations for ALV Grid display/selections***

TYPE-POOLS slis.
DATA fcat1 TYPE slis_t_fieldcat_alv.

DATA: BEGIN OF t_display OCCURS 0,


targetname LIKE rstran-targetname,
sourcename LIKE rstran-sourcename,
tranid LIKE rstran-tranid,
routine LIKE rstran-startroutine,
line_no LIKE rsaabap-line_no,
line LIKE rsaabap-line,
END OF t_display.

DATA : input_pattern1(75) TYPE c.


DATA : input_pattern2(75) TYPE c.
DATA : same_source(30) TYPE c.

SELECTION-SCREEN BEGIN OF BLOCK b01 WITH FRAME TITLE text-004.


SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 6(22) text-002 FOR FIELD infoprov.
PARAMETERS infoprov LIKE input_pattern1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 6(20) text-001 FOR FIELD mdobject.
PARAMETERS: mdobject AS CHECKBOX.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 6(20) text-003 FOR FIELD pattern.
PARAMETERS: pattern AS CHECKBOX.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b01.

***Internal table declerations***************************************

TYPES: BEGIN OF t_trans_lookup_finder,


targetname TYPE rstran-targetname,
sourcename TYPE rstran-sourcename,
tranid TYPE rstran-tranid,
routine TYPE rstran-startroutine,
line_no TYPE rsaabap-line_no,
line TYPE rsaabap-line,
END OF t_trans_lookup_finder.

DATA: i_lookup_finder TYPE STANDARD TABLE OF t_trans_lookup_finder,


wa_lookup_finder TYPE t_trans_lookup_finder,
i_trans_lookup_finder TYPE STANDARD TABLE OF t_trans_lookup_finder,
wa_trans_lookup_finder TYPE t_trans_lookup_finder,
i_trans_final TYPE STANDARD TABLE OF t_trans_lookup_finder,
wa_trans_final TYPE t_trans_lookup_finder.

DATA : i(7) TYPE n.


DATA old_cube(20) TYPE c VALUE ' '.
DATA old_source(20) TYPE c VALUE ' '.

***Selections for update rules***************************************

IF ( infoprov NE '' ).

IF ( pattern NE 'X' ).

IF ( mdobject NE 'X' ).
CONCATENATE 'from*A' infoprov '00' '' INTO input_pattern1.
ELSE.
CONCATENATE 'from*p' infoprov '' INTO input_pattern1.
ENDIF.
CONCATENATE '8' infoprov '*' INTO same_source.

SELECT DISTINCT
infocube
isource
b~updid
routine
line_no
line
INTO TABLE i_lookup_finder FROM
rsupdinfo AS a INNER JOIN rsupdrout AS b ON a~updid = b~updid
INNER JOIN rsaabap AS c ON c~codeid = b~codeid
WHERE
a~objvers = 'A' AND b~objvers = 'A' AND
c~objvers = 'A' AND a~objvers = 'A'
AND
b~routine GE 9000.

ELSE.

input_pattern1 = infoprov.

SELECT DISTINCT
infocube
isource
b~updid
routine
line_no
line
INTO TABLE i_lookup_finder FROM
rsupdinfo AS a INNER JOIN rsupdrout AS b ON a~updid = b~updid
INNER JOIN rsaabap AS c ON c~codeid = b~codeid
WHERE
a~objvers = 'A' AND b~objvers = 'A' AND
c~objvers = 'A' AND a~objvers = 'A'.

SELECT DISTINCT
targetname
sourcename
a~tranid
c~codeid
line_no
line
INTO TABLE i_trans_lookup_finder FROM
rstran AS a INNER JOIN rstransteprout AS b
ON a~tranid = b~tranid
INNER JOIN rsaabap AS c ON b~codeid = c~codeid
WHERE
a~objvers = 'A' AND b~objvers = 'A' AND
c~objvers = 'A'.

APPEND LINES OF i_trans_lookup_finder TO i_lookup_finder.

ENDIF.

***Selections for Transformations(start routine)*********************


SELECT DISTINCT
targetname
sourcename
tranid
startroutine
line_no
line
INTO TABLE i_trans_lookup_finder FROM
rstran AS a INNER JOIN rsaabap AS b ON a~startroutine = b~codeid
WHERE
a~objvers = 'A' AND b~objvers = 'A'.

APPEND LINES OF i_trans_lookup_finder TO i_lookup_finder.

***Selections for Transformations(End routine)***********************


SELECT DISTINCT
targetname
sourcename
tranid
endroutine
line_no
line
INTO TABLE i_trans_lookup_finder FROM
rstran AS a INNER JOIN rsaabap AS b ON a~endroutine = b~codeid
WHERE
a~objvers = 'A' AND b~objvers = 'A'.

APPEND LINES OF i_trans_lookup_finder TO i_lookup_finder.

***Selections for Transformations(Expert routine)********************


SELECT DISTINCT
targetname
sourcename
tranid
expert
line_no
line
INTO TABLE i_trans_lookup_finder FROM
rstran AS a INNER JOIN rsaabap AS b ON a~expert = b~codeid
WHERE
a~objvers = 'A' AND b~objvers = 'A'.

APPEND LINES OF i_trans_lookup_finder TO i_lookup_finder.

***Extracting records where lookup code is written*******************

SORT i_lookup_finder BY targetname sourcename tranid routine line_no.

LOOP AT i_lookup_finder INTO wa_lookup_finder.


TRANSLATE wa_lookup_finder-line TO UPPER CASE.

IF ( wa_lookup_finder-line CP input_pattern1 ) AND


( wa_lookup_finder-sourcename NP same_source ).

IF ( pattern NE 'X' ).
APPEND wa_lookup_finder TO t_display.
old_cube = wa_lookup_finder-targetname.
old_source = wa_lookup_finder-sourcename.
ELSE.
APPEND wa_lookup_finder TO t_display.

ENDIF.
ENDIF.
ENDLOOP.

****code to diaplay the data in table/ALV grid format ***************

*MOVE i_lookup_finder[] TO t_display[].

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'


EXPORTING
i_program_name = 'ZBW_LOOKUP_FINDER'
i_internal_tabname = 'T_DISPLAY'
i_inclname = 'ZBW_LOOKUP_FINDER'
CHANGING
ct_fieldcat = fcat1
* EXCEPTIONS
* INCONSISTENT_INTERFACE =1
* PROGRAM_ERROR =2
* OTHERS =3
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'


EXPORTING
i_callback_program = 'ZBW_LOOKUP_FINDER'
it_fieldcat = fcat1
TABLES
t_outtab = t_display
* EXCEPTIONS
* PROGRAM_ERROR =1
* OTHERS =2
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

ENDIF.

Posted 28th November 2011 by Anonymous

Tweet Like 0

1 View comments

khariel☎ 6 August 2012 at 22:14

The reverse area code tool provides you with the ability to find out what you need to know about a telephone number's
area code quickly and easily. Click here for reverse lookup directory.
Reply

Enter your comment...

Comment as: Google Account

Publish Preview

Dynamic Views theme. Powered by Blogger.

You might also like