Tuesday, June 30, 2015

How to find TRFN concerned in ABAP dump?

ABAP dump is common place where monitoring team of SAP systems are talking look. Even Basis people usually observe tcode ST22 and they inform particular BW people about possible issues. So what actually we can read from the ABAP dump concerning BW failed transformation?
The ABAP dump related to failed BW transformation looks like following:

Category               ABAP Programming Error
Runtime Errors         GETWA_NOT_ASSIGNED

ABAP Program           GP00O2SPBAQDZP8PDSDOGUNVDYB




Afterwards an description of particular error follows. Main thing what we get out of it is just GP* report. It is generated report which contains whole logic of the BW transformation. The problem of the dump is that from the log that is provided we can't see what corresponding transformation is where issue occurred. This information must be lookup up. There is a table called RSTRAN which usually can be used to look up this info. The GP* report from the dump must be entered into field TRANPROG on selection screen of the table selection screen. Note that important is to remove first 2 letters "GP" from the name of the GP* report.



Here we go -> we got the transformation ID:







Now by using value in field TRANID we can look up the transformation in RSA1:




























Here we go; the TRFN is found:






However this method doesn't work for all types of TRFN/loads.

Sunday, June 28, 2015

How to influence help input values (F4) on BEx report variable screen

Variable or selection screen of BEx queries are important to gather user input for later data retrieval for the queries. Input fields on these screens are provided with so called input values or F4 values which help users to enter proper values. The proper values mean the one which exists in the systems and which makes sense for the report.  Concept of F4 values was taken from classis ECC (former R/3) transactions where it was successfully used for years.


One may wonder what settings are available in BW system which may influence behavior of the input values. Main place where all the functions for F4 behavior are available is RDS1 or RSA1 -> Modeling -> InfoObjects -> Display characteristics -> tab Business Explorer. Here under General settings section following fields are available:

    

Display - controls the format in which characteristics values will be displayed. Options that are available are: No display; Key; Text; Key and Text; Text and Key.                                       

Text Type - controls which format of text is displayed. Options that are available are: Default; Short text; Medium text; Long text. This also depends what types of text table is maintained for particular IO on tab Master data/text. If case "default" option is selected then the shortest text available is displayed.

BEx description - Sets which description appears in BEx for particular characteristic. It is possible to choose between long and short description.
Selection - Selection restriction for characteristics. It describes how values of a characteristic in BWx query should be restricted. In case of value "Clear for every Cell" or "Unique for every cell" characteristic must be restricted to one value in every column and in every structure for all the queries. The characteristic cannot then be aggregated.

Query Def. Filter Value Selection - Selection of Filter Values for Query Definition. Determines how selection of filter values and restriction of characteristics function during query design time. Normally values from characteristics master data table are displayed. In case of characteristics without the master data table, the values from the SID table are displayed. Also it is possible to display only the values that are in the InfoProvider. This is available by giving option "InfoProvider Values Only".

Query Execution Filter Val. Selectn - Selection of Filter Values for Query Execution or so called "F4 read mode". Following options are available for executing queries:

- M mode: Values in master data table. All available MD values are read to the MD tables (P table, Q table).

- Q mode: Only posted values for navigation: Only those values that are part of the query results are read.

- D mode: Only InfoProvider values. Only the values of the characteristics that are updated in the InfoProvider (IC dimensions or DataStore) object are read. This mode is valid for InfoCubes and DataStore objects - a case when MultiProvider only consist of IC and/or DSO. Exception is for the characteristics that are designed as Line Item Dimension - mode D is not supported here. In case M or Q mode is selected, there might a message "No data found" while selecting F4 during query runtime.

Filter Value Repr. At Query Exec. - It determines how the display of filter values works when a query is executed. In some cases, it could be advisable to display the filter values with an appropriate control. If the characteristic has few characteristic values, you can display the values as a dropdown list box.


