Thursday, November 28, 2013

Unified SAP Developer License

This week SAP announced unified SAP Developer License. It is much expected initiative from many developers. This is license which will be used for most of ABAP and Java downloads available on SCN’s Download Center and SAP cloud offerings for developers. I guess that none of us lazy ABAP developer will ever read it fully. Bu what is most important to is and I quote from Juergen Schmerder blog:

Yes, that does mean you are free to share your ABAP projects on Github!) and it is free of charge and not limited in time.

So thank you SAP to make us – ABAP developers happy!


You can find full license terms here.

Monday, November 11, 2013

How to read other’s program data

When it comes to enhancing SAP functionality we usually talks about user exists, BAdIs and enhancement points. Their main purpose is to extent SAP standard functionality. As particular customer needs may differ from what is offered by standard enhancements are needed to fulfill that particular need. Therefore SAP ABAP programmers are very well known of them.

What does it take to implement the enhancement? Basically you need to find a point in standard code where you plug-in your part of enhancement code. It is not an easy to do so and it takes a lot of
debugging. What is even tricky you may get into the situation where you exactly know where to put the code but you do not have all the input information in order to produce desired output information. This is often case as input parameters of standard function modules or forms may be very limited. So some information that is needed may not be at the right place. But case can be that data is there sitting in memory just it is not part of interface of that standard functionality. Therefore you need to explore what are global data of that program module which were loaded in memory. This can be done using ABAP field symbols. Field symbol enables you to access the place in memory. It is placeholder or symbolic name for other field. It doesn't physically store the data for the field, it just points to its contents. It can point to any data object. Prerequisite is that the field symbol needs to be declared first before is assigned to the data object.

Field symbol has following declaration syntax:
FIELD-SYMBOLS <fs> [typing].

Here’s syntax for assigning Field symbol to the data object:
ASSIGN dobj TO <fs>.

Once we do not need Field symbol we can cancel assignment by following statement:
UNASSIGN <fs>.

Now let’s go back to original topic of how we can read global data from other programs. In order to read it you need to know what the ABAP program is where data object is used. Also it is necessary to make sure that a data object in that ABAP program has a value. Once we know that we prepare variable in format:

(PRG)DOBJ

Where PRG is the name of an ABAP program and DOBJ is the name of a global data object of this program. Let see in following short ABAP fragment of code:

DATAlv_data(30TYPE c.
FIELD-SYMBOLS  <> TYPE ANY.

lv_data 
'(RSAWBN_START)L_AWB_VIEW_MODE'.
ASSIGN (lv_dataTO <>.

IF <fs> EQ 'M'.
  "RSA1 was started 
ELSEIF <fs> EQ 'A'.
  "RSMON was started 
ELSEIF <fs> EQ ''.  
  "RSAWB was started 
ENDIF.  

Now if the program PROG (in this case = RSAWBN_START) is loaded during execution of the statement ASSIGN in the same internal mode as the current program, the data object (RSAWBN_START)L_AWB_VIEW_MODE is searched for in this program, and the field symbol points to this data object after the object has been successfully assigned.

This example would help us in imaginary extension of TA RSA1 of BW system. With help of this code we could possible enhanced RSA1 depending in which mode it was started. By this we would recognize in which mode RSA1 was started and we would put code into all 3 IF/ELSEIF statement.

Used sources:

Sunday, November 10, 2013

Dirty read in ABAP

SAP systems are based on Relational Database Management System (RMDB) systems or simply said database systems. That’s basically the place where all the data of the systems is stored in. There is an isolation property defined in databases. It is about definition when changes to the database are visible to other simultaneous or concurrent operations. Just side note isolation is one of ACID (Atomicity, Consistency, Isolation and Durability) properties of the databases.

From particular database systems point of view the isolation topic falls under one of phenomenas. Particular database recognizes phenomena during processing of concurrent transactions. If situation in the database is unclear we call it the phenomena. There are following phenomenas defined in e.g. SAP MaxDB as it follows ANSI/ISO standard SQL 92:

  • Dirty Read
  • Non-Repeatable Read
  • Phantom
With respect to Dirty Read: there is a situation when A row is modified in the course of a transaction T1, and a transaction T2 reads this row before T1 has been concluded with the COMMIT statement. T1 then executes the rollback statement, i.e. T2 has read a row that never actually existed. So it is dirty because we are not sure if we getting real data by that read statement.

Basically ABAP programmer should always try to avoid the phenomenas when designed locking behavior of custom tables.

Used sources:

SAP innovation mission control centre

SAP has a new offering to support SAP implementation projects. It is so called innovation mission control centre. They use a kind of NASA or control center approach to help the projects. SAP support services experts (part of SAP Active Global Support (AGS)) are using best practices to check, integrate, consolidate, leverage and run SAP solution you implementing to maximize its value.

The control centre comprises of three levels:

Innovation Control Center (ICC) - at customer’s/project location
Operations Control Center (OCC) – at customer’s/project location
Mission Control Center (MCC) – remotely located at SAP facility

Each is designed to complement the other and provide high-level support throughout the various stages of an SAP-centric solution’s lifecycle.

Current locations of mission control centers are: two in China, U.S. center in Pennsylvania, Germany, Brazil, Ireland and Mexico.

Unfortunately (usually within the SAP) more detail about the service itself is not available. I couldn’t find even one single SAP Note about it. The only one very brief presence of term “control centre” is in note 1170668 - The role of SAP Solution Manager in Remote Service Delivery. But note basically says about some of AGS services. So I’m not really sure if services described in the note are actually mission control centre services.

Used sources: