Thursday, August 4, 2022

Job BI_WRITE_PROT_TO_APPLLOG not running?

There is an important job in all BW systems that must always run. It is called a BI_WRITE_PROT_TO_APPLLOG or known as Background Job Log Writer. It serves to write temporarily saved logs (batch and enqueue runtime data) of lock manager for any batch processes that are running in BW system.

The job runs an ABAP program RSBATCH_WRITE_PROT_TO_APPLLOG. Logs are written into table RSBATCHDATA by the job. Periodicity of the job should be at least 1 hours if not more frequent. In case of most of the BW systems I worked with the periodicity is 10 minutes. If the BW system is being scheduled for a downtime, the job can be descheduled.

The job is very important to let the BW system functioning properly. BW developers may come across a below pop-up message RSM2 no 081, any time when t-code RSA1 is started:

Report RSBATCH_WRITE_PROT_TO_APPLLOG not planned. See long text.

This is valid for all BW 7.x systems including BW/4 systems. Whoever enters the RSA1 in case the jobs is not scheduled then the system schedules it by that user who entered the RSA1. That's why you can see your user that runs this job in t-codes like SM37.


The message informs that the job does not run means it is not scheduled. The ABAP program RSSM_PLAN_PROTWRITE_TO_APPLLOG can be used to set it up. The program runs FM of the same name (RSSM_PLAN_PROTWRITE_TO_APPLLOG) to do that. The BW system uses other FM RSBATCH_CHECK_START_LOGWRITER to check if the job is scheduled and that one can schedule it too.

In case the job is scheduled multiple times the BW system detects that too. This situation happens when a message RSM2 no 082 is displayed:

Report RSBATCH_WRITE_PROT_TO_APPLLOG planned &1 times. See long text.


More information:

wiki

1135045 - P18:Job BI_WRITE_PROT_TO_APPLLOG is scheduled several times

2495693 - POP-UP Information: Report RSBATCH_WRITE_PROT_TO_APPLLOG x is scheduled


Friday, July 29, 2022

Replacing LOOP statement with ABAP Filter Operator

I tried to compare how ABAP filter operator compete with LOOP statement.

 

1. Classic LOOP statement

On top of itab t_data that is being looped over into a structure a new itab t_data1 is generated from the structure. A condition for the LOOP specified as hardcoded into WHERE part of the LOOP statement.

LOOP AT t_data INTO s_data WHERE ( col_1 = 'AAA' ).

  INSERT s_data INTO TABLE t_data1.

ENDLOOP.

 

2. Filter Operator

A Filter Operator is used to build the itab t_data2 based on th_data itab. Condition is specified as hardcoded one in the filter.

DATA(t_data2) = FILTER #( th_data WHERE col_1 = 'AAA' ).

 

Next, let assume that we have a multiple conditions for the LOOP so they are stored in a special itabs.

3. Classic LOOP statement with WHERE condition as a range

In a case of the class LOOP statement I leveraged range type of itab. The range (t_filter itab) is prepared prior the LOOP. Afterwards the range in used in the WHERE part of the LOOP by IN statement.

t_filter = VALUE #( BASE t_filter ( opt = 'EQ' sign = 'I' low = 'AAA' ) ).
 
LOOP AT th_data INTO s_data WHERE col_1 IN t_filter.
  INSERT s_data INTO TABLE t_data3.
ENDLOOP.

 

4. FILTER Operator with filter as itab

A hash itab (th_filter) is prepared with the condition prior the FILTER operator statement. A new itab (t_data4) is prepared by Filter operator. The Filter operator uses IN statement to specified the itab with the filter.

th_filter = VALUE #( BASE th_filter ( col_1 = 'AAA' ) ).
 
DATA(t_data4) = FILTER #( th_data IN th_filter WHERE col_1 = col_1 ).

 

Conclusion

In my system based on component SAP_ABA 75, SP04 I achieved the fastest the run no 2. Means Filter operator where the condition was hardcoded.



Few more remarks:

