Quantcast
Channel: SCN : Blog List - SAP Business Explorer (SAP BEx)
Viewing all 103 articles
Browse latest View live

#SAPITNSQ Expert tips, Advanced features, custom techniques, and scheduling options for using Netweaver BEx Broadcaster

$
0
0

This was one of the last sessions of the day at SAP Inside Track Newtown Square (#SAPITNSQ). Special thanks to Laure Cetin for re-recording this session.

In this session, Jeevan Ravindran, InfoElixir provided a "Broadcasting 101" overview, an advanced session, discussed ways around shortcomings, and discussed Security around broadcasting. 

If you are not familiar with Information Broadcasting I highly recommend Eric Schemer's e-learning session - click here.

Why use broadcasting? 

Well, you want to ensure the right information gets to the right people at the right time.

My "Broadcast News" Story
I presented an Information Broadcasting session for ASUG almost 2 years ago.  My experience with it started in 2007, when where I worked at the time we had just gone live with BW.  Our users initially were not happy with the system as the data was not real time.  Then one Friday morning, shortly after go live, I went over to see them, I showed them how to do some simple broadcasts (for only 30 minutes!), and BAM (as Emeril says) they were scheduling broadcasts, doing adhoc broadcasts, all around the company and everywhere.  These broadcasts became a key part of the procurement processes.  I also used Broadcasting to alert myself for data loads from process chains.  Thanks to Information Broadcasting, our BW projects took off and made BW a huge success where I last worked.

Jeevan's Session
That said, Jeevan takes Information Broadcasting to a whole new level and then some in this session.

With basic broadcasting "we" determine the recipients ahead of time by scheduling or ad hoc broadcasting.  We can set up exceptions, filters, and schedules.  Jeevan mentioned that broadcasting by exception is not available from workbooks.

With Advanced broadcasting (which I have not used personally) we can determine recipients from a characteristic or an attribute of a characteristic - e.g. person responsible for a cost center.  He also reviews multi channel broadcasting - for example, broadcasting to e-mail and to the portal at the same time.

He reviews the 4 scheduling options for broadcasts:

Option 1: Immediately after the data load

We can include an "event" in the process chain to only execute the broadcast after a successful data load - this is handy for checking data loads, in my opinion.  Jeevan says to use this sparingly as you could use up system resources by having the broadcasts run all at once.

Option 2: At a pre-determined time slot
You can also schedule broadcasts to run at predefined times using program RSRD_BROADCAST_FOR_TIMEPOINT and schedule the job with prefix TP_BROADCASTING_*

Option 3: You specify the date/time scheduling

Option 4: Using an ABAP program RSRD_BROADCAST_STARTER

Jeevan also reviews Broadcast Monitoring and Administration - confession time - I haven't done, but probably should.  The transaction to do this RSRD_ADMIN you can get via RSA1.  This transaction can also be used to display broadcast schedules using program RSRD_ADMIN_REGISTRATION.  Transaction code RSRD_LOG allows you to display broadcast logs.  The webcast offers utility programs to clean up orphan schedules.  He also reviews how to set up workbook broadcasting setting up the precalculation server.


Jeevan also discusses Information Broadcasting security.  You may want to consider looking at the SCOT transaction so you only broadcast to those within your company's e-mail domain.  Also, if you are not careful, you can broadcast under someone else's ID/authorization - check S_RS_ADMWB.

I hope you can check out this valuable recording; Jeevan is also conducting an ASUG webcast on September 22nd.

Thanks again to Jeevan and Laure for a great session.  Because I couldn't find any pictures of Jeevan at NSQ, here's a picture of Laure, doing heroic work of moderating many sessions that day (photo courtesy of Craig Cmehil's Flickr):

 Laure Cetin

 

Tammy


Dear aBI: When should we phase out BEx?

$
0
0

In response to the "Dear aBI" promotion as part of the SAP BI community, the following are some answers to some of the questions that have been submitted.

Question 1:
BI Wiz from Calgary asks the following:
I work for Oil & Gas industry we are using SAP BW and BEx reporting and there is a new initiative to explore SAP Roadmap and try to use BOBJ tools so I would like to know when SAP is phasing out BEx tool and which tools should we use instead of BEx for SAP ERP as well as SAP BW reporting.


Dear BI Wiz,
According to SAP TechED session BI 102, which you can watch for free, BEx version 7.0 is still alive.  At SAP TechED Las Vegas, there were several comments that "BEx is not dead".  


Here is what was stated at SAP TechED and this SDN link which discusses BEx Maintenance :

"Maintenance:
BEx 7.x continues to be delivered with the next SAP NetWeaver BW releases. Currently there is no planned end of life. The maintenance period is renewed with every major BW release.

BEx 3.5 is part of BW 3.5/SAP NetWeaver 04 and the maintenance cycle is coupled to this release (see SAP note 1410878 - SMP Login required). As BEx 3.5 is also compatible with a BW 7.0 backend and had been delivered with BW 7.0, SAP will maintain BEx 3.5 functionality within BW 7.0 and subsequent releases until the end of BW 7.0 maintenance cycle. Maintenance is not extended with BW 7.30 or other future releases. Please note that full PAM support of BEx 3.5 cannot be granted by SAP - as Microsoft has removed, e.g., support for some components within Windows 7 that had been used by BEx Web Application Designer 3.5. "


Regarding which tools should we use instead of BEx for SAP ERP as well as SAP BW reporting, it depends on what your business use case is. If you are interested SAP's "premium alternative to BEx Analyzer" you may be interested in Advanced Analysis for Office.  At the link provided, we have created several e-learnings for you to familiarize yourself with this product.

 

My personal experience with BusinessObjects Advanced Analysis for Office is that it is easy to use, easy to install, and works great with SAP BW.  Right now it doesn't offer the variant or scheduling functionality but that is slated to come next year with a software patch.

 

At this time, the only BusinessObjects tool that offers ERP reporting functionality is Crystal Reports.  Typical uses for Crystal are for "pixel perfect" formatted enterprise reporting.  Xcelsius SP3 can be used for dashboard reporting with BW (without BusinessObjects Enterprise) if you have BI-Java installed. 


To learn more about when to use when see Ingo Hilgefort's blog page or his personal blog has several interesting links and whitepapers as well.  I also recommend his SAP Press Book, Reporting & Analytics Using SAP BusinessObjects.  This great book offers reviews financial, human resources, and sales requirements and matches them to each BusinessObjects tool.


I also recommend reviewing the BusinessObjects Solution architecture page.  This will help you review the BusinessObjects portfolio as part of your ECC and data warehousing landscape.

Additionally, I suggest contacting your SAP account manager about the possibility of doing a proof of concept for BusinessObjects products.  I borrowed this idea based on an ASUG Annual Conference presentation given by Deb Masdea, Coca Cola.  Below is a sample reporting assessment template that Coca Cola completed when doing their BusinessObjects proof of concept:

 

We hope this helps you in getting starting evaluating BusinessObjects products with BW.

 

Question 2:

Stewals from Ireland asks:

Would you be able to tell me if advanced Analytics is part of the Edge package / will be part of the Edge package please?

Dear Stewals:

I attended an ASUG BusinessObjects Edge webcast in September and asked if OLAP tools were part of the Edge suite and at the time SAP told me "no".  As Advanced Analysis is an OLAP tool, it is likely not included.  I cannot speak to the future roadmap for Edge.

 

"Dear aBI"  gives advice on Business Intelligence to learn more about the Dear BI initiative of the SAP BusinessObjects community. 

 

Tammy

List BEx Analyzer 7.X variables and generate the associated PROCESS_VARIABLES commands

$
0
0

Under BW 3.5, we had developed some Visual Basic macro to set the values of BEx variables for queries embedded in Excel workbooks. This was achieved by writing directly in the BEx repository (sheet SAPBEXqueries). However, this doesn't work anymore with BW 7.X. We haven't managed to use the new BEx Visual Basic API to achieve the same result but found an interesting solution in Lars Hermanns' answer at How to set variables values via VBA..

 

In order to automate the process, we wrote some Visual Basic code to extract the list of variables / values from the BEx repository (XML) and to generate the PROCESS_VARIABLES commands.

 

 

1) List the BEx variables / values by InfoProvider

The procedure is the following:

 

  • Launch the BEx Analyzer and open a BEx query with variable(s)
  • Save the workbook on your local drive (this is required to save the variables' values in the BEx XML repository)
  • Go to the Visual Basic editor (menu Tools > Macro > Visual Basic Editor or press Alt+F11)
  • Insert a new module (menu Insert > Module)
  • Copy / Paste the code below in the new module (also available at https://cw.sdn.sap.com/cw/docs/DOC-148386). This code has been tested in Excel 2003 and Excel 2007.

 

Option Explicit


Dim w As Worksheet
Dim lRow As Long


'
'Create a new worksheet with the list of BEx variables by dataprovider
'Doesn't handle hierarchy variable
'
Sub generateCommand()
    Dim objXML As MSXML2.DOMDocument
    Dim strXML As String
    Dim oNodeList As IXMLDOMSelection
    Dim curNode As IXMLDOMNode
    Dim oList As IXMLDOMSelection
    Dim varNode As IXMLDOMNode
    Dim n As Long, n2 As Long, n3 As Long
   
   
    'Get the BExAnalyzer repository (XML)
    Set objXML = New MSXML2.DOMDocument
   
    'In Excel 2007, Scripts property doesn't exist anymore. We use CustomXMLParts instead
    If Val(Application.Version) >= 12 Then
        strXML = ActiveWorkbook.CustomXMLParts(4).XML
    Else
        strXML = Worksheets("BExRepositorySheet").Scripts(1)
    End If
   
    If Not objXML.loadXML(strXML) Then
        Err.Raise objXML.parseError.errorCode, , objXML.parseError.Reason
        Exit Sub
    End If

    'create a new worksheet to store result
    Call initLog
   
    'List of dataproviders
    Set oNodeList = objXML.selectNodes("//T_DATAPROVIDER/RSR_SX_DATAPROVIDER")
   
    'Process each dataprovider
    For n = 0 To oNodeList.Length - 1
        Set curNode = oNodeList.Item(n)
       
        'Name of dataprovider
        Call writeLog("DATA_PROVIDER", n, curNode.selectNodes("NAME").Item(0).nodeTypedValue)
       
        'BEx commands for variables
        Call writeLog("CMD", n, "PROCESS_VARIABLES")
        Call writeLog("SUBCMD", n, "VAR_SUBMIT")

        'Variables
        Set oList = curNode.selectNodes("REQUEST/VAR/RRX_VAR")
       
        'Process each variable entry
        For n2 = 0 To oList.Length - 1
            Set varNode = oList.Item(n2)
           
            Select Case varNode.selectNodes("OPT").Item(0).nodeTypedValue
            Case ""
               
            Case "EQ", "GE", "GT", "LE", "LT"
                Call writeLog("VAR_NAME_" & n2 + 1, n, varNode.selectNodes("VNAM").Item(0).nodeTypedValue)
                Call writeLog("VAR_OPERATOR_" & n2 + 1, n, varNode.selectNodes("OPT").Item(0).nodeTypedValue)
                Call writeLog("VAR_SIGN_" & n2 + 1, n, varNode.selectNodes("SIGN").Item(0).nodeTypedValue)
               
                'if individual variable
                If varNode.selectNodes("VPARSEL").Item(0).nodeTypedValue = "P" Then
                    Call writeLog("VAR_VALUE_EXT_" & n2 + 1, n, varNode.selectNodes("LOW_EXT").Item(0).nodeTypedValue)
                Else
                    Call writeLog("VAR_VALUE_LOW_EXT_" & n2 + 1, n, varNode.selectNodes("LOW_EXT").Item(0).nodeTypedValue)
                End If

            Case "BT"
                Call writeLog("VAR_NAME_" & n2 + 1, n, varNode.selectNodes("VNAM").Item(0).nodeTypedValue)
                Call writeLog("VAR_OPERATOR_" & n2 + 1, n, varNode.selectNodes("OPT").Item(0).nodeTypedValue)
                Call writeLog("VAR_SIGN_" & n2 + 1, n, varNode.selectNodes("SIGN").Item(0).nodeTypedValue)
                Call writeLog("VAR_VALUE_LOW_EXT_" & n2 + 1, n, varNode.selectNodes("LOW_EXT").Item(0).nodeTypedValue)
                Call writeLog("VAR_VALUE_HIGH_EXT_" & n2 + 1, n, varNode.selectNodes("HIGH_EXT").Item(0).nodeTypedValue)
                   
            Case Else
                Call writeLog("Unknown operator: ", varNode.selectNodes("OPT").Item(0).nodeTypedValue, "")

            End Select
        Next
       
    Next
   
    'Housekeeping
    Set oList = Nothing
    Set varNode = Nothing
    Set oNodeList = Nothing
    Set curNode = Nothing
    Set objXML = Nothing

    Call closeLog
   
End Sub


'
'List the variables by dataprovider in the immediate windows
'
Sub parseXML()
    Dim objXML As MSXML2.DOMDocument
    Dim strXML As String
    Dim oNodeList As IXMLDOMSelection
    Dim curNode As IXMLDOMNode
    Dim oList As IXMLDOMSelection
    Dim varNode As IXMLDOMNode
    Dim n As Long, n2 As Long, n3 As Long
    Dim s As String
   
   
    'Get XML BEx repository
    Set objXML = New MSXML2.DOMDocument
   
    'In Excel 2007, Scripts property doesn't exist anymore. We use CustomXMLParts instead
    If Val(Application.Version) >= 12 Then
        strXML = ActiveWorkbook.CustomXMLParts(4).XML
    Else
        strXML = Worksheets("BExRepositorySheet").Scripts(1)
    End If
   
    If Not objXML.loadXML(strXML) Then
        Err.Raise objXML.parseError.errorCode, , objXML.parseError.Reason
    End If

    'List of InfoProviders
    Set oNodeList = objXML.selectNodes("//T_DATAPROVIDER/RSR_SX_DATAPROVIDER")
   
    'Process each InfoProvider
    For n = 0 To oNodeList.Length - 1
        Set curNode = oNodeList.Item(n)
       
        'Name of InfoProvider
        Debug.Print "DATA PROVIDER " & n & ":" & curNode.selectNodes("NAME").Item(0).nodeTypedValue
       
        'Variables
        Set oList = curNode.selectNodes("REQUEST/VAR/RRX_VAR")
       
        Debug.Print "VARIABLES:"
       
        For n2 = 0 To oList.Length - 1
            Set varNode = oList.Item(n2)
           
            s = ""
            For n3 = 0 To varNode.childNodes.Length - 1
                s = s & varNode.childNodes.Item(n3).baseName & "=" & varNode.childNodes.Item(n3).nodeTypedValue & ";"
            Next
           
            Debug.Print s
        Next
       
        Debug.Print "*************************************************"
    Next
   
    'Housekeeping
    Set oList = Nothing
    Set varNode = Nothing
    Set oNodeList = Nothing
    Set curNode = Nothing
    Set objXML = Nothing
   
End Sub


Private Sub initLog()
    Set w = ActiveWorkbook.Sheets.Add
    lRow = 1
End Sub


Private Sub writeLog(s1 As Variant, s2 As Variant, s3 As Variant)
    w.Cells(lRow, 1) = s1
    w.Cells(lRow, 2) = s2
    w.Cells(lRow, 3) = s3
    lRow = lRow + 1
End Sub


Private Sub closeLog()
    Set w = Nothing
End Sub


Please note that the code is provided as-is and the author assumes no responsibility for issues which arise resulting from its use. Feel free to tweak the code if needed.

 

  • Declare a reference to the Microsoft XML library (menu Tools > References... and choose Microsoft XML, vX e.g. Microsoft XML, v6.0)
  • If not displayed, open the Immediate Windows (menu View > Immediate Window)
  • Run the macro parseXML (menu Run > Run Sub/UserForm)
  • The list of variables / values by InfoProvider is displayed in the Immediate Window

 

 

2) Generate BEx commands

The procedure is the following:

 

  • In the Visual Basic Editor, run the macro generateCommand (menu Run > Run Sub/UserForm)
  • The list of BEx commands is generated in a new worksheet

 

image

  • Go to BEx Design mode and add a button
  • Add a reference to the generated commands

 

image

 

NOTES:

  1. You may have to adjust manually some variables' values in the generated worksheet (e.g. add single quotes in front of dates, adjust dot or comma wrongly interpreted as decimal separator by Excel)
  2. The macro doesn't handle all types of variables e.g. doesn't handle hierarchy variables

 

If you want to be able to access the macro without having to copy / paste the code each time, you can create an Excel Add-In. To do so:

  • Create a new Excel workbook
  • Copy / paste the above VBA code in a VBA module
  • Add a reference to Microsoft XML
  • Save the workbook as an Excel Add-In (menu File > Save As... and choose XLA file type). Do not save the Add-In in the default AddIns directory because BEx Analyzer seems to ignore these Add-In (use another directory instead e.g. My Documents)
  • Close the file
  • Install the Add-In (Tools > Add-Ins... and choose Browse... to select the XLA file).

 

Note that by default Excel Add-Ins are NOT loaded when you launch BEx Analyzer. See SAP note 1329403 - BExAnalyzer.exe does not load addins compared to Excel.exe to fix the issue.

 

 

Afterword

Some additional information based on the comments made below:

 

1) If the workbook is compressed, you’ll have an error message when the macro tries to parse the XML code. To solve the issue, click on the Workbook Settings icon in the BEx Design Toolbox toolbar (also available by choosing Design Toolbar > Workbook Settings in the BEx Analyzer menu) and make sure Use Compression When Saving Workbook is unchecked.

 

wbkcompression.jpg

 

2) The Visual Basic macro assumes that your Excel file is in XLSX format if you’re using Excel 2007 or above. If the file is saved in XLS format under Excel 2007 or above, the macro won’t work.