Useful information:
1843538 - Common issue with variable/selection/filter screen F4 value
1080863 - FAQ: Input helps in Netweaver BI
1133107 - Variable screen Web: Spaces as part of characteristic member
1483260 - Variable screen value display for Special Characters

Friday, June 26, 2015

BW transport's error 1: Error activating element xyz

Today I'm starting series of blogs related to common issues with BW transport. This time it will be about BEx Queries transports. One of very common errors is that Method Execution phase of Transport Request import ends like following:

            Start of the after-import method RS_ELEM_AFTER_IMPORT for object type(s) ELEM

            Error activating element 00733D5CMRY7U21O29QA1DU8V



What is going on is very clear even form the log. System tried to activate particular BEx query component/element but failed. We may want to identify what is the component that is missing. To do this a short lookup in the tables like RSZCOMPDIR and/or RSZELTDIR can be done. Most likely it will be a query name. However this will not solve our issue. What is needed is to identify what prevented the system to activate it. In other words what is missing in the system or in transport. In most cases it is that is a just forgotten object which was not added into the transport or maybe it was removed from the transport. Also the object is not missing; it exists in the target system but is it not there in active version.

In order to find out this SAP is providing report CHECK_MISSING_ELEMENTS. What it does is analyzing given objects (query, filter, structure, restricted KF, calculated KF, variable) and it returns inconsistent elements related to given input object. Notice that you have to run the report with object version as M on selection screen.











Once missing objects is discovered by the report CHECK_MISSING_ELEMENTS it just need to be added into the transport and the transport can be reimported.

Monday, June 15, 2015

Are your BW users still using BEx 3.x?

To see BW of version lower than 7.x is quite rare case nowadays. Most of the present BW systems are running on version 7.0+. It has been almost decade now since first version of BW 7.0 was introduced in 2005. With evolution of BW backend its frontend system progressed as well. Despite of having many frontend tools in eyes of most of BW users the "main" frontend tool still remains BEx Analyzer.


There are two significant releases of BEx tools. Within introduction of BW 7.x the BEx which was present at that time was just renamed to BEx Analyzer 3.x and new release of BEx compatible with BW 7.x was released. The old BEx Analyzer 3.x (also known as BEx 3.5) was still shipped with SAP GUI and once deployed there are both version available for the user.
























As the both versions are available some user may try to still using the old one maybe not knowing that it is the old one. It was not issue until version 7.4. Actually within the 7.4 BEx 3.5 cannot be used with BW 7.4x. This is official advice from SAP (see Note 1410878 - Maintenance for BW 3.5 front-end add-ons). This fact is even more stressed out in the note 1932461 - SAP BW 3.5 BEx tools / BW 3.5 frontend add-ons are incompatible with BW7.4.

But what will happen when we (despite all the advices from SAP) try to use old BEx? In case of Query Designer (QD) there is a warning pop up saying that component (BEx Query) was edited with recent version of BEx.

In case of BEx Analyzer 3.5 when we try to open the query running in BW of version 7.4 the BEx Analyzer crashes with following error:























Of course BW administrator will never hear about this until user doesn't complain. But there is also a dump associated with the crash of BEx Analyzer 3.5. it looks like follows:

FM RRY_SESSION_INITIALIZE
Runtime error: CALL_FUNCTION_NOT_FOUND
Terminated program: SAPMSSY1

So in case you are on BW 7.4 and you observe such a dump you may want to check with particular user and advise him/her to start using regular BEx Analyzer instead of old one. Because only this dump is sign that some users are still sticking into the old BEx!


Friday, June 12, 2015

Cross-application Settings for Web Dynpro ABAP

To maintain parameters and to control Web Dynpro ABAP runtime or Web Dynpro ABAP applications there is a WD app provided by SAP. Its name is WD_GLOBAL_SETTING delivered within WD Component called WD_GLOBAL_PARAMETERS.