To count the no of the itab entries I used REDUCE (Reduction Operator – part of Iteration expression). The statement basically goes over all the entries of the itab and adding 1 into n variable as specified in NEXT statement.

v_count = REDUCE i( INIT n = 0 FOR x_data IN t_data4 NEXT n = n + 1 ).

 

Yes, I’m aware that I could do this by lines (a row function) as seen below. However, I wanted to try more the reduce operator instead.

DATA(v_cnt) = lines( t_data1 )

 

To calculate total of figure that is stored in column col_f in all the itabs I used again Reduction Operator. Just in this case the value of the column col_f is being added up into n variable.

v_count = REDUCE i( INIT n = 0 FOR x_data IN t_data4 NEXT n = n + x_data-col_f ).

Source code available in my Gitgub gist zmm_loop_replacement

Monday, July 25, 2022

How to determine query tech name for BEx variable processing (in user exit/BADI)

While implementing a logic in user exit based BEx/BW variables a requirement of query technical name determination may appear. Thus, I tried to research on this topic a little bit. Fortunately, there is a structure called I_S_RKB1D, which has a description Query Reporting Attribute. The structure has a lot of useful information. Among others (see below) there is an also COMPID information that has the query technical name. The structure is available since a call of standard FM RRS_REPORT_INIT_START.

The structure is still available in memory at the point where the custom logic serving for purposes of specific variable is called.


Columns available in the structure:

COMPUID UUID in compressed form

INFOCUBE InfoCube

GENUNIID Internal display of the report identifier

COMPTYPE Type of a reporting component

COMPID Name (ID) of a reporting component

RFCSUPPORT Report supports access using OLAP API

OBJSTAT Object Status

SMODE Special reports

READMODE Read Mode

NOAGGRFL Flag: Do not use aggregates for this query

IDVERS Dictionary version (internal vers.) of report in RSIX

DVERS Dictionary version (current Release) of report in RSIX

RNAME ABAP Program Name

AUTHOR Name of author

GENTIME Query Generation Time (Cache Invalidation)

LASTUSER Last Changed By

MODTIME Last Change to Definition

REPTIME Last Change of Query Runtime Object

GEN1TIME Query Gen Time (no cache invalidation needed)

PACKFL Process Key Figure with High Precision

PACKFL_DEF Boolean

NOSPBUF SP Cannot be Permanently Buffered

CACHEMODE Query Cache Mode

CACHEUSAGEMODE Cache Usage Mode

KIDSEL Use Selection of Structure Elements

FAGGR_LATE Calculation of Commutative Formulas After Aggregation

OPT_OCCURS Boolean

OPT_OCCURS_TIME UTC Time Stamp in Short Form (YYYYMMDDhhmmss)

OPT_OCCURS_MODE Optimization Mode

OPT_OCCURS_PER Optimization Periods

SUPPRMESS Suppress Messages

CACHEUSEREXIT Indicator: Cache Use Despite Virtual Characteristics/KF

NOPARALLEL No Parallel Processing

GENPROT Generation Protocol

INPUTABLE Make All Basic Indicators Ready for Input

PARTITIONMODE Type of SP Grouping for Delta Caching

DELTACACHE Update Cache Objects in Delta Process

ACTUALDATA Data Integrity

OLAPSTAT OLAP Statistic Properties of the Query

OLAPSTATDETLEV OLAP Statistics Detail Level

ADDNLS Should the Cold Store storage be read too?

NOHPA Obsolete Field (Do Not Use BWA Index)

READMODE_DEFT Boolean

ACTUALDATA_DEF Boolean

CACHEMODE_DEF Boolean

DELTACACHE_DEF Boolean

PARTITION_DEF Boolean

DIS_MODE Disaggregation on Totals

INFOPROV_SUPPORT Query is used as InfoProvider

NOPARALLEL_DEF Boolean

KIDSEL_DEF Boolean

ADDNLS_DEF Boolean

NOHPA_DEF Boolean

CHUSEREXIT_DEF Boolean

TREXOPS Operations in SAP HANA

