Friday, September 29, 2017

How to get notification whether Process Chain ran?

There are some possibilities how to monitor runs of process chain in SAP BW system. It can also be achieved from web. However all these options are only informing about the PC status where it actually started to run at least partially. Means at least it reached to processing of the first process within the PC. From that very first process an message can be set up to inform user whether it ran successfully or it failed.

Now what about the PC didn’t run? How can user be informed that it for whatever reason didn’t run? There are not many options how to achieve this as far as I know. I created small ABAP custom program that can run as a job and will be checking the PC (name of the PC given on selection screen) whether it ran in last X days (X also provided on selection screen). Only coding that is missing is part that will send email. Check my other stuff on github for that.

Code available at my github:

Pattern Selection for DTP with source as DataSource (PSA)

It is not very known fact. At least it was in my case. I was a bit surprised when I realized that my DTP created on top DataSource which was extracting data from it via PSA didn’t pull any data. My case was that I had a filter on DTP where pattern selection was used.

Precisely speaking I had a wildcard used for selection like *something*. Once I ran it no data came. I tried to put precise value instead of the wildcards and it worked. I turned to SAP Support portal and I found a SAP Notes explain this behavior.

Actually this feature is not available in some of BW system. Depending on version of the BW it is only available in higher SP packages. TO be able to use this feature BW needs to be upgraded to these specific versions of the SP – see below.

There is one setting available in DataSource that is influencing behavior of particular field within the DataSource. It is called “Selection Options” and is present on tab Fields of DS maintenance screen. It basically drives what selection options can be processed for the DataSource field. Its values are stored in table RSDSSEGFD-SELOPTS (table has an info on DataSource - Segment Fields). There can be following values for the field set:

0        Undefined Selection Options
1        Selection EQ Permitted
2        Selection BT Permitted
3        Selection EQ, BT Permitted
7        Selection EQ, BT, CP Permitted

More information:
- For BW 7.00 and 7.01 see Note: 2509844 –SP37: Pattern Selection not possible for DTP with source as DataSource (PSA)

- For BW 7.30 and 7.40 see Note: 2150323 - 730SP14: Pattern Selection not possible for DTP with source as DataSource (PSA)

Friday, September 22, 2017

Issue while determine text for fiscal period related IOs

Some time ago I spotted strange behavior in BEx query related to text of fiscal period IOs. In case of 0FISCPER when I entered value of 01.2012 on the query selection screen the text associated with it appeared as March 2012. Similarly for other months there were texts that didn’t correspond to the entered months at all. Also in query output where values of all variables used in query were shown the text again didn’t match the entered fiscal period.

In case of the 0FISCPER the texts are taken from standard SAP table T009C - Period names. The table has also field Fiscal Year Variant (PERIV) specified as a key field. From that fact it is obvious that to get proper value of text for particular fiscal period the Fiscal Year Variant must be present in the query. If the key of Fiscal Year Variant is not present in the SELECT statement that used by query to retrieve the text then first entry that fulfils the SELECT is taken and most likely it is wrong.

Actually in case of my query where the texts of fiscal period didn’t work was missing 0FISCVARNT IO in the query. Once I added the 0FISCVARNT into the query global filter (restricting it to value of K4 in my case) issue was fixed. The query properly determined the text of fiscal period used in the query.

Monday, September 18, 2017

Communication failure while loading data to Open Hub

I came across a following error while using Open Hub functionality in SAP BW. An DTP that is used to load data from BW InfoProvider to the Open Hub it-self was failed and showing following errors:

Error: COMMUNICATION_FAILURE with function RSB_API_OHS_3RDPARTY_NOTIFY and target system . Message No. RSBO523

Error when opening an RFC connection (CPIC-CALL: 'ThSAPOCMINIT', communication rc: CM_ALLOCATE_FAILURE_RETRY (cmRc=2)). Message No. RSBO899

Error while updating to target (type Open Hub Destination) Message No. RSBK241

Operation could not be carried out for Message No. RS_EXCEPTION120
Exception CX_RS_FAILED logged Message No. RSBK228

There wasn’t any ABAP dump generated in BW system so it was obvious (also as per errors) that issue is in target external system that is picking up the data from Open Hub. I had a look into the FM mentioned in the error – RSB_API_OHS_3RDPARTY_NOTIFY as well. The source code of the FM looked strange to me.

FUNCTION rsb_api_ohs_3rdparty_notify.
*"*"Lokale Schnittstelle:

* must be implemented in the 3rd party system


What that “must be implemented in 3rd ..” means? After some more investigation it was clear. The FM is called by 3rd party system once extraction for the OH is done. The FM basically just sends back to called system information on how many data were extracted. All this is sent over in parameters of the FM – Req ID, no of records etc. To just transmit this basic info there is no need to put any additional code.

The FM is part of API available for connect a third-party tool to the BW. There are other API’s FM available too:

Now let’s came back to the error itself. This is basically connection error between the BW and target extremal system. Once connection between the two was re-established the load was successful.

More information:
1585460 - Error when running DTP to 3rd party Open Hub Destination

Friday, September 1, 2017

How to find existing workbooks in BW system

Here are few options how to find workbook in the SAP BW system.

1. Via BEx Analyzer: in menu of Analyzer called Open -> Open workbook. This give only list of workbooks that user is authorized to authorized to access to. Either via menu role, favorites etc.

2. Via Analyzer Office for MS Excel: in menu Analysis -> Open Workbook -> it can be opened either from BusinessObjects platform or from SAP NetWeaver platform. Here again only access to the workbooks that user is authorized to access. Just these workbooks are not those created in BEx Analyzer but either migrated to AfO or newly created in AfO.

3. Via RSA1 – Metadata Repository: in t-code RSA1 -> Modeling -> Metadata Repository all the workbooks from all users available are listed. While drilling into it all details like what queries are used in the WB, who created it, when, last change and many others also can be found.

4. Via ABAP – FM RRMX_WORKBOOK_LIST_GET. If you need to deal with available workbooks in your custom ABAP program you can use this FM to get list of the existing workbook. Input parameters are just 2:
I_SORT                          1           “comes by default
I_ALL                           Y            “needs to be supplied

Output is a table E_LIST which has all information about the workbooks like:
WORKBOOKID - GUID of the workbook      
TITLE                      - Long description
FILESIZE                 - workbook file size in bytes
QUERYCOUT             - no of queries used in the workbook      
TYPE                      - Indicator: InfoCatalog type
TSTPNM                  - Last changed by user
TIMESTMP               - Last changed on date and time in timestamp format

5. t-code RRMXP – program RRMX_START_EXCEL, here you can specify workbook technical ID and once it is entered it opens BEx Analyzer with particular workbooks.