Tuesday, December 15, 2015

Personalizing of BW reports running in JAVA web reporting environment

Recently one user ran into strange issue with standard report. He was able to run the report on one day with predefined layout and on another day the layout was gone and he was not able to get it to original report layout. For all other users report looked like before in its original layout. The issue was only occurring in web reporting on top of JAVA stack. In case the user ran in ABAP based web reporting or in BEX Analyzer the report was just fine.


There were other strange things popping up while making an attempt to run the report. In case user tried to make right click on the report he got errors like following:

Error: Variable Entry No variables available Cancel

Error: Incorrect Output Type on Rendering Context Menu Snippets (!= OUTPUT)

Issue is caused by the fact that user somehow managed to activate personalization on that particular report. He was perhaps clicking too much into the report (nervous finger problem) and he accidently clicked on context menu where he choose item “Personalize Web Application” and sub item “Personalize”. This caused that layout that was changed by him before was saved and every time he accessed the report he was getting different report that original report’s layout.

The issue was resolved by deactivating the personalization. It was very hard to manage to click on the context menu and to choose “Delete Personalization” but finally we have done that and it resolved the issue.


You can only face this issue in the system where personalization of web reports is active. You can check that by running program: RS_PERS_ACTIVATE. The program also enables switching the personalization on and off. Here’s how the program looks like when also all other personalization types are active:


Monday, December 14, 2015

Core Data Services (CDS)

Within raising significance of SAP HANA there needed to be programming frameworks introduced to speed up accessing data in database to SAP applications. This is purpose of Core Data Services (CDS) which is an infrastructure for defining and consuming semantically rich and reusable data models. Modern SAP apps like SAP Business Suite or SAP S/4HANA are leveraging the CDS as it represents data layer for them. Framework around the CDS supports creation of reusable data models in database instead of the ABAP server. Similarly it supports consumption of these data models.

The data models are defined in ABAP programs as CDS views. By dealing with the CDS views the ABAP program has an access to the data in the data model. The view implements a semantic data model in the ABAP Dictionary. It allows to define entity types (business objects like customer, order, ...) and semantic relationships between these objects. The relationships correspond to foreign key relationships in traditional entity relationship (ER) models. Technically the CDS uses SQL-based DDL language to literally describe the relations. Moreover there are additions to DDL e.g. associations, which define the relationships between CDS views, and annotations, which direct the domain-specific use of CDS artifacts. By having described the semantics by the annotations we can use data and data types in different contexts (e.g. UI, analytics, searching).

The CDS was introduced within SPS 05 for SAP NetWeaver 7.4. In NetWeaver 7.5 there are more than 6k SAP standard view definitions that can be leveraged. This number of the CDSs keeps growing plus there more and more functionality being added in new SPS of NetWeaver 7.5.


More information

Monday, November 9, 2015

UFLAG field entries in table USR02

Regular entries of field USR02-UFLAG which refers to domain XUUFLAG are following below. However in many customer systems there are many other values which do not refer to the domain.

0        Not locked
32      Locked Globally By Administrator = Locked by CUA admin (User Admin)
64      Locked Locally By Administrator
128     Locked due to incorrect logon attempts or too many failed attempts

Some of the values in there are sums of two different values which are actually present in the domain. For example value of 192:

192     A combination of 128 and 64: 128 + 64 = 192. The user was locked by itself by entering too many incorrect passwords and later it was locked again by Administrator.

There is also common practice by basis people to increase the value of field for all users in the system by e.g. 1. They do this in events of e.g. upgrades when they need to lock all users in the system. Once such an activity is done they decrease the values again by 1 to get to the state as it was before the activity. In case you encounter some strange values in the table it might be got created by such activity.


More information:
1887820 - Incorrect User Lock Status (UFLAG) in table USR02

Sunday, November 8, 2015

SAP NetWeaver 7.5

On Oct 20th 2015 next version of SAP NetWeaver – 7.5 a successor of 7.4 was announced. Main drivers for the 7.5 version are SAP S/4HANA; SAP Business Suite EhP 8 for SAP ERP (both on premise editions) and so called SAP NetWeaver hubs (SAP NetWeaver Identity Management (IdM), SAP Enterprise Portal (EP), SAP Business Warehouse (BW) and SAP Process Orchestration (PO) ).