TREXOPS_DEF Boolean

MATERIALIZEQUERYLAYER Materialize Intermediate Query Result

MATERIALIZEQUERYLAYER_DEF Boolean

IS_PLANQUERY Boolean

DATA_INTEGRITY_SCENARIO Data Integrity Profile

DI_SCENARIO_DEF Boolean

READ_CHILD_KIDS Also Read the Child Members with Hierarchy Structure Node

READ_CHILD_KIDS_DEF Boolean

OLAPEFFORT OLAP Effort for Query

QMODI Q Mode Implementation (relational browse)

DOCUMENT_SUPPORT Document Support

DEFAULT_DOC_APPL_ID Default Document Application ID

PROPVERS Version of Properties concerning Support Package

MOSTRECENT Read according to newest, possibly not active structure

VARIANT ABAP: Name of variant (without program name)

PMODE Mode in which a query is executed (online, batch)

TMSTMP_ROLLUP UTC Time Stamp in Short Form (YYYYMMDDhhmmss)

TMSTMP_ROLLUP UTC Time Stamp in Short Form (YYYYMMDDhhmmss)

TMSTMP_START TS for Start of RRI_REPORT_IMPORT_AND_CHECK

ODBO Using ODBO to Execute Query

EXPLAIN_QUERY This Is A Explain Query

NO_RTPERSISTENCE Does the query have a runtime persistency

USE_NLS Boolean

ONLY_SIMPLE_CU Boolean

MANDT_DEP Object is client-specific

Tuesday, July 19, 2022

BW transport error: CL_RSTRAN_STEP_ROUT

 Recently my BW transport has crashed while being imported to target system. Error message in the transport log looked like below:


An exception of type CX_SY_OPEN_SQL_DB was raised and terminated the program, Message no. PU108

Program CL_RSTRAN_STEP_ROUT===========CP, include CL_RSTRAN_STEP_ROUT===========CM003, line 24

Errors occurred during post-handling RS_AFTER_IMPORT for * L, Message no. PU133

RS_AFTER_IMPORT belongs to package RSO_TLOGO

The errors affect the following components: Message no. PU136

   BW4-ME (Metadata (Design time)), Message no. PU137



My transport contained few
BW transformations but from the error log, it wasn’t obvious which TRFN the error is related to. From a keyword “CL_RSTRAN_STEP_ROUT” that popped up in the error log, I concluded that it had something to do with a routine in the TRFN. That just did not help as most of my TRFN in the transport had routines. I tried to google the keyword as well. I just ran into an old question on SAP Community network forum. It happened that I replied on that question back in 2011 – more than eleven years ago – “huh” :) In my reply to that forum question, I suggested to “try to delete whole field routine, activate transformation and create routine again”. Therefore, I did this – right, there was nothing to lose. Just this time I focused only on TRFN which had field routines not a start/end/expert ones. I just recreated a field routines by simply deleting and recreating them.

Moreover, it worked like a charm, on next import to target system I just got a warnings not an errors.

Monday, July 18, 2022

How often a Process Chains are being killed in your BW?

In BW systems if a particular process in a Process Chain (PC) runs into a problem in most cases a whole chain is stopped. Such process chain gets a red status that means that it did not finished properly. A corrective action is needed to be done by BW administrator. An issue that caused the process to be terminated must be removed and process can be restarted afterwards.

However sometime a situation can be different. The chain's run need to be stopped for some reason. There are few options of how to abort currently running process chain.

One can go to respective basis job of the current process that is executed by the PC. Once the job is found from SAP Basis t-code like SM37 the job can be canceled. This can be achieved by displaying a pop-up window of the PC's process within PC related t-codes like RSPC1, etc. There under Bckg tab it is possible to jump to the SM37 via Batch Monitor button.

Once you arrive, there just use Stop icon (Stop active job) available on a toolbar. Afterwards the job status turn to a red, (Canceled) you can return back to level of the chain and particular process will be set to Aborted. This is indicated in table RSPCPROCESSLOG - column STATE = X = Aborted or R = Error.