How to create Pop-up with system messages in WAD

$
0
0

When I built for my customers WAD with IP functionality, I faced with request to create Pop-up window with FOX and System Messages where user have to respond (Click OK Button).

In this post I will explain how to convert standard System Messages List to Designed Pop-up in WAD 7.

  1. Put System Message List  component on the bottom of the wad, when its technical name is MESSAGES_LIST_ITEM_1.
  2. Put this little CSS code inside HEAD before </head> TAG:

<style type="text/css" >.alertMessage{ font-size: 9pt; font-family: arial; color:#000000; font-weight:normal;}.alertBoxStyle{ cursor: default; filter: alpha(opacity=95); background-color: #FFFFFF; position: absolute; top: 200px; left: 200px; width: 100px; height: 50px; visibility: hidden; z-index: 999; border-style: groove; border-width: 1px; border-color: #FFFFFF; text-align: center;}</style>

 

This code is defines Message Box Style and you can change it.

 

  3. After <Body> Tag insert this code:

<div id="alertLayer" class="alertBoxStyle" >test</div>

This is Message Box object, when wad is initialized this object is hidden ( see alertBoxStyle code).

  4. Now add JavaScript Object inside WAD and write this code:

/*this two lines says to WAD on Load and in every change to do getSystemMessages Function*/

 

  1. document.onchange=getSystemMessages();
  2. window.onload=getSystemMessages;

 

 
 

 

//this function Hide Alert (after user will click OK)

function hideAlert()

{

                alertBox=document.getElementById("alertLayer").style;

                alertBox.visibility="hidden";

}

 

 
 

 

 

//This Function Create Message Box Object

//In this Function when I Create Button I use for it standard SAP CSS Style urBtnStd

 

function makeAlert(aTitle,aMessage)

{

                var inner;

                if(document.getElementById("alertLayer"))

                {

                                alertBox=document.getElementById("alertLayer").style;

                                inner="<table border=0 width=100% height=100% cellspacing=0>"+"<tr height=27><td class="urTrcHdTrn">";

                                inner=inner+"<div class=urTrcTitHdr>"+aTitle+"</div></td></tr>"+"<tr height=5><td width=5></td></tr>";

                                inner=inner+"<tr><td class=alertMessage>"+aMessage+"<BR></td></tr>";

                                inner=inner+"<tr hegiht=5><td width=5></td></tr>";

                                inner=inner+"<tr><td align=center><input type=button value=' OK ' onClick='hideAlert()' class=urBtnStd></td><tr></table>";

                                document.all.alertLayer.innerHTML=inner;

                                aWidth=600;

                                aHeight=250;

                                alertBox.width=aWidth;

                                alertBox.height=aHeight;

                                alertBox.left=(document.body.clientWidth-aWidth)/2;

                                alertBox.top=(document.body.clientHeight-aHeight)/2;

 

                                alertBox.visibility="visible";

                }

}

 

//this function gets all system messages and transferred them as is to makeAlert function.

function getSystemMessages()

{

                var MESSAGE_LIST_ITEM='MESSAGES_LIST_ITEM_1';

                var MESSAGE_LIST_ITEM_BLOCK= MESSAGE_LIST_ITEM+'_AcMess_mrx';

                var MESSAGE_LIST_ITEM_FIELD= MESSAGE_LIST_ITEM+'_BiMessageItem-txt';

                var msgBlock = document.getElementById(MESSAGE_LIST_ITEM_BLOCK);

                if(msgBlock!=null)

                                makeAlert("System Message",msgBlock.innerHTML);

}

 

That’s all

 

And this is Result in my testing system:

 

PopUpBlog.jpg

You can see that Button and Message Box Header have a SAP design and also SAP standard links on messages work properly.

http://digilov.blogspot.com/2012/03/how-to-create-pop-up-with-system.html

Problem with performance of BW

$
0
0

Hi,

 

I have a problem with the perfomance of BW. Every day in the morning, the BW it's very slow, probably because many users are consuming the Sales Infocube when they generate reports in Sap BEX, but there are a BO user that consume resources  of this infocube too. Everyday this user is scheduled to extract data from BW to BO starting at 3:00 AM and in transaction st22 always have dumps for this user. This dumps generally are Time Out or not enough space in memory to complete the task.

 

The BW Server has 16GB RAM.

 

Could you give me ideas to solve this problem?

 

Regards,

Hans Ortiz

Tips to work on a SAP BEx Query

$
0
0

1.  Working on a BEx report without entering the BEx Query Designer

 

        Info : Here we can create conditions & filters without the need of Query Designer

 

        Steps:

 

Use Tcode: RSCRM_BAPI

Select, Find & Execute the Query

Create New Conditions & Filter OR change existing.

 

1.jpg

2.  Usage of Enhanced Menu in BEx reports

 

     Info : Details regarding the definition of a keyfigure of which it is made up of can be easily found with the usage of Enhanced Menu option.

 

    Steps :


     TCODE : RSRT

     Execute Query

     Click on the KF.

     Select ‘Enhanced Menu’ & then “Keyfigure Definition” to know the entire details of the particular keyfigure selected.

2.jpg

3.jpg

ABAP Code for providing dynamic name for Report to the Query based on input values

$
0
0

WHEN 'TEXT VARIABLE mentioned in the query description'.

data : Var1(n),   *corresponding input variable in query = ZP_VAR1*

       Var2(n),        *corresponding input variable in query = ZP_VAR2*

       Var3(n),        *corresponding input variable in query = ZP_VAR3*

       Var4(n),        *corresponding input variable in query = ZP_VAR4*

       fyear(n),       *corresponding input variable in  query  = 0P_FPER1*

       title(n).

read table i_t_var_range INTO s_t_var_range with key vnam = 'ZP_VAR1' .

if s_t_var_range-LOW is not initial .

Var1  = s_t_var_range-LOW.

endif.

clear s_t_var_range-LOW.

read table i_t_var_range INTO s_t_var_range with key vnam = 'ZP_VAR2' .

if s_t_var_range-LOW is not initial .

Var2  = s_t_var_range-LOW.

endif.

clear s_t_var_range-LOW.

read table i_t_var_range INTO s_t_var_range with key vnam = 'ZP_VAR3'.

if s_t_var_range-LOW is not initial .

Var2  = s_t_var_range-LOW.

endif.

clear s_t_var_range-LOW.

read table i_t_var_range INTO s_t_var_range with key vnam = 'ZP_VAR4' .

if s_t_var_range-LOW is not initial .

Var4 = s_t_var_range-LOW.

endif.

clear s_t_var_range-LOW.

read table i_t_var_range INTO s_t_var_range with key vnam = '0P_FPER1' .

if s_t_var_range-LOW is not initial .

fyear = s_t_var_range-LOW.

endif.

clear s_t_var_range-LOW.

concatenate Var1  Var2  Var3  Var4 '' fyear into title  separated by space.

CLEAR: L_S_RANGE.

L_S_RANGE-SIGN    = 'I'.

L_S_RANGE-OPT     = 'EQ'.

L_S_RANGE-LOW     = title.

APPEND L_S_RANGE TO E_T_RANGE.

CLEAR L_S_RANGE.

ENDCASE.

e.g.

if,

ZP_VAR1 = Australia

ZP_VAR2 = Sydney

Fiscal year  = 2012

Then

Report name = Australia  Sydney 2012

Customer specific adjusting of BEx web-based variable screen

$
0
0
  See also german original Blog
ppt-icon.gif
1 Introduction
The possibilities ofadaptationofa web-basedreportdialog variableswere previouslyrestricted.About parameters of theWebTemplateandusing theWeb Design APIthatcan be chargedaffects the behavior ofWeb Templatesin the variablesbutnotthe layout and processing logicof the input
SAP_Standard_Variable_Dialog.png
Figure 1.1: SAP Standard Variable Dialog
With patchNW730BIJAVASP08Patch30 (see alsoNote1622306),
SAP offers a possibilitythe layout and processing logicfor the following dialogueswith respect to variable processingto adapt:
  • Variables
  • Dialogue
  • Filter
Forcustomer-specific adaptationof thevariablesdialog, two alternative routes are available:
  • Customizedformattingandpositioning
  • Customer-specificlayoutandprocessing logic
The principle ofimplementation is the same forall kindsof adjustment.Abouta Web itemtypesofIndividual expansion of theBEx Webruntime,an HTMLand /orJavaScript code segment(Snipplte) is passed. TheBEx Web runtimereplaces thestandard SAPcodepassed by thecode segments. Thus,theBEx Web runtimeperforms thisreplacement process, certain conditions must be met. I goevenfurther downinto the detailsof theimplementation.

2     Customizedformattingandpositioning

The first wayis to adjustthe variable dialogcustomized,positioningtothe individual elementsof thevariablesdialogcustomized.For determining the positionsof the individual elementscan be anyHTMLtags are used.For the individual elementsarepatterns(pattern) are available which can be placedwithin acustomizedHTMLtext.
The following itemsare available:
  • Areavariants
  • Areaersonalize
  • Eachvariableof the report
  • OK-Button
  • Check-Button
Thepattern will beplaced as acustom XML tagsincustomizedHTMLcoding. TheBEx Webruntime environmentrecognizes thepattern and replaces them withthe necessary coding.
Figure 2.2 showsin(1)a customdialog variablesinthe areas ofpersonalizationoptionsandwere just like theOK buttonandcheckpositioned similar to the standardvariable dialog.
The variables weredivided intotime-relatedvariables, andnottime-relatedvariables. Tobetterhighlight this structureforeach type,a separate groupwas formed.
customer_individual_variabledialog.png
Figure 2.1:Customer-specificformatting andpositioning
Adjustmentin (2)illustrates the useof more complexHTML components.Here, only the time-relatedvariablesshown directlyand all othervariablesare hiddenon atray. This allows thevariable dialogforreports with a lot ofvariablesto bemade ​​clearerand thustheease of useincreased.
 
The implementation of thecomponenttrayusedhereis purelyonHTML andJavaScript,and needsnoround-trip.
This representationcould be achieved through apersonalization thatcouldnotbe controlled centrally.
 

3     CustomerIndividualVariabledialog

 
Another optionisto adjustthe variable dialogto makethe layout andprocessing logicfor each variableindividually customized.
In this variantisnotthe SAPstandard HTMLcodingof the entirevariablesdialogue replaced bycustomer-specificHTMLcodingbut only the ranges for theinputvariable values. In theVariables dialogin Figure 3.1, the SAP standardHTMLcoding for the two variablesCURRENTPREVIOUSYEARPERIOD
YERAPERIOD andwas replaced bycustomizedHMTL code.
customer_individual_variabledialog_2.png
Figure 3.1:Individualcustomer’svariablesdialog
Forthe example implementationshown in Figure 3.1has been depositedadjacent to thesurfacefor the input ofavery specificperiodstill additional JavaScriptcode, through which a function of the twovariables and PREVIOUSYEARCURRENTPERIODYEAR PERIODwas implemented.
Validation and adjustmentof variable values
When entering avalue for aperiodof two variablesis automatically checked whether the variable valueof the other period, according tocustomrules, is still
valid.
This is not thecase; the valueis adjustedaccording to the rulesdirectly.
Such validationandadjustmentis not possiblewithout this extension, since it is inthe customer exitinI_STEP3is not possibletooverride the valuesof the user.
Analogous to theimplementation of a customizedvariablesdialoguemustalso be replacedby aWeb itemtypesfromindividualextension of the SAPstandardHTMLcode. In this variant,for each variable ofa Web itemtypes mustIndividual expansioninWebTemplatebe deposited.
 
For theimplementationof customHTMLcode forsomeHTMLelements are alsopatternsprovided. Forthese HTMLelements arepatternsavailable:
  • Input Feld
  • Dropdown-Box
  • Label
     
Thepatternis used to facilitatethecreation of a portallayoutcompliant HTMLcode, but they are notto use it.
 
Some properties of theextensioncan be customizedvia parametersfromtheWeb item typeIndividual expansioninWebTemplate.
 
For eachextensionthe BEx Webruntime environment adda standardvariableinput fieldautomatically into the layout. AbouttheWeb item parameters, you can control whether the input fieldshould be displayedabove or below theuser-definedlayouts.

Standardinput field

Using JavaScript, it is also possible tohide the standardinput field.Important isthatit is availablewithin the HTMLpage. Also, the button for theF4 helpcan be hiddenusing JavaScriptif itis not needed.

 
The aim of theimplementation is tofillthis fieldwith thevariable value.
 
Layout

In the current version you some adjustments at the layout ofare necessary.Thisapplies, for example, the width of thedialog variables; the heightof the row ina customer-specificadaptationisembedded. Positioning of thestandardinput fieldfor the variable value.

   

4     CustomizedF4and filterdialogs

 
Another way ofdisplaying variablesisthecustomer-specific adaptationof the F4andfilterdialogs. Figure 4.1 showstwo different implementations ofanF4input helpdialogfor the variableZTK_0I0DAYS. In the above example, the values ​​are displayedwitha reference period.

Dependencies betweenvariables

TheF4 helpdialogis usedexplicitlyfor a variable.In this variant,it is not possibleto influencethe values of anotherwith. Technically, thedialoguecontains
an extra fieldthat contains the value of the variable.This field iscloselyassociated with the variable. The value of thisfield is passedwhen you close thedialog via theOK buttonof thedialog variablesforexactly that variable. Theextension replacesonly theHTMLcodewithin the F4 helpdialog.

 
customer_individual_F4_and_filterdialog.png
Figure 4.1:IndividualcustomersF4and filterdialog
For eachdialogue hasits ownWeb itemtypesofIndividual expansioninWebTemplateprovided. Here it is possibleto reusethe implementation.Youwantan individualF4 helpdialog forvariable0I_CALMONTH(based on 0CALMONTH) Implement. At the same timeyou want, however, that if the userin the reporta filter to thefeature0CALMONTHapplying thefilterdialog hasthe analogousbehaviorastheF4 helpdialog. You can
do this
intheWeb itemyouboth use the sameimplementation class. It is equallypossible to implement different dialogues
.

5     Implementation

The implementationof all theextensions describedaboveis alwaysthe same principle. Figure 5.1shows the architectureof the individualextensions.
Architecture_SAP_Standard.png
Figure 5.1: Architecture – SAP Standard
The number ofimplementations of theWeb itemtypesofIndividual expansionmay increasedue to the manypossible combinationsquickly. Toevery implementation of aWeb itemtypesof Individual expansioneverheardan implementingABAP OOclass.
 
Using aBAdI, the different implementationsto be better organizedand structured.It also providestheadvancedarchitecture ofthe BAdIframework
the ability to createtemplatesthat simplify theimplementationcostsof newimplementations andgreatlyshorten.
Additionally, afallbackimplementationis storedin the eventthat an implementationis not available.
Architecture_SAP_Standard_with_BAdI.png
Figure 5.2: Architecture - SAP standard with BAdI

All about I_t_var_range table.

$
0
0

Hi

 

This blog describes about the I_T_VAR_RANGE table.

 

 

All about I_T_VAR_RANGE  tables:

-----------------------------------------------------------------------------

This  table is used to fetch the data given by the end user in the variable whenever we execute the report.

Let's say we have MTD report, in this report we will pass the date as the input.

Whenever we pass the date in the variable screen , the date value is stored in the I_T_VAR_RANGE  table.

The various fields present in this table are

LOW, HIGH, OPT, SIGN

Low: Whenever we pass the single value in the variable screen , by default that value is stored in the LOW field .

High : Whenever we pass the range values , the first value is stored in the low field and last value is stored in the high field of I_T_VAR_RANGE internal table.

OPT: The various option for the OPT are EQ,BT,NE etc..

SIGN : The various option for the SIGN is I,E.

Now our requirement is to create the MTD report.

MTD report will displays the output starting of the month till the user input date. Let say the user has given the input date as 20130328, Then MTD report should display the data starting from the first date of that month ( 20130301) till the user input date.

So in this scenario it has to display the output starting from the range 20130301  to 20130328.

Here the user will give the date as 20130328  in the variable screen, now this value is stored in the I_T_VAR_RANGE internal table. If we want to fetch the data from the table , then we have to create work area, as shown below.

data wa like line of i_t_var_range.

Now we can able to retrieve the data from the internal table as shown. Since the user has given one value , by default the value is stored in the LOW field of I_T_VAR_RANGE internal table.so now the data from that table will be retrieved as shown below

 

 

data : ref_date type d,

          first_date type d,

          last_date type d.

 

ref_date = wa-low. " wa-low will fetch the data from the low field of the I_T_VAR_RANGE table.

                                    "now ref_date will hold the data 20130328.

 

first_date = ref_date.

first_date+6(2) = '01'. " In the first date we should get the first date of that month.

last_date = ref_date. " In the last date we should get the user input date.

 

wa-low = first_date.

wa-high = last_date.

wa-sign = 'I'.

wa-opt = 'BT'.

append wa to e_t_range.

 

 

 

Now whenever you execute the report, it will display the MTD report.

 

Hope you got it,

 

 

 

 

 

Regards,

RaviChandra.

BEx-Userexits reloaded

$
0
0

After the initial release of the BI-Tools framework for BEx-Exitvariables in Easy implementation of BEx-Userexit-Variables I got a lot of useful comments and suggestions. And finally, I realized, that I omit a detailed discussion and implementation of the I_STEP 3 ( check after variable-screen ).

 

Please read first my first blog, because there are a lot more informations about the process and the variable implemenation. This blog talks mostly about experiences and refactoring.

 

Existing experiences

I have talked to some people, which are using this framework and I have seen some other implementations based on BADI or function modules.

 

When introducing the object-oriented approach, you can obtain some advantages:

  • Traceability: Every Variable is clearly defined and can be relocated very fast ( without scanning a lot of ABAP coding)
  • Self-documenting Implementation: The variable-interface has been defined for an easy use and not for encapsulating the technical customer-exit interface
  • Reusablitiy: Reduce variable code by inheritance and specify only the necessary code within your concrete variable
  • Stability: If one of the variables has a failure, just this coding is not usable. If you have another approach like includes or big function-groups, this is not guaranteed by default.
  • Testability: Using ABAPUnit with ABAP OO-Bex-Variables is very easy and efficient.

 

The usage of the BEx-Variables framework has also shown, that an object-oriented approach is easier than plain function modules, if a clear interface is used. I found one example, where even young developers without a lot of development knowledge implemented BEx-Variables.

 

Why reloaded?

 

The original implementation has two problems:

  1. The I_STEP = 3 has been implemented as "normal" variable instance and so it has not been very much possiblities to configure and implement this for special queries/infoproviders. This leads to the situation, that all coding has been implemented in one variable-class which handled a lot of different use-cases (and this has not been the original idea of "Separations of concerns").
  2. A spelling mistaked has been slipped into the naming of the methods - so this could lead into a misunderstanded usage when implementing authority-variables.

 

So, I enhanced the existing solution and perform a small but effective refactoring. The actual code is checked into code-exchange and can be installed via SAPLink.

 

Refactoring

Instead of having one interface, which implement all steps, I decided to split the existing variable-interface into two interfaces:

 

  • The existing variable interface - without step 3 ( and renaming method for i_step = 0)
  • A new check-interface handling I_STEP = 3

 

A short look into the UML-structure:

 

Auswahl_015.png

 

As you may notice there is another new class called "ZCL_BIU001_CHECK_COLLECTION". This has been necessary, because a check can be resolved through a infoprovider assignment or a special query. Within the new customizing it is possible, to define checks based upon those two criterias. Not enough: these parameters could be configured as pattern-based parameters, so you can specify a special check for a class of queries / infoproviders.

 

Details

In the following, I will show the main changes.

 

Variable-Interface (BTW: I love the new corbu design - well done )

Auswahl_008.png

 

Check-Interface

Auswahl_009.png

 

Additional, the variable-include has been enhanced (a little bit ;-) ):

 

