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


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:

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.
Activate Accessibility Mode (WDACCESSIBILITY):                                      SAP-ACCESSIBILITY
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):
Behavior When Reference Fields Are Changed (WDREFFIELDBEHAVIOUR):
Optimizations for Remote Desktop Connections (WDREMOTEDESKTOP):      SAP-WD-REMOTEDESKTOP
Runtime Repository as Shared Object (WDSHAREDREPOSITORY):
Use of External Style Sheets (WDUSEEXTERNALSTYLESHEET):

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

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

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)
            | (class_name)=>(meth_name)

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.

Thursday, May 21, 2015

Running OS commands from SAP

When it comes to OS issues SAP Basis people usually tend to access directly OS level of SAP server in order to investigate it. This is done by different telnet like tools which provide console to the OS access. However it may be the case that OS level access is not an option because it is not provided by various reasons.

1. report RSBDCOS0
Therefore there has to be other way how to basically reach out to OS just from SAP system. There is a report available for that. It is RSBDCOS0 and it basically provides terminal windows to the OS.  Multiple OS commands can be entered into the report in similar way is ti would be done in real OS terminal. See on picture below how I run OS command: dir c:

All commands ran from the report are logged into files on OS level by C command: C_WRITE_SYSLOG_ENTRY.
If you want to run some OS commands on automated basis then there is an option to create custom ABAP report. Such a report will run these OS commands via FM SXPG_COMMAND_EXECUTE.

In case you have an issue to run OS commands in the RSBDCOS0. E.g. the report returns nothing just error code = 1. As very basic check is it is advisable to look whether an environment variable "ComSpec" is set. In case of WIN OS it should be set to value: ComSpec=C:\WINDOWS\system32\cmd.exe

As a last not on this report I say that the report is very powerful. Therefore it is not something to play with. Every user who uses it must be very well aware of what it actually doing! There is one SAP Note which witnesses about the power of the report. It is the Note: 117657 - Reports RSBDCOS0, RSNNUXCD are deleted or changed where it says:

As a result of multiple requests, report RSBDCOS0 was activated again.
This means SAP already tried to remove the report from standard SAP installations. However as per heavy pressure (as I can imagine it!) of customers they decided to give it back for usage. Better secure an access to this report!

2. tcode SM69
Other option to run OS command from SAP environment is to use tcode SM69. This tcode consists of commands which were setup up and can be even OS specific. It is possible to add new command as well; add additional parameters to existing commands, run commands etc.  

Monday, May 11, 2015

BW 74: Master data maintenance: web based environment

This is one of the changes in BW 74 which is a bit controversial. Whereas occasional end user may like it hard core business users and BW administrators tent to dislike it. Issue is that complete screen for IO data maintenance was moved from SAP GUI screen to web environment. It is related to tcode “RSDMD - Master Data Maintenance w.Prev. Sel.” - which is not based in GUI anymore. Functionality is based on ABAP WebDynpro technology. The change is available in BW as of version 7.40 SP 05.

To enable web based MD maintenance following services must be active in tcode SICF:

URL of the web dynpro has following structure:

Old way:

New way:

While promoting the change SAP claims that new web dynpro based app is capable of maintaining very long characteristics which very introduced in BW 74. Like CHAVL (extension of RSCHAVL 60+ chars) and XL Texts. That is for sure very true. But how many customers have already start using longer values of IO? For most of them ti would be extremely useful to have possibility to choose which way they want to maintain their MD. There must be definitely possibility to let the user to choose either old way (before 74) or new way (74) shall be used when starting tcode RSDMD. However at present this possibility is not in place. There is something which SAP has to deliver soon or later. There are already a “hacks” available to get the old behavior back. One example is manipulating function module RSDMD_MDMT which is called by ABAP program RSDMD_MDMT_WITH_F4 (the program is behind the tcode RSDMD). By implementing this “hack” user can decide either old or new way will be used. There is only one downside within the hack. Which is that is a change of SAP standard code. While doing it; it may cause issues during next upgrade of the SAP BW system as SPAU/SPDD adjustment will be needed.

Useful information:
help.sap.com - Creating and Changing Master Data
1913238 - Master data maintenance in Web Dynpro BW7.40 SP05
1997402 - Master data maintenance is not possible in old GUI based one
1969105 - Master data maintenance for InfoObjects does not start

Sunday, May 10, 2015

Uncommenting reports /SSA/* - Service tools for Applications ST-A/PI

There is a bunch of functionality delivered within Service tools for Applications ST-A/PI. In particular functions are related to following areas:

·         ST-A/PI "Service Tools for Applications Plug-In"

·         SAP GoingLive, SAP EarlyWatch, Service preparation, report RTCCTOOL

·         Application monitor, Logistics Monitor, tcode: ST14

·         Analyis&Service Tools Launchpad, tcode: ST13

·         ABAP Trace for EarlyWatch/GoingLive, tcode: ST12

These functions are delivered via ABAP reports within naming convention like: /SSA/*. The functions are available via tcode ST13 where particular Tool name (function name e.g. BW-TOOLS, BWATOOLS, BPSTOOLS, BIIPTOOLS, etc.) needs to be selected and then sub function related to what was selected can run. I wrote detailed post about BW related functions (BW-TOOLS) here.

What may happen in particular NetWeaver ABAP based systems is that that certain function is not available to be chosen in ST13. Simple the function is not there in the function list. Reason of why it is not there might be that it source ABAP code got commented out by some SAP Notes implementation. Uncommenting can be done under certain circumstances in following way.

In tcode ST13 run tool name called RTCCTOOL. Here choose Addon&Upgr button on the toolbar. On next popup run “Procedure after add-on implementation.”

What it does is checking SAP Notes implementation prerequisites of the commented coding and automatically does uncomment of the coding. The certain prerequisite is that relevant support package level in the ABAP system is high enough.

However, if there already was an SAP note for the affected coding implemented before the 'procedures after add-on implementation' were executed; the coding can no longer be automatically uncommented.

Other option is to use ABAP report /SSF/SAO_UTILS to uncomment. However it is the most likely the same report which is used by tool name RTCCTOOL as described above. So in case it didn’t work for you via RTCCTOOL this report won’t either.

However there is a 3rd option. You may want to copy source of any commented out /SSA/* report. You can copy this to Z* namespace and try to uncomment it manually. The tool name/function won’t be visible in ST13 but you can run it manually in tcode SE38.

69455 – Service tools for Applications ST-A/PI (ST14, RTCCTOOL, ST12)
1384471 - RTCCTOOL message: "Report /SSA/*" cannot be uncommented