Most of the settings come in form of URL parameters. The URL params are very useful also in case we need to adjust some params just for particular app. As the setting in the app are valid globally for all the WD apps running in the system by force some the params by URL we can adjust the values of the params.














Following settings is possible to setup via the application.
Parameters:
Activate Accessibility Mode (WDACCESSIBILITY):                                      SAP-ACCESSIBILITY
Allow User Agents (WDALLOWEDUSERAGENTS):
Allow Multiple Actions per Round Trip (WDALLOWMULTIPLEACTIONS):                    WDALLOWMULTIPLEACTIONS
Quickviews for MouseOver (WDALLOWQUICKVIEWS):
Default Values for Input Fields (WDALLOWVALUESUGGEST):                                  WDALLOWVALUESUGGEST
Configuration Name (WDCONFIGURATIONID):                                          SAP-WD-CONFIGID
Delta Rendering (WDDELTARENDERING):                                                 SAP-WD-DELTARENDERING
Deactivate Download Resources for File Download, ActiveX etc (WDDISABLEDYNAMICRESOURCESDN):
Application Starts with a Loading Animation (WDDISPLAYLOADINGPAGE):   SAP-WD-DISPLAY-LOADINGPAGE
History of Input Fields (WDENABLEFIELDHISTORY):
File Download in Separate Browser Window (WDENABLESECUREFILEDOWNLOAD):
Permit eCatt Rendering (WDENABLEXBCMLCLIENT):
Control Help Center Display (WDHELPCENTERDISPLAY):                            SAP-WD-HELPCENTERDISPLAY
Extended Help Off by Default (Exception per Field) (WDHIDEMOREFIELDHELPASDEFAULT):
HTML Render Mode (WDPREFERREDRENDERING):
Save Application (WDPROTECTEDAPPLICATION):
Behavior When Reference Fields Are Changed (WDREFFIELDBEHAVIOUR):
Optimizations for Remote Desktop Connections (WDREMOTEDESKTOP):      SAP-WD-REMOTEDESKTOP
Set Focus on Message Area (WDSETFOCUSONMESSAGEAREA):
Runtime Repository as Shared Object (WDSHAREDREPOSITORY):
Use of External Style Sheets (WDUSEEXTERNALSTYLESHEET):
Use (Un)Signed Applets for GANTT/NETWORK (WDUSESIGNEDAPPLETS):

Adjustments:
Do Not Allow Personalization by the User (WDDISABLEUSERPERSONALIZATION):
Enables the user to hide UI elements (WDENABLEUIELEMENTSHIDE):                     SAP-WD-ENABLEUIELEMENTSHIDE

Design:
Relative URL of Favicon (WDFAVICON):
Force Use of External Stylesheet (WDFORCEEXTERNALSTYLESHEET):
Label Alignment (WDSTYLE_LABELALIGNMENT):                                        WDSTYLE-LABELALIGNMENT
Toolbar Design (WDSTYLE_TOOLBARDESIGN):                                         WDSTYLE-TOOLBARDESIGN
Stylesheet URI (WDTHEMEROOT):
UI Guideline (WDUIGUIDELINE):                                                              WDUIGUIDELINE
Show Animation (WDUSEANIMATION):                                                     SAP-LS-USEANIMATION

Side-Panel:
Configuration ID of Side Panel (WDSIDEPANELCONFIGURATIONID):
Opened at Program Startup (WDSIDEPANELOPEN):
Enable Receipt of Tagging Data in Remote Side Panel (WDSIDEPANELREMOTECONSUMER):
Enable Sending of Tagging Data to Remote Side Panel (WDSIDEPANELREMOTEPRODUCER):
Size can be changed by user (WDSIDEPANELRESIZABLE)

More information:

Tuesday, June 9, 2015

Tools to develop regular expressions