*&---------------------------------------------------------------------*
*&  Include           ZXRSRU01
*&---------------------------------------------------------------------*


DATA:
  lcx_exception  TYPE REF TO zcx_biu001_execution_failed,  lc_check       TYPE REF TO zif_biu001_check,  lc_variable    TYPE REF TO zif_biu001_variable.
TRY.
* Special treatment of check in i_step = 3    IF i_step <> 3. "Sorry for this...
* Every variable is encapsulated through an atomic instance      lc_variable = zcl_biu001_var_factory=>get_var_instance( i_vnam ).      IF lc_variable IS BOUND.        lc_variable->initialize(            i_vartyp   = i_vartyp            i_iobjnm   = i_iobjnm            is_cob_pro = i_s_cob_pro            is_rkb1d   = i_s_rkb1d            i_periv    = i_periv        ).        CASE i_step.          WHEN 0.            e_t_range = lc_variable->authority_check( ).          WHEN 1.            e_t_range = lc_variable->before_variable_screen( ).          WHEN 2.            e_t_range = lc_variable->after_variable_screen( i_t_var_range ).        ENDCASE.      ENDIF.    ELSE.
* Check the variables via a check-instance. If more than one instance is available,
* a collection is automatically used.      lc_check = zcl_biu001_var_factory=>get_check_instance( i_s_rkb1d ).      lc_check->value_check( i_t_var_range ).    ENDIF.  CATCH zcx_biu001_execution_failed INTO lcx_exception.    CALL FUNCTION 'RRMS_MESSAGE_HANDLING'      EXPORTING        i_class  = lcx_exception->if_t100_message~t100key-msgid        i_type   = rs_c_error        i_number = lcx_exception->if_t100_message~t100key-msgno        i_msgv1  = lcx_exception->if_t100_message~t100key-attr1        i_msgv2  = lcx_exception->if_t100_message~t100key-attr2        i_msgv3  = lcx_exception->if_t100_message~t100key-attr3        i_msgv4  = lcx_exception->if_t100_message~t100key-attr4.    RAISE no_replacement.
ENDTRY.

 

 