Other option can be found directly with a monitor part of PC related t-codes like RSPC1. There is a button called "Stop current run as soon as possible" on the toolbar. 


If during the PC run a button "Stop current run as soon as possible" is pressed a flag TO_BE_KILLED is set in table RSPCKILL. The PC is terminated at the step during which execution a button was pressed. The respective step has followign monitor entry in its pop window:

The table RSPCKILL stores such a “killed” runs of the PC. It has a very simple layout there are only following columns in the table:

 

LOG_ID - Log-ID of a Process Chain Run

TSTPNM - Last Changed By

TSTPDAT - Changed On

TSTPTIM - Changed at

TO_BE_KILLED – Boolean, X if the PC was killed like described above

 

Based on number of the entries in this table one can get a rough idea how many time a process chain was stopped/killed during its run in the BW system. Technically the entry in the table is created by a call of a method REMOVE_FROM_BATCH of ABAL class CL_RSPC_FRONTEND. Respective entry in table RSPCPROCESSLOG - column STATE = F = Done.





Friday, July 1, 2022

Working with navigational attributes in Composite Providers

While working with Composite Providers (HCPR) a navigation attributes of InfoObjects that are present in objects contained in the HCPR are not shown by default. Below picture illustrates how it looks like when the navigation attributes are not shown.

In BW Modelling Tools  of SAP HANA Studio there is an option how to enable it. In the HCPR maintenance screen under a right click there is an option called “Show Unassigned Navigation Attributes”.


Once the above option is activated then the navigation attributes are present and can be freely assigned. Here’s how does it look like when the navigation attributes are available.



 



Thursday, June 9, 2022

Error: Numeric overflow for parameter/column

I recently ran into an issue of reading aDSO object from custom code. I used a method READ of ABAP class CL_RSDRI_INFOPROV. Return code of the method call was 8 = inherited_error. When I debugged it; I came to place in FM TREX_DBS_AGGREGATE where following call is performed:

cl_hdb_sql_for_aggr_req_facade=>get_instance_for_1st_chunk

Exception that was triggered I found following error:

AttributeEngine: overflow in numeric calculation;AttributeEngine: overflow in numeric calculation;exception 70006944: AttributeE

overflow in numeric calculation; $message$=aggregation failed $BIC$<KF_name>$sum$ 1 fixed14.3(17) exception 70006944: AttributeE

overflow in numeric calculation; $message$=aggregation failed $BIC$ KF_name $sum$ 1 fixed14.3(17) ,Exception in executor ...

plan408469425@ndhcdb01-int:30085 while executing pop 6: calcEngine search on olapIndex failed.,QueryId: ...

00O2SPBEZ1RC04NPREWOW2QMR:_C10/[Request Info: Object Name = "<db_schema>"."0BW:BIA: <cube/aDSO_name>", FM Name = TREX_DBS_AGGREGATE]

Error 6.944 has occurred in the BWA/SAP HANA server

Error reading the data of InfoProvider <cube/aDSO_name>$X



Seems this is a generic DB error no 10811:

Numeric overflow for parameter/column (<id>) source type <source_type>, target type <target_type>, value '<value>'

Apparently, value of KF mentioned in the error exceeded its threshold. Solution was to delete the data that caused this overflow.

 

More information:

2399990 - How-To: Analyzing ABAP Short Dumps in SAP HANA Environments

2393013 - FAQ: SAP HANA Clients

2352450 - ADBC: Numeric overflow for data type BIGINT


Critical path of a process chain

Within BW Tools (t-code ST13) and in Process Chain Analysis in particular there is a function call “Critical Path” available. What it does is basically highlights some of the processes in the PC that are connected with a flow of the PC meaning what is a previous process of that needs to be completed in order for the next process to start. Once it is set on the BW system start determining the process, which finished as last one. Then the systems goes back thru a list of PC’s processes up to a trigger of the PC. This is how the critical path is analyzed.