Many times one being an ABAP developer needs to process strings. There are few options (like comparison operators, predicate functions and regular expressions) how to do that as I wrote about them here. The latter one is the most interesting. By using the regular expressions we can match whole character string or substring in order to evaluate what we need. By definition regular expressions are sequences of characters that define a search pattern, mainly for use in pattern matching with strings, or string matching, i.e. "find and replace" type of operations. They are provided by many programming languages - ABAP including. In the release 7.0 of NetWeaver regular expressions can be used as arguments of FIND and REPLACE ABAP statements. Also there are ABAP classes (CL_ABAP_REGEX and CL_ABAP_MATCHER) available where they can be used.

The most important part is to design the regex. To support the design time of the regex SAP is using the tools where the developer can "tune" particular regex. Within the tools one can design new regex directly running it on some sample data without writing ABAP test program. There are following tools available as ABAP reports:


DEMO_REGEX - provides ABAP statement FIND's interface to the regex.



DEMO_REGEX_TOY - on a top of ABAP statement FIND's interface to the regex there is also REPLACE statement supported.



Monday, June 1, 2015

Dynamic tokens in ABAP

Usage of dynamic tokes is one way of how to code generic programs in ABAP. By definition generic programming or so called dynamic generation of source code enables ABAP programs to be as dynamic as possible. This involves specification of data objects on the fly or dynamic specification. Therefore we call fragments of the code which are specified dynamically as dynamic tokens. Dynamic token specifications are often used in combination with dynamic access to data objects. The tokens can be operands or whole ABAP language statements or clauses declared in form of character/string data objects which values are populated by runtime and passed to the ABAP statements. They must contain source code correctly defined during design mode which is executed during runtime.

Following are examples of dynamic tokens:

1. Dynamic access to attributes of classes (Dynamic Access)

ASSIGN | {class|(class_name)}=>{attr|(attr_name)} } 


2. Call procedures or methods dynamically (Dynamic Invoke)
CALL METHOD {(meth_name)
            |oref->(meth_name)
            | (class_name)=>(meth_name)
            |class=>(meth_name)
            |(class_name)=>meth}
 


3. Run Time Type Services (RTTS) - enables dynamic type specifications for data on the fly - when it is not known what the type of data objects to be generated is. It is implemented by type class hierarchies (CL_ABAP_TYPEDESCR and its main subclasses: CL_ABAP_DATADESCR and CL_ABAP_OBJECTDESCR plus they having more child classes). These classes contain method for creation (RTTC) and identification (RTTI) of data objects.

CREATE DATA dref [ AREA HANDLE handle ] 
                 [ TYPE { {abap_type|(name) 
                           [LENGTH len] [DECIMALS dec]} 
                        | {[LINE OF] type|(name)} 
                        | {REF TO type|(name)} 
                        | {{{[STANDARD] TABLE} 
                           |{SORTED TABLE} 
                           |{HASHED TABLE}} 
                           OF [REF TO] {type|(name)} 
                           [WITH [UNIQUE|NON-UNIQUE] 
                              {KEY {comp1 comp2 ...}|(keytab)}|{DEFAULT KEY}] 
                           [INITIAL SIZE n]} 
                        | {HANDLE handle} } ].

4. Dynamic specifications of clauses when internal tables are accessed or in Open SQL. Dynamic tokens in Open SQL are dynamic notation of databases, dynamic WHERE clauses, dynamic SET expressions in UPDATE statements etc.)

DATA(sql_cond) = `BNAME = @input`. 
SELECT SINGLE * FROM usr02 WHERE (sql_cond) INTO @wa.


There is a certain change in ABAP Release 7.40 SP02 where a new S QL parser for Open SQL was introduced. The parser now checks both: statically specified Open SQL statements as well as content of dynamic tokens. These checks are more strict in this and subsequent ABAP releases. The strictness involves that dynamic tokens must be syntactically correct. This means that in former releases the checks were ignored. But in the Release 7.40 SP05 an exception occurs in such a fragment of the code. See Note 1810104 - Upgrade from Release 7.0 EhP3 or Release 7.3 EHP1 to Release 7.40.