Customizing

The customizing has been changed, so that there are two customizing tables: One for the variables and one for the checks.

Auswahl_013.png

 

Auswahl_011.png

I would suggest to use them together in one view-cluster. And if you defined the views, think about the DDIC capabilities like search-helps, maintenance-views, foreign-keys. Through the usage of ABAP Interfaces, it is possible, to check at customizing time, if a class implements the correct interface!

 

Conclusion

I use the described framework intensively and I like the simple usage and the fact, that the original very technical calling has been hidden by two suitable interfaces.

 

All the coding and documentation will be found within the code-exchange area "BI-Tools": https://cw.sdn.sap.com/cw/groups/bi-tools. Please do not hesitate to join or ask any questions about implementation details or how to install it. I have attached the current nugget to this blog.

 

Have fun!

SSO for BW ABAP to JAVA

$
0
0

I have configured SSO between my sap bw abap stack and java stack.

 

 

I have logon to SAP BEX designer with user name and password and when i was tyring to executive BEX query in new portal session it is again asking my user name and password to run report in netweaver portal.

 

Is there any other way to prevent this.

 

 

SSO working in this way:

 

Logon to portal /irj-->system administration--> support-->sap applicaiton-->sap transction-->select system (BW)--> enter abap tcode --> with out abap user name it will directly taking me to abap system.

Bex query: formula variable using Replacement path

$
0
0

Bex Query: Formula variable using Replacement Path:

 

We can create formula variable at the bottom of the available operands (key figures listed).

Then assign it to a calculated key-figure or local formula.

 

slide24.png

Requirement1: To calculate Sales per No. of seats.

 

Sales value is coming as key figure

No. of seat(characteristic) is attribute of Profit Center and has data-type as NUMC length (4).  

We can not use characteristics in the calculated key figures or in the local formula.

and We need to get the attribute value w.r.to characteristic value of Profit Center (0PROFIT_CTR).

We will convert it into number using formula variable.

We have selected ref. char. as Profit Center and attribute as No. of Seat.

 

 

slide20.pngslide21.png

 

slide22.pngslide23.png

 

 

No of seat has mapping with profit center. We will do exception aggregation with profit center.

Now we can use this CKF to get Sales per Seat.

 

slide13.png

slide14.png

slide11.png

 

Another Scenario: Requirement2:

1.  

         To get term in days = Maturity date(End of Term) – Start date. Where dates are available as characteristics.

         We can create formula variable using replacement path and data-type as date. Create one formula variable for Maturity date and one for Start Date.

         Note the info-object in the reference characterisitcs of general tab.

         for e.g.: total term period, remaining term period can be required in case of Insurance where we have Maturity date,

             start term date, As-of date(evaluation date).

 

    slide07.pngslide08.png

slide09.pngslide10.png

 

Either create Calculated key figure or create a local formula (key-figure Section) to get term in days.

 

slide16.png

 

slide17.png

 

slide19.png

 

 

 

In I    In Requirement1: we have converted info-object:attribute value to number,

        In Requerement2: we have converted Info-object:key value to date.

     

 

       thanks& regards,

       Vikas

 

      ---

 

 

In

RSRTQ – Query Definition – Multipurpose T-Code on BEx Queries

$
0
0

Our SCN fellow consultants are already briefed about RSRTQ, on how-to and when to use. Even though I would like to share my experience with this blog, to thank SAP and give back some useful real time scenarios to forum (especially for new SAP BW Consultants).

 

               For all BW consultants, BEx queries are integral and main part of their job. As all of you know, user always interested to see the reports and get the data according to their requirements. So we all include complex logics at BEx query level. In terms of

  1. Customer exits,
  2. Variables,
  3. Restricted Key Figures (RKF), Calculated Key Figures(CKF),  Query level Selections and Formulas
  4. Cell level calculations (each cells will have CKF/RKF OR IF..ELSE logics) List will go on.

Let's restrict on these 4 items and allow me to brief the scenario with business/project requirement.   

     

Take example of 100 Management Reports and 180+ Financial Reports for different group of users. Data submission happens by versions (ex: Monthly, Quarterly, Half Yearly, Yearly [Actuals and Forecasts], Quarterly Finance Actuals, Finance Adjustments)

 

On every year there are changes at organizational level

  • Changes on Data Submission version ( new versions, Monthly version become Quarterly and vice versa)
  • Changes on their products and product category.
  • Finance is quarterly reporting, few reports have variables w/o customer exits to default the Fiscal Year and Period to previous quarter.
  • Calculation of measure and its formula always changing.

So every time we will have to change the reports

  1. To show new products in current year and old products in old year, both should come under same Product Category.

             --> So we have IF Else logic to show right products and aggregate to same Product Category.

   2. In Management Reporting, the report should show (Monthly/Quarterly) Actuals and Forecasts dynamically based on user input OR by system date.                  For ex: If the Monthly version becomes Quarterly, user wants to see the old year data in by Month and current year by Quarter.

             -->We have used extensive cell level logics to meet the above requirements.

   3. In Financial Reports, Every quarter we asked to manually change the Period and Year to Previous Quarter in all Reports (many reports are not having      

       customer exits for specific reasons).  --> We used to change manually.

 

Along with above, a very good task given to us to look at each report and reduce the number of reports. In other words, simplify the reports (either by merging / to give base report).


          Let me be clear and stick to the point of using RSRTQ and not discuss on the design OR solution to the above points :-)

The main problem is to check all reports every year and analyze what is the old formula and its impact, find the customer exits (on all places of query). But it become easy now

 

Enter RSRTQ T-Code,

RSRTQFirst.jpg

Once you get above screen, enter query technical name in first box and select desired ‘Output Options’. In my case I would like see all since we have to check the formulas, variables.

Check ‘Show Properties’ in Additional Output to know the processing type (to identify customer exits). Then click on execute, this will take into details.

 

Filter Section


RSRTQFilter.jpg