A review of the critical path does not help much with a respect to optimizing of the PC runtime as there is no relation between the time the particular process consumed. The function is implemented in ABAP method TIME_CRITICAL_PATH of ABAP class CL_RSPC_HIER.

The function is available under a button called “Critical Path on/off” available in ST13’s Process Chain Hierarchy screen:


More information:

Suite of helpful BW programs – BW Tools (ST13->BW-TOOLS)

Run time comparison of Process Chains

Tuesday, June 7, 2022

0INFOPROV vs 0TCAIPROV

I recently faced an authorization issue when a new BW/BEx report was created. It wasn’t accessible by end users. When I traced in t-code RSECADMIN I got below error message:

Authorization missing for aggregation (":"): Char: 0INFOPROV – empty



From the trace itself, it looked like it is obvious. Analysis authorization object used in role of end user lack a 0INFOPROV characteristics. In particular its column aggregation. I followed up my analysis by checking corresponding analysis authorization object.

By definition (see e.g. here) every analysis authorization object needs to have below three characteristics:

0TCAACTVT (activity), 0TCAIPROV (InfoProvider) and 0TCAVALID (validity)

 

Therefore, no mention of the 0INFOPROV that popped up in the RSECADMIN’s trace. From this, it seemed that my analysis authorization object is setup in correct way. Nevertheless, why the RSECADMIN’s trace is complaining about 0INFOPROV? What is relation between the 0INFOPROV and 0TCAIPROV? The latter is referenced to earlier one. However, that shouldn’t matter...

It turned out that the 0INFOPROV was set to be an Authorization Relevant (in table RSDCHA field AUTHRELFL is set to X). As you can see on below picture, the 0INFOPROV comes from a Business Content as not Authorization Relevant (tables in both systems) however in the SAP BW system in question (table at the picture’s bottom) the active version of the characteristics was enabled as Authorization Relevant. That particular setting was driving the security trace to mark the 0INFOPROV as not present in the analysis authorization object. Once I included the 0INFOPROV (and its column aggregation) into the analysis authorization object effected, business user was able to access the report.


More information:

Defining Analysis Authorizations

820183 - New authorization concept in BI

1956404 - Characteristics 0TCAIPROV, 0TCAACTVT, 0TCAVALID are no longer Authorization Relevant after Upgrade to BW7.3 or higher



Sunday, June 5, 2022

CDS views related to Analytics (BI)

A CDS (Core Data Services) concept is around for some time and it enables data models to be defined and consumed on the database server rather than the application server. The concept is important from many perspectives. It provides: semantic layer (for use cases like, analysis, operations, search etc.), a uniform data model for all transactional and analytical application areas, and brings an simplifications to the SQL database language, reducing technical complexity for the user. One of the use cases for the CDS is Analytics/Business Intelligence.

Before I dig into the Analytics related CDS view let’s define few more terms related to this area. CDS Annotations describe semantics related to the business data. The annotation enriches a definition of a model element in the CDS with metadata. It can be specified for specific scopes of a CDS objects, namely specific places in a piece of CDS source code.

The CDS annotation can be ABAP specific (means consumed by ABAP runtime) or Framework specifics ones. Particular frameworks ca be Service Adaptation Definition Language (SADL), Business Object Processing Framework (BOPF), Analytics, or Enterprise Search.

 

Let’s focus on Analytics CDS annotations now. Here we recognize two of them:

 

1 Analytics Annotations - Enable the Analytic Manager for multidimensional data consumption, performing data aggregation, and slicing and dicing data. BI front ends like Design Studio and Analysis Office can consume the data via the Analytic Manager.

2 AnalyticsDetails Annotations - Enable application developers to specify the default multidimensional layout of the query, the sequence of variables in UI consumption, and the specific aggregation and planning behavior of the data. All these annotations can only be used in views with @Analytics.query: true. Such identified CDS views are called CDS Query.

 

 

Based on Annotation Analytics.dataCategory we can distinguish between following data categories of the CDS views:

 

1. Fact View = CDS view annotated with @Analytics.dataCategory: #FACT

