Friday, April 28, 2017

Error loading data from BEx Query – so called VirtualProvider based load

Recently I faced following error. It was on BW on HANA system and source of the load was BEx (or as now called BW Query) Query.

Parallel processing of query 1 resulted in the following messages:
Error reading the data of InfoProvider ZCUBE1$X
Error 2,949 has occurred in the BWA/SAP HANA server
view or procedure invalidated;table or view name = 0BW:BIA:ZCUBE1/[Request Info: Object Name = "SAPXXX"."0BW:BIA:ZCUBE1", FM
Error reading the data of InfoProvider ZCUBE2$X
Error 2,949 has occurred in the BWA/SAP HANA server
view or procedure invalidated;table or view name = 0BW:BIA:ZCUBE2/[Request Info: Object Name = "SAPXXX"."0BW:BIA:ZCUBE2", FM
Errors occurred during parallel processing of query 3, RC: 3
Error while reading data; navigation is possible
An exception occurred
Error reading the data of InfoProvider @Z_BEX_QUERY
Error reading the data of InfoProvider ZCUBE1$X
Error 2,949 has occurred in the BWA/SAP HANA server
view or procedure invalidated;table or view name = 0BW:BIA:ZCUBE1/[Request Info: Object Name = "SAPXXX"."0BW:BIA:ZCUBE1", FM
Parallel processing of query 2 resulted in the following messages:
Error reading the data of InfoProvider ZCUBE2$X
view or procedure invalidated;table or view name = 0BW:BIA:ZCUBE2/[Request Info: Object Name = "SAPXXX"."0BW:BIA:ZCUBE2", FM

Normally this should not be an error as having a BEx Query as source system is not an issue since BW 7.x. However this time even query wasn’t runnable. In attempt to run it I got message:

I tried to regenerate the query in in t-code RSRT but it didn’t help. Then I turned to SAP Notes search. I found a note 1656582 - Query terminations - InfoCubes, DSOs, master
Data in the SAP HANA DB. This Note suggests running ABAP rep RSDDB_LOGINDEX_CREATE for objects reported by the load error. It worked for me and after running it for both cubes reported I was able to successfully repeat the load.

The report offers to show XML output of all things that were recreated. Here’s how output message looks like:

Thursday, April 13, 2017

BEx History not appearing in Query Designer Open dialog

Recently I observed that in my BEx Query Designer there is an empty list on History part of Open dialog pop up window. I knew that I opened many reports in the same BW system in past so it looked like that something doesn’t work. The dialog popup looked like this:

I checked and I found that personalization of BEx History is not active. To activate it is can be done in t-code RS_PERS_ACTIVATE which points to ABAP report of same name.
The t-code is also accessible via SPRO -> SAP NetWeaver -> Business Warehouse -> Settings for Reporting and Analysis -> General Settings for Reporting and Analysis -> Activate Personalization in BEx.

For me it looked like below:

After activating it it turned to this and I started to get a list of previously accessed reports in BEx QD:

The data of previously accessed reports is itself stored in DSO “Personalization Data for the BEx Open Dialog [0PERS_BOD]”. ABAP code which does the activation is encapsulated in ABAP class CL_RS_PERS_PHK and in particular in method ACTIVATE. Table RSPERSHEAD stores information whether BEx History is active or not.

Within the t-code among the BEx history if can also be activated values for BEx Variables that were selected and in case of Web applications report’s drilldowns are saved.

Further information:
1849642 - New revision of the transaction RS_PERS_ACTIVATE
1638155 - Issues related to Inactive Personalization in BEx

Wednesday, April 12, 2017

When process chain will run next time?

One quick tip today for SAP BW developers here. 

When we need to find out when process chain will run next time we normally turn to t-code RSA1 or RSPC1. While having the process chain displayed there is a button “Next Start” available in the toolbar. Clicking on the button there is a pop up window displayed with the information about date/time of the next start.

Now how to find out the same if I need this information in my ABAP program? Luckily there is a nice FM RSPC_GET_DELAY. Just by giving the process chain name as input parameter it displays next start of PC.

ABAP inline declaration doesn’t work in SAP BW

Since I started to use ABAP inline declarations I liked it much. Naturally I’m using it in all SAP NetWeaver environments where I do ABAP programming. However in case of SAP BW I recently faced problem applying the inline declarations.

In particular I programmed a Start routine within SAP BW’s transformation. I used the inline declarations in the Start routine. If I put the same code I had in the routine into standalone ABAP program - the code seemed to work. But if I placed the same code into the routine I got error message while trying to activate the transformation – “Error in Start Routine”.

The transformation couldn’t not be activated. I tried to do hopeless thing – to remove the inline declarations. So I redid the code w/o it. And surprisingly it worked!

The version of the SAP BW system I used was:

SAP_BW                  740     0009   SAPKW74009  SAP BW
SAP_ABA                 740     0009   SAPKA74009  Cross-Application Component
Kernel release          742
Compilation              AIX 1 6 00F79A484C00 use-pr20160324 Mar 30 20
Sup.Pkg lvl.             329
ABAP Load               1981
CUA load                 40

As the inline declarations are available in NW release 7.40, SP05 I assume it should work in SP09. However turned out that BW doesn’t really work with it. In case it is used standalone (e.g. ABAP report or FM) without encapsulating it into BW object like the transformation it doesn’t. I need to try to upgrade my system perhaps to BW 75 to see if it is solved in there :)

Thursday, March 2, 2017

SAP BW/4HANA (B4H) versions

One of flavors of BW 75 is edition for HANA - so called B4H – see more information about it here. In this post I keep track of versions available for this product.

Version                                                  Gen. Avail.            End of Maintenance
SAP BW/4HANA 1.0                                07.09.2016              30.09.2019

SPS levels
3        02 (01/2017)                               30.01.2017
2        01 (11/2016)                               10.11.2016
1        Initial Shipment Stack                  07.09.2016

Support Portal (Marketplace) component: BW-B4H

Software Components:
BW4CONTB - SAP BW/4HANA Extended Content

Useful Notes:
2347382 - SAP BW/4HANA – General Information (Installation, SAP HANA, …)
2189708 - SAP BW/4HANA Add-On Handling and Usage

2404122 - Check for BW Upgrade to BW4HANA

Wednesday, February 22, 2017

What is embedded BW?

There is an embedded version of BW available as of NetWeaver 7.0. This means for any SAP NetWeaver based system like ECC 6.0, CRM 7.0, SCM, Solution Manager including SAP Business Suite and S4/HANA there is a BW available inside.

Primarily the  embedded BW shall be used within scenarios that are implemented in host system (ECC, CRM etc.) like embedded reporting scenarios (by leveraging BW's Analytic Manager (OLAP engine)) or embedded planning processes (leveraging BW's planning engine) however it is still full blown BW system. As per SAP they do not advise to use it as enterprise data warehouse.
Below are restrictions that are given by SAP while using the embedded BW:

1. Amount of data - shall not exceed 20% of total data volume in the system. If this happens there is probably a negative impact on core system functions.

2. Licenses – you may require license to run embedded BW in your NetWeaver system.

3. Security - it uses different authorization concept (BW one over classic concept used in ECC)

How to enable the embedded BW? Couple of activities shall be done in order to make the embedded BW work. This includes:
Assign Logical System Client – table RSADMINA
Set BW Namespaces to Modifiable - /BI0/* and /BIC/*
Activation of technical content
Switch On Business Function

More information:
1972819 - Setup SAP BPC optimized for S/4 HANA Finance and Embedded BW Reporting (aka Integrated Business Planning for Finance)

1919631 - Activating the BPC embedded

Monday, February 6, 2017

SAP S4/HANA editions / versions

In this post I try to summarize all versions of S4/HANA that are (or were) available per editions.

Last update:             06.02.2017

SAP S/4HANA On-Premises edition:        
SAP S/4HANA 1610                                          Oct 15, 2016            2346431
SAP S/4HANA 1511 FPS02                                Nov 15, 2015           2214213
SAP S/4HANA 1511 FPS01                                Nov 15, 2015           2214213
SAP S/4HANA 1511                                          Nov 15, 2015           2214213
SAP S/4HANA Finance 1503                              Mar 15, 2015           N/A

SAP S/4HANA Cloud edition:                   
SAP S/4HANA Cloud 1611                                 Nov 21, 2016           2388205
SAP S/4HANA Cloud 1608                                 Aug 12, 2016            2355076
SAP S/4HANA Cloud 1605                                 May 20, 2016           2314618

FP = Feature Package Stack
Rel. Note = points to SAP Note; a type of Release Information Note (RIN)

More information:

Monday, January 30, 2017

What foreign currency rate was used in BW currency conversion?

BW uses standard SAP’s ECC functionality with regards to foreign (FX) currency conversion. This means that same set of TCUR* tables are being used while the BW system is doing the conversion. This is valid while doing the FX conversion during transformation /loading of data and also while running reports.

In BW reporting a key figure in report can have Conversion Type specifies in its definition under Conversion tab in its properties. 

The Conversion Type that can be chosen here are defined in the SAP BW backend – in tcode RSCUR. Here all settings like: what and how an Exchange Rate shall be obtained; where a source and target currency shall came from; and Time Reference to which the conversion type shall be tied to are specified.

So this is all that can be setup for the FX conversion. While looking at the converted numbers in the report’s output an issue of wrong data can arise from users. Question here is basically what FX from table TCURR was used?

To find out that for starter an “Currency and Unit Conversion” debugging can be started form t-code RSRT. This is available by hitting on “Execute + Debug” button.

While debugging it can be seen that following function modules are used in following sequence:
RSW_CUR_TRANSLATION_RATE_GET   Wrapper function ->
-> RSW_CTT_GET                                  Reads currency translation type
-> RSW_SCUR_CHECK_AND_GET              Determine source currency
-> RSW_TCUR_CHECK_AND_GET              Determine target currency
-> RSW_TRANSLATION_DATE_GET  determines date used to find translation rate
-> RSW_RATE_GET_BASIC                              determine the translation rate
-> CONVERT_TO_FOREIGN_CURRENCY here function DATA_FROM_DATABASE is called which calls another function DATEN_BEREITSTELLEN and this one finally reads the FS rate from table TCURR for previously determined Currency conversion type; from/to currency, date and client of the SAP BW system.

Therefore you may want to just set a breakpoint into the FM CONVERT_TO_FOREIGN_CURRENCY to speed up debugging process.
Notice that variable DATC is nothing else just value from EXC_DATE variable converted into internal format by below ABAP statement:


This means the source variable in character format is converted into target one as complement on nine - difference to the number nine.
Needless to say that above statement is obsolete ABAP statement. It shall be replaced by using TRANSLATE statement.

More information:

Wednesday, January 25, 2017

Deleting error stack of DTP via ABAP

Error stack of DTP is function that is very useful in scenarios where data is not coming in proper format. While using it erroneous records are filtered out and only those which are correct are uploaded into data target. Later on BW administrator can correct the erroneous records and upload it too.

Below there is the error stack req ID 2.115.361 as depicted in DTP’s maintenance screen:

Now imagine that this error stack req is snot needed any more. We can also see it via ABAP report RSB_ANALYZE_ERRORLOG. The report provides a list of all available error stacks request in the system while analyzing contents of error tables:

To delete the error stack data of particular request we can use ABAP report: RSBM_ERRORLOG_DELETE while specifying particular DTP’s ID and ticking off “Delete Log” check box:

This is how output of RSBM_ERRORLOG_DELETE report looks like. After that the error stack req is not visible from RSB_ANALYZE_ERRORLOG either in t-code RSA1.

More information:
1095924 - Correction: Deletion/analyis report for error handling logs

Wednesday, January 18, 2017

Printing to PDF from SAP GUI

In case you need to save an output from SAP GUI into PDF format there are couple of options.

First of all Spool functionality supports saving PDFs within t=codes related to spool request such as SP02. It is available under menu Spool requests -> Forward -> Export as PDF…

In case system is based on older versions of SAP NetWeaver there are couple of ABAP reports that can be used to convert any spool request to PDF such as: RSTXPDFT4.

At last there are few applications t-codes such as in SD module: VF03 (Display Invoice) in which by entering PDF! Into t-code field automatically generates the PDF file.

More information:
1580639 - Is a PDF software required in windows for PDF conversion via device PDF1?

Tuesday, January 17, 2017

ABAP inline declarations

One of the new features of ABAP version 74 is inline declarations within ABAP expressions. The feature helps to shorten ABAP statements as there is no need for specific data variable creation upfront the statement.

The inline declaration is executed using an operator in a expression while placed in declaration position. Result of the inline declaration is used within the ABAP statement at the statement operand.


DATA(itab) = VALUE t_itab( ( ) ( ) ( ) ). 
LOOP AT itab INTO DATA(wa). 
DATA(text) = ’…’.


DATA(dref) = NEW t_itab( ( ) ( ) ( ) ). 








Method call:
oref->methIMPORTING p1 DATA(a1)
... ).
DATA(ref) = class=>factory( ... ).
DATA(ixml) = cl_ixml=>create( ).
DATA(stream_factory) = ixml->create_stream_factory( ).
DATA(document) = ixml->create_document( ). 

Target is work area:
  SELECT SINGLE @abap_true FROM /bic/pcompcod
WHERE /bic/pcompcod @i_compcod AND objvers 'A'
INTO @DATA(lv_compcode).
Target is internal table:
  SELECT scarr~*spfli~*
FROM scarr INNER JOIN spfli ON scarr~carrid spfli~carrid
WHERE scarr~carrid @carrier
ORDER BY scarr~carrid

More information:
ABAP News for Release 7.40 – Inline Declarations