From technology point of view the 7.5 supports Java 8, it includes enhancements for integration with SAP HANA Cloud Platform, contains innovations in ABAP, and it supports Internet of Things (IoT), mobile, cloud, big data and analytics.

Of course the NetWeaver 7.5 will soon be followed by other of its components (or hubs) with same version number. Therefore let’s look in more details to just technology – or so called basis components of the 7.5. In case ODATA (SAP Gateway) it supports OData version 4. With regards to HANA there is obvious trend that continues of pushing code down to the database and leveraging the information management capabilities of HANA. Speaking of big data the 7.5 has support for Hadoop and multi tiering. In case of Fiori performance optimization is delivered within the 7.5. Lastly within cloud topic there is integration with SAP HANA Cloud Platform (HCP) and the 7.5.

Looking closer at ABAP of the 7.5 the ABAP engine includes programming model via Core Data Services (CDS) for support for web based communication in real time for IoT use over TCP protocols. This is built on concept of the ABAP channels (already introduced in 7.4)

last update: 02MAY2023

Currently there are following SP of NW 75:

SP26                                           03/2023                            3257450

SP25                                           09/2022                            3231885

SP24                                           06/2022                            3144504

SP23                                           03/2022                            3158527

SP22                                           09/2021                            3053070

SP21                                           06/2021                            3028101

SP20                                           03/2021                            2993449

SP10                                           09/2020                            2924940

SP18                                           06/2022                            2901757

SP17                                           02/2020                            2859225

SP16                                           09/2019                            2824303

SP15                                           06/2019                            2804316

SP14                                           03/2019                            2722206

SP13                                           09/2018                            2674982

SP12                                           06/2018                            2627779

SP11                                           03/2018                            2597835

SP10                                           12/2017                            2555557

SP09                                           10/2017                            2484369

SP08                                           07/2017                            2500211

SP07                                           04/2017                            2407347

SP06                                           01/2017                            2393808

SP05                                           10/2016                            2349025

SP04                                           07/2016                            2285181

SP03                                           04/2016                            2241312

SP02                                           02/2016                            2240641

SP01                                           11/2015                            2213659

SP0 (Init Shipment Pack)              GA 20 Oct 2015                  2214565

 

More information:

Online docu

SAP NetWeaver 7.5 landing page

SAP Insider article

Detecting debugger in ABAP program

With relation to my recent post “How to determine simulation mode of DTP” where I was blogging about detecting debugger within BW’s transformation’s routines I was curious how to achieve the same with classic ABAP environment. Within the BW’s transformation it was simple there is a clear variable which simple evaluation get the answer weather the transformation is running in the debugger or not.

In case of pure ABAP environment it is not that simple. There are ABAP system field like SY-DEBUG and SY-BATCH which I immediately thought of. However at least in newer versions of NetWeaver (7.x) they seems not be functioning in case of evaluating whether the ABAP program runs in the debugger or not.

As next I found FM TH_GET_DEBUG_INFO which looked from description that it does the job: get debugging info… I tried to put following code into my report:

DATA: lv_dbg_cnt TYPE i.
 CALL FUNCTION 'TH_GET_DEBUG_INFO'
  IMPORTING
DEBUGGING_COUNT= lv_dbg_cnt.
IF  lv_dbg_cnt EQ 2.
   write: / 'dbg is ON'.
 ENDIF.
  IF  lv_dbg_cnt EQ 1.
   write: / 'dbg is OFF'.
 ENDIF.

However this didn’t work out either.

As third thing I found FM SYSTEM_DEBUG_BREAKPOINTS. This FM calls C function called 'DEBUG_CNTL' which finally does the job. Actually the breakpoints seem to be stored somewhere within app server memory and the C function provides them. The above mentioned FM needs to be called up with input parameter MAIN_PROGRAM which’s values is the program that we want to evaluate whether it run in debugger.

Down below is simple call of the FM. In case TABLE parameter’s BREAKPOINTS has at least one row then the debugger is set in source code if input’s parameter MAIN_PROGRAM.

This solution will work in cases someone puts breakpoints manually in source code. Therefore I think it should cover all switches to debugger in case the breakpoints are set. However it won’t cover the case if someone just hits /h and continues to debug the code.