This section gives you all information about the filter, it was helpful to me to identify the Hardcoded objects (ex: PH as shown).

There are cases where many hardcoded character restriction at query; which is causing ‘Yearly Maintenance’. Using this it was easy to find and replace hardcode restrictions with variables for all reports within less time.

 

Rows & Columns

Below screen shows the Formulas & Selection used in Rows & Columns, this was helped me to identify the formulas in reports which are to be changed ; when the calculation was changed for measures (ex: Capital Turnover).

Also it is easy to find in all places of the query at one go, otherwise it is difficult to find in Query Designer. In many cases you may forget/skip/overlook the change either in Rows/Columns

 

RSRTQRows.jpgRSRTQColumns.jpg

 

Important thing is ‘Cell level Definition’, Imagine you have more than 50 cells and needs to change the formula/version in many places. RSRTQ showing cell level information as a single document helped me a lot to analyze and change required cells at one go.

 

RSRTQCells.jpg

Variables

By selecting ‘Additional Output’ - Show Properties, you will be able to see details of variables. Below screen shows ‘default values’ and type of variable.

This option helped me to change the variable values in Financial Reports. We have downloaded all 180 query definition and saved as excels, prepared the list of report which requires manual change and which has customer exits (changes automatically).

RSRTQVariables.jpg

Apart from the above,

 

  • It helped to analyze the Structures, Characteristics, Key Figures of each report as documents (.xls) and merge the redundant queries. As a simplification of Financial Reports(180 queries); we have merged 60 queries into two queries, and created 60 views (based out of two queries). Later these delivered as workbooks to users.
  • It will help you to understand and debug the formula (either in Cell Level/Rows/Columns) especially when the report is huge.
  • We have used it extensively to compare query between two systems.

 

Comparison of query explained in below by Pushkar Dhale

http://scn.sap.com/community/data-warehousing/netweaver-bw/blog/2013/04/17/compare-bex-queries-in-different-client-system

 

Aparna Duvvuri explained scenario of transport issue on Query

http://scn.sap.com/docs/DOC-26063

 

Shanthi Bhaskar explained RSRTQ in below

http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/14329

 

Once again Thanks a Ton! To SAP for giving a powerful T-code like RSRTQ.

And special thanks to Pushkar, Aparna, Shanthi to put more light on this.

 

Hope it helps!

 

Thanks,

Umashankar

 

Related Contents

http://help.sap.com/saphelp_nw04s/helpdata/en/1e/99ea3bd7896f58e10000000a11402f/frameset.htm

http://help.sap.com/saphelp_nw04s/helpdata/en/f1/0a5673e09411d2acb90000e829fbfe/frameset.htm

New BAdI RSROA_VARIABLES_EXIT_BADI (7.3)

$
0
0

This bloghas only been translatedinto English, theoriginalblogcan be found here: http://eKessler.de

 

For examination and manipulation of exit variables previously only available extension RSR00001 (Customer Exit Global Variables in Reporting), transaction SMOD, available. Can use the function module EXIT_SAPLRRS0_001 here at run time (execution time of a report) using ABAP programming accessed the variable values, and these are adjusted if necessary. The function block EXIT_SAPLRRS0_001 calls the include ZXRSRU01 which is in the customer namespace.

As part of the processing must be made next to the name of the variable (I_VNAM) nor the execution time (I_STEP). This double nesting quickly leads to confusing and unstructured code. Typical approaches are here:
■ · Using two Nested CASE (I_VNAM and I_STEP) instruction
■ · Combination of CASE (I_VNAM) and IF ELSEIF (I_STEP) instructions
■ · Outsourcing of source code through the use of includes, function modules, dynamic, dynamic method calls in ABAP OO classes
■ · ...

With BW 7.3, SAP delivers the BAdI RSROA_VARIABLES_EXIT_BADI (BADI to fill variables). The BAdI is the Customer upstream exit, that is, the calls the BAdI customer exit on. Figure 1.1 shows the call sequence and using the BAdI's in combination with Customer Exits and BAdI implementations by the customer.

19-07-2013 18-40-04_en.png

Figure 1.1 BAdI RSROA_VARIABLES_EXIT_BADI call and use

The standard SAP processing process variables determined by the GET BADI command all active BAdI implementations.

In the BAdI RSROA_VARIABLES_EXIT_BADI is a filter-based BAdI. When object filter the BAdI uses the info object to which the variable is based that is currently processed.

Note: In I_STEP 3, we have no clear variable and thus no clear info object name. The BAdI is called in the I_STEPs 0, 1 and 2 for each variable. A variable is always based on a feature. In I_STEP 3 all variables in the current report are available in the form of a table parameter. If the BAdI implementation is to be used for processing in I_STEP 3 of the filter by the value IOBJNM must be expanded =''.

The BAdI class that returns all active implementations, first determines all active implementations of the BAdI and additionally ensures that the filter values ​​for the BAdI implementation consistent with the currently processed values.

Then an instance of each active implementation generates and invoked with the command CALL BADI method IF_RSROA_VARIABLES_EXIT_BADI ~ PROCESS of individual implementations.

SAP delivers BAdI definition directly with the default implementation SMOD_EXIT_CALL. This implementation is active and has a filter combination IOBJNM ='' OR IOBJNM <>''. The filter combination is selected such that the BAdI I_STEP implementation for all (0, 1, 2 and 3) is considered to be active. The default BAdI implementation has the task of the customer exit (function block) EXIT_SAPLRRS0_001 RSR00001 call the extension, see Figure 1.1. Of the customer exit is only called when the component in the extension is active.

It is recommend not to mix the use of and BAdI customer exit.

The interface of the BAdI method PROCESS interface is identical to the interface of the function module EXIT_SAPLRRS0_001 the customer exit. This means that the source code of the customer exit can be fully adopted, this will reduce the migration effort.

Note: Migration is not needed! The customer exit persists. The BAdI, SAP an additional concurrent object-oriented way for the processing of exit variables. Advantage of the BAdI variant against the customer exit is better structuring and management of the implementations.

In the BAdI RSROA_VARIABLES_EXIT_BADI is a new BAdI BAdI technology, ie, the BAdI is organized in an enhancement spot.

In the following, I will briefly point out the steps that are necessary to create an implementation for a variable. For example, I have a variable (ZTKE_FISCPER) is applied based on the characteristic 0FISCPER. The variable is of type customer exit and has as a selection option selection option.

To create a BAdI BAdI implementation of the new technology, there are several ways.
1.about the BAdI definition (transaction SE18)
2.Use the BAdI implementation (transaction SE19)
3.Über the ABAP Workbench (transaction SE80)

For 3 We need as entry the name of the development package which we have not first. For 1) and 2) we only need the name of the BAdI definition. Since we have only the first name of the BAdI definition (RSROA_VARIABLES_EXIT_BADI) we recommend the route via the SE18, see Figure 1.2.

RSROA_VARIABLES_EXIT_BADI_01_en.png

Figure 1.2 Creating a new BAdI implementation step 1

To display the BAdI definition of the view automatically switches to the SE18 and SE80 there opens the enhancement spot RSROA_VARIABLES_EXIT. By clicking on (see marking in Figure 1.2.), A new BAdI implementation can be created.

A BAdI implementation can not be created directly within a BAdI definition. This, first you have to create an enhancement implementation. Figure 1.3 shows in (1) the dialog for selecting an enhancement implementation. After selecting the extension implementation can be created within this BAdI implementation, see (2).

RSROA_VARIABLES_EXIT_BADI_02_en.png

Figure 1.3 Creating a new BAdI implementation - Step 2

(3) shows the definition of the filter values ​​in the newly created BAdI implementation.

Then, the implementation of the method can be PROCESS, see (1) in Figure 1.4.

RSROA_VARIABLES_EXIT_BADI_03_en.png

Figure 1.4 Creating a new BAdI implementation - Step 3

After deployment is completed needs to be ensured that all of the objects concerned are active. The following objects must be activated:
■ ABAP OO class
■ BAdI implementation
■ Enhancement Implementation

When activating the ABAP OO classes must be taken to ensure that the entire class is active. Active only when a method declaration and the definition of the method but not the ABAP class activates itself. So I recommend when activating the class level to change (Goto è class definition).

After everything is set, the behavior of variables with a BEx query be tested.

Additional information on the topic can be SAP ABAP Programming Course for SAP NetWeaver BW. The course shows the most important locations on where to get (or woman) in the context of an SAP NetWeaver BW system in contact. This also includes the upstream SAP source system with a.

The course is held by me in the form of a work shop that is here is the participants not only my knowledge and experience available but also that of other participants.

How to optimize Reporting Performance

$
0
0

Introduction

 

                 We face many challenges in our BI projects in terms of Reporting Performance. Users always expect outstanding performance of our BI reports. No matter what ever we do in the backend (Modeling and Query Designer). I am going to share very important tips & techniques which I have learned through out my experience which consists of some standard thumb rules too.

 

  1. It is recommended to use Inclusions Instead of  Exclusions wherever possible as Exclusions cant access DB indices and will impact performance.

                                                                          Rep3.JPG

 

2.     It is recommended to to Suppress Result rows Wherever possible.

               Rep2.JPG

3.     It is recommended to use SAP Exits where ever possible and bring down the Customer Exits

 

4.     SAP Suggests free characteristics in reports should be limited to 8-10.

         In RSRV checks, free characteristics usage is marked in red which has very high impact on reports

 

               Rep1.JPG

 

5.      It is recommended to reduce RKFs & CKFs in the Query to as few as possible.

 

         a.     Because, when huge no. of  RKFs & CKFs are Included in a Query, Restricting, Conditioning and Computations are done for each of them during                          query execution.

         b.     This is very time consuming and a high number of RKFs & CKFs can seriously hurt Query Performance

 

6.     It is recommended to redefine your Aggregates in an optimized way by taking Statistics(BI Admin Cockpit should be in place) & Query definitions               into Consideration.

 

         a.     I mean, please open your query definition and pick up the fields which are used in the query while defining Aggregates.

         b.     Delete the unused Aggregates

         c.     If the aggregates are too Large, those not only degrades the Query performance but also loading performance by longer times to roll up and Attribute                        Change runs also takes longer times.

          d.     Make sure you get good valuation indicators for your Aggregates, but not like below

              

          Rep4.JPG

7.     Archiving (NLS) is recommended to archive unused data.

                          

        a.     Reduction of online disk storage

        b.     Improvement in BW query performance

        c.     Increased data availability as rollup, change runs and backup times will be shorter

        d.     Reduced hardware consumption during loading and querying

 

8.     Reports should be designed  on Multiproviders wherever possible.

 

9.    Logical and physical partitioning is recommended for better performance.


10.     Extensive use of Filters at Query level is recommended.


11.     Select appropriate Read mode settings for Multiproviders with "H" and Infosets with "X" in RSDIPROP t-code

 

12.     Reporting on Infosets should be considered below tips :

 

          a.     Do not select all the fields which are part of Infoset definition like below. You can select the fields which we want to use in query only.

                       Rep5.JPG

         b.     You should select "Use Selection of Structure Elements" in RSRT-->Properties

                          Rep6.JPG

        c.     Do not make too many joins as it cause high runtimes to fetch data after the joins


13.     Statistical Reports performance can be improved by broadcasting  query result  to cache and prefilling cache.


14.     Deletion of unused Queries is recommended


15.     Delete temporary Query Views is recommended.


16.     It is recommended to be careful while creating Cell Structures as they require high query run times and will lead to performance degradation.