CDS entity is represented by fact table (center of star schema) of transactional data object. The fact table contains measures (key figures). Use case here is an replication thus this type of the CDS view should not be joined with master data views.

 

2. Cube View = CDS view annotated with @Analytics.dataCategory: #CUBE

What it is cube view? Used for reporting on BW’s InfoProviders like cubes or aDSOs. It is similar to #FACT but as reporting on only figures doesn’t bring any value such an data need to be joined with master data objects. Example.

 

3. CDS Dimension = CDS view annotated with @Analytics.dataCategory: #DIMENSION

Used for reporting in master data. No key figure fields can be defined as key fields. Only characteristic fields can be key fields. Example.

 

4. Aggregation level view = CDS view annotated with @Analytics.dataCategory: # AGGREGATIONLEVEL

Used in planning scenarios to provide write-back functionality.


Few more words about naming conventions related to CDS Views. There are three different technical names for the CDS view stored in table RSODPABAPCDSVIEW:

SQLVIEWNAME - Name of SQL View (ABAP Object), the sqlviewname is used in the ABAP dictionary can be seen in t-code SE11.

DDLNAME - Name of CDS View

STRUCTOBJNAME - Name of view defined in CDS View (Entity Name)



More information:

Core Data Services

CDS Annotations

Analytics Annotations

AnalyticsDetails Annotations

Cube View in CDS

InfoObject in CDS

CDS views: HowTo use in BW contexts

Monday, May 16, 2022

Change default download directory from SAP GUI

Today here’s a quick tip on how to change default download directory from SAP GUI. The default directory on WINDOWS OS host where files that are being downloaded via SAP GUI are stored is pointing to:

x:\Users\<username>\Documents\SAP\SAP GUI

 

However, there is a possibility to change it. Once of the options here is via WINDOWS Registry. Below is the Registry path:


[HKEY_LOCAL_MACHINE\Software\SAP\SAP Shared] on 32bit operating systems

[HKEY_LOCAL_MACHINE\Software\Wow6432Node\SAP\SAP Shared] on 64bit operating systems

Key: SapWorkDir

Type: Expandable String Value

Value: The path you want to change

 

Fort someone who has no an access to the WINDOWS Registry this is not an option. Other possibility is to do it via user profile settings in SAP GUI. Simply call t-code SU3 and switch to tab called Parameters.

Here enter the param name GR8.



Give value to desired target directory for the parameter.


Once you use the file download functionality in any SAP GUI’s t-code the default folder will be pointing to the folder name given in the SU3’s param. Similarly, one can leverage other parameter CR9 that is used while uploading the files from user’s workstation to the SAP system.

Seems this is very old functionality as it is available in SAP NetWeaver based systems since component SAP_BASIS version 620 - that was released circa 2007.



More information:

622128 - Customizing the file Upload/Download paths.

Thursday, May 12, 2022

SAP for Me and SAP Support Portal vs ONE Support Launchpad

In my post, I do mention supports sites of SAP a lot. They are quite useful to search for an information about SAP products, issues, how-tos, also to request license keys, support or to download SAP software.  As there are many names for those sites I recon it can be useful to mention the latest ones.

In past we normally referred to these sites as SAP Support Portals either as OSS (Online Support System) or later as SMP (Service Market Place). Nowadays we can distinguish between two main support landing pages:

 

SAP Support Portal is one stop for all support and service related needs of SAP customers. It can be used to access the software, download the software, request license keys, get technical support, get an information about the software solution and find the documentation. Link: support.sap.com

 

ONE Support Launchpad is the new version of the Service Market Place (SMP) for all SAP customers. Link: launchpad.support.sap.com the site will soon transaction to SAP for Me that will be single entry point to all support site of SAP. Right now, the SAP for Me serves as a place to improve SAP customer experience throughout all touch-points with SAP. A list of all product’s portfolio, finance and legal stuff with customer relation to SAP is available there, other areas are service and support and systems and provisioning among other things are available via the SAP for Me site.


More information:

OSS

SMP

SAP Support Portal

SAP ONE Support Launchpad