REPORT  ZMM_TEST.
DATA: lt_breakpoints TYPE TABLE OF breakpoint.
CALL FUNCTION 'SYSTEM_DEBUG_BREAKPOINTS'
 EXPORTING
   main_program                = 'ZMM_TEST'
 TABLES
   breakpoints                 = lt_breakpoints.


Tracing incoming RFC or why SAP user is getting locked?

There are many discussion threads on SCN dealing with issue of SAP user which gets locked frequently and reason of this it not know. I recently faced same issue. My SAP user I’m regularly using in one of my SAP system was locked. As I’m using my cloud provider to host the SAP system for me and every time I needed to write an email to provider to unlock the user. After few times of bothering them I obtained new user which I was using to unlock my regular user. I started to use that new user instead of my regular one however from time to time I needed to use the regular user and it was still locked. I decided to invest some time to hunt a mystery of why my regular user was getting locked.

As mentioned I started with having a look at SCN and elsewhere to get an overview what I should do to get the mystery solved. I came a across posts like:

·         this – suggesting to use tcode STAD
·         this – suggesting to use ST03N tcode
·         this – suggesting to use tcode SM19/SM20 – Audit logs
·         this suggesting to use tcode ST01
·         this suggesting to use CCMS
·         this / this suggesting to use report ZRFC_STATRECS_SUMMARY (or tcode STRFCTRACE in newer versions of NetWeaver see Note 931251)
·         and many others.

I went through all of them however I was not able to figure out what was an issue.
One thing was obvious from reviewing all the posts was that it happens because of some RFC call. I checked with rest of developers who shares the same SAP system with me but none of them was using my regular SAP user to run their automated tests. Only thing which was for sure was that in tcode SM21 I was getting entries like following:

7.11.2015
00:51:32 DIA  008 800 MYUSER US  1 User MYUSER locked due to incorrect logon
02:16:58 DIA  001 800 MYUSER US  1 User MYUSER locked due to incorrect logon
17:06:42 DIA  000 800 MYUSER US  1 User MYUSER locked due to incorrect logon

I tried to setup few system profile parameters to increase level of logging. After every such an attempt I unlocked my regular SAP user and I waited to get user locked and I reviewed logs but not a chance to reveal the mystery.

Finally I ran to SCN post which suggested to setup following profile parameter:
rfc/signon_error_log to value 2

The parameter causes that when the RFC logon fails the SAP system create an ABAP dump with all the call’s detail. The ABAP dump is called “CALL_FUNCTION_SIGNON_REJECTED” and it basically provides all information that helps to identify the FCR call causing the issue:

Category               Installation Errors
Runtime Errors         CALL_FUNCTION_SIGNON_REJECTED
Date and Time          08.11.2015 18:11:32
 Short text
     You are not authorized to logon to the target system (error code 53).
Meaning:
53   PASSWORD_ATTEMPTS_LIMITED  Lock counter exceeded
Server-Side Connection Information
Client.............. 000
User................ "SAPSYS"
Transaction......... " "
Call Program........."CL_BGRFC_SUPERVISOR_START=====CP"
Function Module..... "BGRFC_CHECK_SCHEDULERS"
Call Destination.... "xxxx_RFC"
Source Server....... "abcserver_SID_sysno"
Source IP Address... "1.1.1.1"

Based on “Call Program” I was able to identify the thing which was causing the issue. Once I entered proper password to RFC destination actually used for bgRFC in tcode “SBGRFCCONF - bgRFC Configuration” issue disappeared and the mystery was solved!

Tuesday, November 3, 2015

How to determine simulation mode of DTP

Simulation mode of DTP is quite useful function of BW. When there are some issues with the data in target of transformation we can use it to see how actually the data was transformed. In particular we can see in the debugger what is going on with the data within the transformation.

For debugging of the DTP we use Simulation of the DTP.  While using system basically jumps into debugger. For details how to use it see this wiki or online documentation.

While the DTP is running in Simulation mode no data is uploaded into the data target. This basically means that no data is changed. Sometimes there is ABAP code within the transformation where we manipulate further data e.g. in custom tables. Of course running in the Simulation mode we want to avoid manipulating the data in custom tables. As these are the custom tables by SAP standard it is not guaranteed that data is not saved as it is not saved into the BW data targets. So it is up the BW developer to ensure that no data is changed in in custom tables.