17.     Program RSR_CACHE_RSRV_CHECK_ENTRIES can be scheduled to run on regular basis to remove the unused Cache entries .


18.     Make proper Query read mode and Cache mode settings in RSRT-->Properties. The recommended Cache mode could be 1 or 5.

 

Conclusion :

 

It is always better to keep an eye on above points while developing our Business models and Queries. This blog will help us to satisfy our users with good reporting performance.


 


 

 

 

 




How to group free characteristics in Portal or Web Analyzer

$
0
0

Introduction

 

                      We use several free characteristics in our reports for drill down purpose. At times, we are forced to use huge no. of drill down chars. It will be cumbersome to view all of them together in a single screen. There are chances for our users to get confused by looking all of them like below.

 

                                          Grp1.JPG

                  To deal this issue in a better way, I am going to demonstrate on How to group these free chars as per the entity type in WAD by using Navigational Block Web Item.

 

1.     Open WAD and add different "Navigational Block" items to your web template

         Grp2.JPG

2.    If you want to group as per the Header Customer entity type, then click on the Navigational Block Web item from above and specify the Entity name in the Title like below

 

                    Grp5.JPG

 

3.     You can select the required Chars and Nav Attrs in the  in Web Item properties like below.

 

         Grp3.JPG

 

4.     You can create separate groups with different web items in the above fashion and your users can select the required drill down char from the Nav Block web item in the Portal like below

 

             Grp4.JPG

 

Note : You can correlate with Dimensions in your cube. But with above steps, you can also add Nav Attrs to the group along with dimension chars. You can create total new groups also without concerning the dimension design in the Cube.

 

Thanks for reading.

SAP BW Business Explorer & Business Analyzer Reporting In Brief..

$
0
0
REPORTING
Bex:-
          -Bex has multiple components of tools
          -Bex query designer
          -Bex analyzer
          -Bex WAD (Web application designer)

 

1). Bex query designer:-
          -Purpose to design Bex design
          -It is a tool were we can design a query
Info provider:-
          -Any object we can design and run Bex query this is called info provider.

 

2). Bex analyzer:-
          -It is a normal Excel sheet + Add-on components
          -It is used to design Bex workbooks (Formatted query)

 

3).Bex WAD:-
          -Ti design web temples by using web items

 

Bex query designer:-
          -0RRMX – Is T code for opening analyzer

 

Query executing process:-
          -When we executing in BEX query it triggers the data OLAP processor it first check the data in OLAP and it not available OLAP processor identifies the info cube on which the BEX report should be excites and triggers the query on the characteristics values in the OLAP processor and transfer the records to front end and records are formatted in the front end and shows to us.
Charecterstics properties:-
FIGURE 1 : PFA
Key figure properties:-

 

FIGURE 2 : PFA

 

Query properties:-
Restricted key figure:-
          - If we want restrict the multiple keyfigure with a same Charecterstics we go for RKF.
          -With the RKF will affect only particular coloums only.
          -When we want each key figure to be restricted with a different Charecterstics we go for RKF.

 

New Selection:
-Same as Restricted Key figure.
-New selection is local
-RKF is Global at Info Provider and New Selection is Local
Note:-
          -When we have two structures in a report, we can build new selection on two but we have the flexibility to use key figure in a one selection only.
Exceptions:
-We use Exceptions to provide alerts on to the Report based on the key figure value.
- Active
- Cell Restriction
- Degrades Query performance
Note Scenario:-
- We have used exceptions to provide alerts in the - P/A (Profitability analysis) Report - only on the result.
Calculated key figure (CKF):-
          -When we calculated a new key figure based on the existing key figures by performing some calculations and using some pre defined functions.
          -When we use calculated key figure it performs the some calculations throughout the entire Coolum.
          -It is global can be used in all the reports designed on same info provider.
New formula:-
          -It is a same as a calculated key figure but new formula is local and it has more than 6 functions than the calculated key figure.
CKF/New formula:-
          -CKF is global and new formula is local.
-When compare to CKF, new formula will have 6 functions more.
          -All key figures can be used in building calculated key figures.
-But we can only use the key figure, which is used as the structure elements in new formula.

Structure and New selection modes:-

Purpose:-
          -To make the more node levels like formula and new selections
          -It’s has a 2 structure
          -Why do we use structure?
                    -We have to make Level up and Level done
                    -Reusable component
          -It is used in global and local aspects
          -Remove reference
-If we use saved structure it will not allowed to make the changes to make the changes we go to the structure in report structure and give right click remove reference with this we have that structure to make changes within the query it is called remove reference.

 

Cell definitions:-
          -We use this when we want to perform some calculating specific to each cell on a Coolum.
          -We can implement cell definitions only when we have 2 (Two) structures in a reporting.

 

Exceptions:-
          -Exception means to provide the alerts to the particular coloum for analysis
Note:-
          -We have the flexibility to give exception on hierarchy node wise also.

 

Filter:-
          -Filter means here we have to make restriction Charecterstics as well as key figure
          -If we put object in this area it will not shown result set as well as navigation block.

 

Free Charecterstics:-
          -Free Charecterstics means here we have to make restriction on Charecterstics only
          -If we put a Charecterstics into free charecterstic it will not shown in the result set after as per our requirements we have the flexibility to make drilldown and dril across and filter here
VARIABLES
Variables:-
          -We can variables the Bex reporting
          -To parameterize the queries
          -By using variables we can make the Bex queries dynamically
Types of variables:-
1)          Charecterstics value variable
2)          Text variable
3)          Formula variable
4)          Hierarchy Variables
5)          Hierarchy node variable

 

1). Charecterstics variable:-
          -We can use variables when to make the restriction dynamic on a characteristic
2). Text variable:-
          -We use variables to define the description of key figure, CKF, RKF, NS, NF query description dynamically
3). Formula variable:-
          -We use these variables to parameterize the Conditions, Exceptions and CKF or NF
4). Hierarchy variable:-
          -We use hierarchy to dynamically select the hierarchy to be used the Bex report
5). Hierarchy node variable-
          -We use the variables to make dynamically select particular node on hierarchy to be show in the Bex report

 

Processing types:-
          -This properties define how the variables is process to populate value
Types:-
1). User entry/Default
2). Customer exit (ABAP code)
3). Authorizations
4). Replacement
5). SAP exit
Date: 23/09/2010
Variables          User entry
/Default          Customer exit          SAP exit          Authorizations          Replacement
Processing types
Charecterstics Variable          x          x          x          x          x
Text variables          x          x          x          N/A          x
Formula Variable          x          x          x          N/A          x
Hierarchy Variable          x          x          x          N/A          N/A
Hierarchy node Variable          x          x          x          x          N/A

 

 

FIGURE 3: PFA

**N/A means not available that combination
Case 1:
Characteristic Value Variable with User Entry / Default:
          -We use this to give values to the query as user entry
Characteristic Value Variable with Replacement Path:
-When we want a dynamic restriction on a characteristic by replacing with the query result set of other query.
Note:-
* Queries could be on different Info Providers.
* But the Characteristic must be same.
* We have the flexibility to make the restriction on info object we can use that in other cube reports but that info object must be there in a cube.
Charecterstics value with authorization:-
Authorization objects------- Roles-------Profiles------------Users
Authorization objects:-
S_RS_COMP
S_RS_COMP1          System defined objects for reporting
S_RS_CUBE
Note:-
“RSSM” is T-Code for define authorization in our objects
“PFCG” s T-Code for creating Roles as well as generating properties
“SU0 (zero) 1” User management T-Code
“RSECADMIN” is T-Code is in BI 7.0 overall authorization activities have the flexibility

 

Ex:-
Steps:-
Step 1:-
Create a role –“PFCG”
          Give some name (Create role)
          Give a description (Save)
          Authorization (Click tab)
          Change authorization data
          Choose template (Role)
          S_RS_RREPU (Select)
          Adopt reference
          Utilities Manu (On technical name)
          RS technical name (Select it)
          S_RS_
                    Display, Execute, Enter
                    Info area
                    Info cube
                    Name of reporting component
                    Types of reporting (Select all)
 
                    Generate
                    Save it

 

Ex 2:-
Characteristics value variable with the Authorization:-
Step 1:-
Set the info object as authorization relevant –RSA1
          Go to the Customer (Info object) change
          Business explore tab
                    Go to the Authorization relevant and click the check box and active the info object
Step 2:-
          Create authorization object- RSSM
          Authorization object
                    Create
          Description
                    Give customer no
                    Save it
Step 3:-
Enable the authorization on the info provider –RSSM
          Chek for info provider
                    Change
          Select authorization object
                    Save it
Step 4:-
Define the roles and generate the profile – PFCG
Display, Execute, Enter
                    Info area
                    Info cube
                    Name of reporting component
                    Types of reporting (Select all)
                    Manually (Enter all values)
                        Generate
Step 5:-
Create the necessary users – SU01
Step 6:-
          Create a Charecterstics value variable with authorizations as processing in the BEX query designer
Notes: - Find the query role:-
          -SUIM
                    -Roles
                              -Roles by complex selection criteria
Note:-
          -SU53 is a T-Code for Display authorization data for user Like (SAPUSER)
Note:-
          -SU01D is T-Code to display all users
Charecterstics value variable with SAP exit:-
          -All the business content variables will have the processing types
Note:-
          -Ready for input
                    -If we select this checkbox we will get popup box in front end does not we can’t get.
Note:-
          -Can be changes in navigation block
Purpose:-
          If we select this checkbox, we have the flexibility to make the changes like filter as well as drill down drill across.
Note:-
          -Popup box we have the save also variant as well as use that in other usage.
Note:-
          -Personalization
Charecterstics value variable with Customer exit:-
          -For these type of variable the values is processed by using ABAP/4 code
Case 1:-
0CALDAY:-
Steps:-
1). Create the Charecterstics value variable with customer exit on 0CALDAY
2).Create a project – CMOD
          Project
                    Attribute
                              Create
          Short text
                    Save
                              Package
                                        Save it
3). Assign the enhancement to the project – CMOD
*”RSR00001” is T-Code for to see complete enhancement
          Enhancement assignment
                    Change
                              RSR00001
                                        Save it
Note:-
-One project can have multiple enhancements, but the same enhancement should not assign multiple projects
4). Chek the components of the project –CMOD
          Components
                    Function exit (Click it)
{EXIT_SAPLRRSO_001}
5). Go to the component and implement the logic as per the requirement - CMOD
          Component
                    Change
          Function exit (Click it)
          Source code (Tab click it)
          Include “ZXRSRU01 (Click it)
          Change
 

WHEN ‘ZYDATE’.

            CLEARE L_S_RANGE.

            L_S_RANGE-SIGN = ‘I’.

            L_S_RANGE-OPT = ‘EQ’.

            L_S_RANGE-LOW = SY-DATUM.

APPEND L_S_RANGE TO E_T_RANGE.

WHEN ‘ZYDATE’.

            CLEARE L_S_RANGE.

            L_S_RANGE-SIGN = ‘I’.

            L_S_RANGE-OPT = ‘BT’.

            L_S_RANGE-LOW = SY-DATUM-1.

            L_S_RANGE-HIGH = SY-DATUM.

              APPEND L_S_RANGE TO E_T_RANGE

Case 2:-
0CALMONTH –Current month:-
Steps:-
Step:-1
          -Create the charecterstics value with customer exit on ‘CALMONTH’
Step:-2
          -Go to the SE38 for implementing ABAP code
ABAP code for Current month:-

 