To implement it we can leverage the attributes of Simulation mode of the transformation – means Simulation of the DTP. In custom coding we can easily identify heather the DTP is running in the simulation mode. The attribute of simulation DTP carries value "DTPR_SIMULATION" in the request. Here’s example ABAP coding:

    IF request NE 'DTPR_SIMULATION'.
      MODIFY dbtab …
    ENDIF.


This fragment of code can be used in any of start/end/expert routines.

Sunday, October 18, 2015

ABAP documentation related tcodes

Being ABAP developer I often need to look up syntax of particular ABAP statement. Similarly as in discussion here I think that coding itself as activity in any of programming language is “state of mind” thing and rest (like in which language is the code written or what syntax it has) is not that important. Therefore I really like features of ABAP IDE either in SAP GUI or in Eclipse which helps me with syntax. Using e.g. auto-completion tool helps me to focus on the code and not on what the syntax of any particular syntax is. Because as said already; the syntax is not that important.

Furthermore often I need to look up some more documentation about the ABAP statements. For this I use couple of t-codes that help me all the time:


ABAPDOCU     Display ABAP Documentation - display popup called “ABAP Keyword Documentation” where I can review documentation from different standpoints like ABAP Reference, ABAP − Release-Specific Changes, ABAP Programming Guidelines, ABAP Glossary, ABAP Index, ABAP Examples, ABAP syntax diagrams, etc.

ABAPHELP           Search ABAP Documentation – display small popup with search term field where it is possible to enter any ABAP keyword and to get an documentation for


ABAP_DOCU_SHOW Call ABAP Keyword Documentation – same as ABAPHELP

Performance: Function Module interface check

In case there is an integration scenario for which a function module (FM) is exposed to external applications an performance point of view is important to be considered. It may happen that the FM with complex interface occurs performance issues.
What is meant by complex interface? Basically if there are any complex or nested data types within IMPORT/EXPORT/CHANGING parameters of the FM.

Complex data types - are made up of other data types. A distinction is made here between structured types and table types.

Nested structures – are structures that in turn contain one or more other structures as components.


To identify the FM which may have performance problem you can use report RSRFCXC. The report should be used before exposing the FM. Output of the report is evaluation of every FM’s parameters whether it may have a problem and also how to correct it.


More information:
744664 - Checking RFC-compliant FMs for complex parameters

Friday, September 25, 2015

Adding BW objects from temporary into development package

This is common issue in BW systems. Especially in systems which are productive or golden ones where no any changes were foreseen. If in such a systems an objects like BW objects of type BEx query, Query Elements, DTP, InfoPacks, etc. were created they were assigned to local package $TMP. These objects in local package are not transportable. In case it is needed to transport thee objects an assignment from $TMP to real development package must take in place.

To do this we usually go into object directory entry and we assign the object into development package. However if the system is closed for an changes this re-assignment of the package is not possible. While doing such an attempt there is error messaged showed as below.

Therefore always plan ahead. If there is necessities to re-assign the development package in e.g. productive system make sure that you get your system opened. The opening of the system/client itself takes place in t-code SCC4.

System setting does not allow changes to be made to object ELEM 00O2SPCKTAN9FU9JJTONQD8BW

Message No. TO128

Diagnosis

The system and namespace change option set for this SAP System does not allow any changes to be made to object ELEM 00O2SPCKTAN9FU9JJTONQD8BW.

System Response
Editing is terminated, the object can only be displayed.
Procedure

If you want to edit the object ELEM 00O2SPCKTAN9FU9JJTONQD8BW in this SAP System, have your system administator set the SAP System to "modifiable" for this object.
This can affect the modifiability of the namespace /0CUST/ or the namespaces that correspond to the pattern /0CUST/, as well as the global setting of the system change option.
The system change option is set using the Transport Organizer tools (Transaction SE03). Expand the Administration node and execute the program Set system change option. The options are described there.


- Update 21/05/2017 –
Got a tip from a friend – Martin Kuma regarding below error that may occur while inserting BEx Query elements into transport request via Transport Connection:

Object ELEM 00O2TK9973U27J5NF6N1XHFOP is generated, and cannot be transported. Message No. RSO215


To overcome this error an adjustment of TADIR table’s field GENFLAG is needed for particular entry. Value X of the field GENFLAG shall be removed and then it is possible to collect the entry into the transport request. The GENFLAG field basically identifies entries that were generated directly in the NetWeaver system.