WHEN ‘ZY’.

CLEAR L_S_RANGE.

L_S_RANGE-SIGN = ‘I’.

L_S_RANGE-OPT = ‘EQ’.

L_S_RANGE-LOW = SY-DTUM

+0(6).

APPEND L_S_RANGE TO E_T_RANGE.

 

Case 3:-
Current week:-
Steps:-
Step:-1
          -First we have to create charecterstics variable with customer exit
Step:-2
          -Then we go to the SE38 for writing ABAP code
ABAP Code for current week:

 

WHEN 'YCW'.

DATA ZV_WEEK LIKE SCAL-WEEK.

CLEAR L_S_RANGE.

CALL FUNCTION 'DATE_GET_WEEK'

  EXPORTING

  DATE               = SY-DATUM

IMPORTING

   WEEK               = ZV_WEEK.

   L_S_RANGE-SIGN = 'I'.

   L_S_RANGE-OPT = 'EQ'.

   L_S_RANGE-LOW = ZV_WEEK.

   APPEND L_S_RANGE TO E_T_RANGE.

 

Case 4:-


Year to date (YTD):-
Steps:-
Step:-1
          -First we can create charecterstics variable on Calday with customer exit
Step:-2
          -Then we go can go to SE38 for implementing ABAP code
 
ABAP Code for Year to date (YTD):-

WHEN 'Z_YTD'.

DATA ZV_YEAR(4) TYPE N.

DATA ZDATE TYPE D.

CLEAR L_S_RANGE.

ZV_YEAR = SY-DATUM+0(4).

CONCATENATE ZV_YEAR '0101' INTO ZDATE.

L_S_RANGE-SIGN = 'I'.

L_S_RANGE-OPT = 'BT'.

L_S_RANGE-LOW = ZDATE.

L_S_RANGE-HIGH = SY-DATUM.

APPEND L_S_RANGE TO E_T_RANGE.

 

Case 5:-
Month to Date (MTD):-
Steps:-
Step:-1
          -First we can create the charecterstics variable with customer on Calday
Step:-2
          -Then we go for SE38 for writing ABAP code
ABAP code for Month to date:-

 

WHEN 'Z_MTD'.

DATA ZV_YEAR1(4) TYPE N.

DATA ZDATE1 TYPE D.

CLEAR L_S_RANGE.

ZV_YEAR1 = SY-DATUM+0(4).

CONCATENATE ZV_YEAR1 '0301' INTO ZDATE1.

L_S_RANGE-SIGN = 'I'.

L_S_RANGE-OPT = 'BT'.

L_S_RANGE-LOW = ZDATE1.

L_S_RANGE-HIGH = SY-DATUM.

APPEND L_S_RANGE TO E_T_RANGE.

 

 

Case 6:-
Date Get First Week:-
Steps:-
Step:-1
          - First we can create the charecterstics variable with customer on Calday
Step:-2
          -Then we go SE38 for implement the ABAP code
ABAP code for Date get first week:-

 

WHEN'ZYWTD'.

DATA VFDATE TYPE DATS.

CLEAR L_S_RANGE.

CALL FUNCTION 'BWSO_DATE_GET_FIRST_WEEKDAY'

  EXPORTING

    DATE_IN        = SY-DATUM

IMPORTING

   DATE_OUT       = VFDATE.

   L_S_RANGE-LOW = VFDATE.

   L_S_RANGE-HIGH = SY-DATUM.

   L_S_RANGE-SIGN = 'I'.

   L_S_RANGE-OPT = 'BT'.

   APPEND L_S_RANGE TO E_T_RANGE.

 

Case 7:-
I_STEP2:-
Steps:-
Step:-1
          -Create charecterstics variable with user entry on Calday
Step:-2
          -Create customer exit variable on cal year/week and ready for input must be deselect and mandatory
Step:-3
          -And go to SE38 for implementing ABAP code

 

WHEN 'Z_IST2'.

DATA ZDATE TYPE DATS.

DATA ZWEEK LIKE SCAL-WEEK.

IF I_STEP = 2.

CLEAR L_S_RANGE.

LOOP AT I_T_VAR_RANGE INTO INTERN_RANGE.

IF INTERN_RANGE-VNAM = ZDATE.

ZDATE = INTERN_RANGE-LOW.

ENDIF.

ENDLOOP.

CALL FUNCTION 'DATE_GET_WEEK'

  EXPORTING

    DATE               = ZDATE

  IMPORTING

    WEEK               = ZWEEK.

    L_S_RANGE-LOW = ZWEEK.

    L_S_RANGE-SIGN = 'I'.

    L_S_RANGE-OPT = 'EQ'.

    APPEND L_S_RANGE TO E_T_RANGE.

    ENDIF.

 

Text Variable:
-We use Text Variable to make the description of the KF,CKF,RKD,NS.NF and Query Description  dynamic.
Processing types:
- User entry / Default
- Customer Exit                     - 25% (% of real-time usage)
- Replacement Path           - 75% (% of real-time usage)
- SAP Exit
Case 1:
1).Text with User entry / Default:-
          -If we have to go this scenario then we have a chance to select description of any key figure/CKF/NF/NS/RKF etc in a dynamically.
Ex:-
Select key figure
          Edit
                    Select text variable [   ]
          Variable name
          Description
          Length of input field [32]
Case 2:
2).Text with Customer Exit:
          -If we required changing query description dynamically based on sy-datum then we go for this scenario
Purpose:-Balance Sheet Report title with Current Date:-
Go to the query properties
          Select text variable
                    Variable name
                    Description
                    Processing by [Customer Exit]
                    Length of output field [32]
ABAP/4 Code for this scenario:-

 

WHEN ‘ZBALANCE’.

CLEAR L_S_RANGE.

L_S_RANGE-SIGN = ‘I’.

L_S_RANGE-OPT = ‘EQ’.

L_S_RANGE-LOW = SY-DATUM.

APPEND L_S_RANGE TO E_T_RANGE.

 

Case 3:
3).Text with Replacement Path:-
Purpose:-Trending Reports:-
Select key figure
          Select new selection
Give the Name as Current month
(And here we create text and also give processing by as Replacement variable)
Select and drag any key figure from left blog to right blog and restriction on clamonth2 and create variable customer with processing by as User entry
Case 4:
4).Text Variable with SAP Exit
Formula variables:-
          -We use formula variables to make conditions, Exceptions, Calculated key figure, new formula in dynamically.
Processing Types:-
-User default/Default – 10% (% of real-time usage)
-Customer Exit – 30% (% of real-time usage)
-Replacement path – 60% (% of real-time usage)
-SAP Exit
Case 1:-
Formula variable with user entry:-
Case 1:-
In CKF (Calculated Key figure):-
Purpose:-
          -If we make formula variable on CKF then we have the flexible to make calculations with in pop up box.
Select Calculated key figure
          -Edit
                    -Formula variable
                    -New variable
                              -Variable name
                              -Description
                              -Processing by [User entry]
          -Now must drag what created into Formula box
Case 2:-
Formula variable with user entry:-
Case2:-
          -On conditions
Case 3:-
Formula variable with replacement path:-
          -There are two scenarios one is we can use a characters in calculations and key figures what the any info objects which hold the attributes as key figures we can use that key figures in calculation part by using formula variable with replacement path.
Scenario 1:-
Formula variable with replacement path :-( By using Charecterstics values)
          -No of day’s b/w actual goods date and planed goods date
          -Create Formula
                    -Create formula variable
                              -New variable
                              -Technical name
                              -Description
                              -Replacement path
                                        -Charecterstics (Choose one)
                                        -Mention particularly its is what type
                                                  -Date
                                                  -Number
                                                  -Quantity
And finally w create two variables in formula variable one for actual goods issued date and one more for Planned goods date and drag into that both into formula screen and (Variable1-variable2) then we will get no of days b/w that dates
Scenario 2:-
Formula variable with replacement path :-( By using Attribute, key figures)
          -To get the sales cost from the attribute key figure
          -Create Formula
                    -Create formula variable
                              -New variable
                              -Technical name
                              -Description
                              -Replacement path
                                        -Charecterstics (Choose one)
                                        -Attribute
                                        -Select a particular attribute
                                        -Mention particularly its is what type
                                                  -Date
                                                  -Number
                                                  -Quantity
          -Finally in key figure we have quantity and we need the standard price for getting sales cost so we use quantity direct calculations and use formula variable what we have done and put that both quantity and formula variable into formula screen and run the query.
Hierarchy Variable:
-Dynamic Selection of Hierarchies
Processing Types:
- User entry / Default - 80%
- Customer Exit - 20%
- SAP Exit
Case 1:
Hierarchy Variable with User entry / Default
          - Product hierarchy
Hierarchy Node Variable:
- When we want the restriction to be made dynamic at the Node level of an Hierarchy we go for Hierarchy Node Variable.
Processing Types:
- User entry / Default - 40%
- Customer Exit - 10%
- Authorization - 40
- SAP Exit
Report-to-Report Interface (RRI) [RSBBS]:-
          -We use this to jump one query to another query
BEX ANALYZER
- To Design Bex workbooks (Formatted Report is called as Workbook)
- MS Excel and some Add-on Components
-Settings icon
          -BW server connection
Case 1:
- Formatting (Charts, Multiple queries in single sheet as well as different sheets)
For a chart……………..
          -Select the result area
                    -Layout icon
                              -Attach charts
For refreshing query……………………..
          -Right click the any area in the excel sheet
                    -Properties
                              -Interaction
                                        -Refresh query out put
Finally save that workbook
Case 2:
          -Moving filters, Text elements, Move result area
                    -Here we have the flexibility to move those from one area to another to another area in a sheet.
To design text elements……………………………..
          -Layout icon
                    -Display text elements
                              -All
Purpose to make this activity it will shown those properties of about query as well as user name changed date time etc,,,,
Case 3:
- Workbook Template
Case 4:
- Multiple Queries - Multiple Sheets
Case 5:
- Multiple Queries in Single Sheet
Case 6:
- Organizing Text Elements & Navigation Block & charts
Case 7:
- BEx MAP
- .SHX
- .SHP
- .DBF
 
Case 8:
- VB Macros

Sub SAPBEXonRefresh (queryID As String, result Area As Range)

Dim i As Integer

Dim j As Integer

Dim v_cols As Integer

Dim v_rows As Integer

 

 

i = resultArea.Rows.Count

j = resultArea.Columns.Count

 

 

v_cols = 1

v_rows = 1

 

 

For v_cols = 1 To j

    For v_rows = 1 To i

        If resultArea.Cells(v_rows, v_cols).Value = "Overall Result" Then

            resultArea.Cells(v_rows, v_cols).Value = "Total Stock" 

       End If

     Next v_rows

Next v_cols

End Sub

 

ABAP Code for providing dynamic name for Report to the Query based on input values

$
0
0

Introduction: ABAP Program to derive dynamic report name based on input variable values of a Query

 

Requirement: Need Dynamic Query Description based on the input variable values

 

 

Example:

 

When ZP_VAR1 = Australia, ZP_VAR2 = Sydney& Fiscal year  = 2012

Then Report name should display as Australia  Sydney 2012

 

Program code:

 

WHEN "Mention the text variable give in the Query description"

 

** Defining Variables

data : Var1(n),   *corresponding input variable in query = ZP_VAR1*

       Var2(n),        *corresponding input variable in query = ZP_VAR2*

       Var3(n),        *corresponding input variable in query = ZP_VAR3*

       Var4(n),        *corresponding input variable in query = ZP_VAR4*

       fyear(n),       *corresponding input variable in  query  = 0P_FPER1*

       title(n).