Tuesday, September 15, 2015

Maximum attachment size limit for an email sent from SAP

Sometimes it may happen that outgoing emails from SAP instance are not going through. They are stuck in queue and have red status saying following error:

Cannot process message; maximum size exceeded
Message No. XS850

This clearly indicates that email is too big to get it sent over. Case might be that it has an attachment which size is causing this. It is worth to investigate actual size of the email and the attachment. However one may end up having email already compressed and facing this issue. So further compressing of the email attachment makes no sense. Therefore chance is to check what actually the limit of the email size is. Parameters related to the size of email and its attachment are customizable. The customizing table is called SXPARAMS - SAPconnect: Parameter Table. Its maintenance is available t-code SOST -> Utilities -> General Parameters or via SM30 -> SXPARAMS.

Few parameters related to size of email and its components:

Parameter                                        Parameter value

MAXLEN_BODYPART_SMTP             0 ... 999999999999   size for a document
MAXLEN_BODYPART_ALI_SMTP       0 ... 999999999999   lists of the type ALI
MAXLEN_BODYPART_OTF_SMTP      0 ... 999999999999   SAPscript documents

MAXLEN_MIME_MESSAGE_SMTP     0 ... 999999999999   MIME MIME attachments



Update 02-08-2016
There is one more parameter of SCOT. It is related to size of email.
MAXLEN_BODYPART_EXT_SMTP      size for an attachment, default value: 10485760

How to recognize whether SNC is installed in SAP system?

SNC is very often used by SAP customers to secure the data exchange between SAP and external systems. Also communication form SAP GUI to SAP backend by default is not encrypted. To secure communication like these and SNC needs to be implemented in SAP systems landscape.

The SNC or Secure Network Communication is an interface securing communications between two secure SAP systems; it provides application-level, end-to-end level of security. Protection is usually provided by an external security product that is available to SAP system using SNC interface. The interface complies with internet standard Generic Security Services Application Programming Interface (GSS API) version 2. The default product provided by SAP is the SAP Cryptographic Library, which you can use for SNC between SAP System server components.

Sometime there is a question form customers whether they do have the SNC in place. How to quickly check this? There are couples of ways…



1. By running Function Module SNC_CHECK_ACTIVE: The FM has no import parameters. Therefore just open the tcode SE37 put the name of the FM and run it. In case the SNC is enabled in particular SAP system there is export parameter ACTIVE set to X returned.



2. table USRACL: it stored SNC Access Control List (ACL)for users. In case the SNC is enabled every user recognized in field BNAME has field PNAME populated. In that field a canonical name is stored in format:
p:CN=@company_domain
e.g. p:CN=MMARUSKIN@MARUSKIN.EU


3. t-code SU01: in case the SNC is enabled an particular user has following data in tab strip called SNC:
SNC Status: SNC is active on this application server
SNC Data: SNC Name: p:CN=@company_domain

Sunday, September 13, 2015

Can’t set more than 30 breakpoints

Sometimes it is very easy to set many breakpoints while digging into SAP system. Very common case for that is to set a breakpoint into every statement like MESSAGE. Then in case one still needs more breakpoints following messages pops-up:

Can’t set more than 30 breakpoints
Message No. SY407

It is a matter of fact that there is this hard limit on number of breakpoints = 30 per one login into the system. It is not possible to set more breakpoints than that. The breakpoints (session breakpoints) are managed by C function DEBUG_CNTL so it is not possible to tell where the list of the breakpoints already set are stored. Only in case of external breakpoints it is possible to determine no of these. They are stored in table ABDBG_BPS.

Now how to easily get rid of all the breakpoints currently set in the system? Deactivating and also removing the breakpoints can be achieved in following ways:

1. In ABAP Workbench (tcode SE38): while in source code, see menu:
Utilities -> Breakpoints -> Delete
Utilities -> External Breakpoints -> Delete

2. In ABAP Debugger, menu: Breakpoints -> Delete all BPs or Deactivate all BPs

3. tcode RSBREAKPOINTS -> Delete Breakpoints


More information on breakpoints topic:
Remote ABAP Debugging and more (btw: this blog was written almost exactly 6 years back from writing this blog J )