**Code to read the value stored in the variable to the Query Description

 

read table i_t_var_range INTO s_t_var_range with key vnam = 'ZP_VAR1' .

if s_t_var_range-LOW is not initial .

Var1  = s_t_var_range-LOW.

endif.

clear s_t_var_range-LOW.

read table i_t_var_range INTO s_t_var_range with key vnam = 'ZP_VAR2' .

if s_t_var_range-LOW is not initial .

Var2  = s_t_var_range-LOW.

endif.

clear s_t_var_range-LOW.

read table i_t_var_range INTO s_t_var_range with key vnam = 'ZP_VAR3'.

if s_t_var_range-LOW is not initial .

Var2  = s_t_var_range-LOW.

endif.

clear s_t_var_range-LOW.

read table i_t_var_range INTO s_t_var_range with key vnam = 'ZP_VAR4' .

if s_t_var_range-LOW is not initial .

Var4 = s_t_var_range-LOW.

endif.

clear s_t_var_range-LOW.

read table i_t_var_range INTO s_t_var_range with key vnam = '0P_FPER1' .

if s_t_var_range-LOW is not initial .

fyear = s_t_var_range-LOW.

endif.

clear s_t_var_range-LOW.

concatenate Var1  Var2  Var3  Var4 '' fyear into title  separated by space.

CLEAR: L_S_RANGE.

L_S_RANGE-SIGN    = 'I'.

L_S_RANGE-OPT     = 'EQ'.

L_S_RANGE-LOW     = title.

APPEND L_S_RANGE TO E_T_RANGE.

CLEAR L_S_RANGE.

ENDCASE.

BEx 7.x: Another way to set variable values with VBA - A way without using BExApi -.

$
0
0

As in the very good article posted by François Gyöngyösi, I had developed a Visual Basic code to set the values of BEx variables for queries embedded in Excel workbooks under BW 3.x, too. I also had the problem that my solution doesn’t work with BW 7.x.

 

I could not find an adequate documentation regarding the new BexApi. So after a lot of trial and error I took another way. Now I’m using the Send Keys Method. I know that it isn’t the best way, but it works. Maybe the following code will help someone. Here are some instructions how to use the code.

 

1.    1. Launch the BEx Analyzer and open a BEx query with variables.

2.    2. Start the Visual Basic editor.

3.    3. Insert a new module

4.    4. Copy the code below into the module

5.    5. Adjust the code for the function “FokusAndKey”. You will find an example with comments in the code below.

6.    6. Run the procedure “RefQueryStepA”.

Option Explicit
Private Declare Function GetDesktopWindow Lib "user32" () As Long

Private Declare Function GetWindow Lib "user32" ( _
    ByVal hwnd As Long, ByVal wCmd As Long) As Long

Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" ( _
    ByVal hwnd As Long, _
    ByVal lpString As String, _
    ByVal cch As Long) As Long

Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" ( _
    ByVal hwnd As Long) As Long

Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" ( _
    ByVal hwnd As Long, _
    ByVal wIndx As Long) As Long

 

Private Declare Function GetParent Lib "user32" ( _
    ByVal hwnd As Long) As Long

Private Declare Function SetForegroundWindow Lib "user32" ( _
    ByVal hwnd As Long) As Long

Private Declare Function SetTimer Lib "user32.dll" ( _
    ByVal hwnd As Long, _
    ByVal nIDEvent As Long, _
    ByVal uElapse As Long, _
    ByVal lpTimerFunc As Long) As Long

Private Declare Function KillTimer Lib "user32.dll" ( _
    ByVal hwnd As Long, _
    ByVal nIDEvent As Long) As Long

Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" ( _
    ByVal lpClassName As String, _
    ByVal lpWindowName As String) As Long

Private Const GC_CLASSNAMEMSEXCEL = "XLMAIN"
     
Const GW_HWNDFIRST = 0
Const GW_HWNDLAST = 1
Const GW_HWNDNEXT = 2
Const GW_HWNDPREV = 3
Const GW_OWNER = 4
Const GW_CHILD = 5
Const GW_MAX = 5

Const GWL_STYLE = (-16)

Const WS_VISIBLE = &H10000000
Const WS_BORDER = &H800000

Private ArrHandeles() As Long

Private TimerHwnd As Long


Sub RefQueryStepA()
   
    'I need to start a timer for the second step, because the Bex-Refresh-Variable-Window will interrupt the VB-Code.
    Call StartTimer
   
    'Before starting the Bex-Refresh-Variable-Window, write all windows into an array.
    If SucheHandles = True Then
        'Run Bex-Refresh-Variable-Window
        If RunRefVarWin = True Then
       
        End If
    End If
   
End Sub

 

 

Sub RefQueryStepB()
   
    Dim ArrHandelesA() As Long
    Dim i, j As Integer
    Dim hwnd As Long
       
    'Copy array into an second array, before Bex-Refresh-Variable-Window starts.
    ArrHandelesA = ArrHandeles
   
    'After the Bex-Refresh-Variable-Window started, write all windows into an array.
    If SucheHandles = True Then
       
        'Compare both arrays. If the value is similar set 0
        For i = LBound(ArrHandeles) To UBound(ArrHandeles)
            For j = LBound(ArrHandelesA) To UBound(ArrHandelesA)
                If ArrHandeles(i) = ArrHandelesA(j) Then
                    ArrHandeles(i) = 0
                End If
            Next j
        Next i
       
        'Only one window should be left in the array - the Bex-Refresh-Variable-Window -.
        j = 0
        For i = LBound(ArrHandeles) To UBound(ArrHandeles)
            If ArrHandeles(i) <> 0 Then
                j = j + 1
                hwnd = ArrHandeles(i)
            End If
        Next i
       
        If j = 1 Then
            'If only one window is left in the array, the EnterKey-Function will starts
            If FokusAndKey(hwnd) = True Then
                'stop timer
                Call StopTimer
            End If
        End If
       
    End If
   
End Sub


Function SucheHandles() As Boolean

    Dim hwnd, par, sty, lentit As Long
   
    Dim i As Integer
   
    'get desktop handle number.
    hwnd = GetDesktopWindow()
   
    'get aktive child window from desktop
    hwnd = GetWindow(hwnd, GW_CHILD)
   
    i = 0
    Do While hwnd <> 0
        'select next window
        hwnd = GetWindow(hwnd, GW_HWNDNEXT)
       
        'get parent from selected window
        par = GetParent(hwnd)
       
        'get style from selected window
        sty = GetWindowLong(hwnd, GWL_STYLE)
       
        'get length of title from selected window
        lentit = GetWindowTextLength(hwnd) + 1
       
        'If the window has no parent, it could be the Bex-Refresh-Variable-Window
        If par = 0 Then
            'If the window has a title, it could be the Bex-Refresh-Variable-Window
            If lentit > 0 Then
                'If the window is visible and has a border, it could be the Bex-Refresh-Variable-Window
                If (CBool(sty And WS_VISIBLE) = True And CBool(sty And WS_BORDER) = True) Then
                   
                    'write handle number from window into an array
                    ReDim Preserve ArrHandeles(i)
                    ArrHandeles(i) = hwnd
                   
                    i = i + 1
                   
                End If
            End If
        End If
       
    Loop
   
    SucheHandles = True

End Function


Function RunRefVarWin() As Boolean
    'Run Bex-Refresh-Variable-Window
   
    Dim SAPpAddin As Object
    Dim lCMD As String
   
    Set SAPpAddin = CreateObject("com.sap.bi.et.analyzer.addin.BExConnect")
   
    lCMD = SAPpAddin.ExcelInterface.cCMDRefreshVariables
   
    Call SAPpAddin.ExcelInterface.ProcessBExMenuCommand(lCMD)
   
    RunRefVarWin = True

End Function

 

Public Sub StartTimer()
    'Run timer in an intervall of 500 milliseconds.
    'The timer will start the second step, because the Bex-Refresh-Variable-Window interrupts the VB-Code
       
    TimerHwnd = FindWindow(GC_CLASSNAMEMSEXCEL, Application.Caption)
    SetTimer TimerHwnd, 0&, 500&, AddressOf RefQueryStepB
End Sub

 

Public Sub StopTimer()
    'Stop timer
   
    KillTimer TimerHwnd, 0&
End Sub


Function FokusAndKey(hwnd As Long) As Boolean
   
    'This function will set the focus to the Bex-Refresh-Variable-Window and send keys to the window.
   
    Dim i As Integer
   
    'Now you have to count how much tab-key's you have to enter to reach the variable-field.
   
    'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    'XXXXXXX from here you have to adjust the code to your Bex-Refresh-Variable-Window XXXXXXXXX
    'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
   
    'In my case I need 5 tab-key's to reach the first variable.
    For i = 1 To 5
        SetForegroundWindow hwnd
        SendKeys "{TAB}"
    Next i
       
    'enter the value of the first valiable
    SetForegroundWindow hwnd
    SendKeys "001.2012 - 012.2012"
   
    'To reach the second variable I need 2 tab-key's
    For i = 1 To 2
        SetForegroundWindow hwnd
        SendKeys "{TAB}"
    Next i
   
    'enter the value of the second valiable
    SetForegroundWindow hwnd
    SendKeys "001.2013 - 008.2013"
   
   
    'Enter again tab-key's to reach the OK-Button from the Bex-Refresh-Variable-Window
    For i = 1 To 2
        SetForegroundWindow hwnd
        SendKeys "{TAB}"
    Next i
   
    'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    'XXXXXXX till here you have to adjust the code to your Bex-Refresh-Variable-Window XXXXXXXXX
    'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
       
    'Send Enter-key to start the Refresh
    SetForegroundWindow hwnd
    SendKeys "{ENTER}"
   
   
    FokusAndKey = True
   
End Function

 

 

 

 

This code has been tested in Excel 2010 and BEx 7.2. Please note that I will not take the responsibility for issues which arise resulting from its use.

 

 

How to resolve "error in running BEx report - BIA/BWA Index is corrupted"

$
0
0

Are you facing error while running your BEx report saying "BWA index corrupted"(displayed in image below).

 

BIA.png

Steps to check & resolve the Issue:-


1. Check your reporting cube is in BWA Server.

2. If yes, Right Click the cube -> select "maintain BWA Index" or can be accessed through the T-Code "RSDDB". You wil get the screen lik below,

BIA1.png

3. Give your Infocube name for which you want to check for the BWA Index status and press "Display". you will reach the below screen,

bia2.png

4. Now, check for the status for the cube and then press "log" -> goto "Inital filling" -> check the history logs --- to confirm "Initial fill for the cube is success(No "Yellow" status in log).

5. If Initial fill is success, then check the "log" -> goto "rollup request" -> check the history logs --- to ensure the rollup for the cube is running fine.

 

bia3.png

Give the date range two weeks (dependents upon how frequently you are running rollup for your cube)

bia4.png

If you get the status as showed in below snapshot, then your cube's index is corrupted.

bia5.png

 

How to fix:-

 

1. Remove the cube from BIA / BWA and rebuild it.

Note: While deleting the Cube from BIA "Do not delete Master data associated to the cube"(Removing master data will cause rebuilding master data index again which will basically takes more time).

 

How to test/ensure BIA is causing the problem :-

 

1. run the same query using RSRT t-code and select "without BIA".  If your query runs fine then, the above mentioned was the cause for your issue.

Viewing all 103 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>