Tuesday, April 30, 2019

How to read/write/delete from/to DSO objects

Sometimes it is needed to store data into DSO objects from ABAP. Either from BW’s transformation or for some reason from regular ABAP programs. Therefore some kind of API needed to be developed by SAP to allow this. There in classing (non BW4H) BW an several DSO types are available: standard/direct update/write optimized. The DSO type is needed to be considered and scenario of the DSO type shall be respected. Normally it makes no sense to write data to write optimized or standard DSO. Regular BW flows shall be used instead. The only DSO type is designed to be updated programically from custom code is Direct Update DSO. That’s why full API is only available for this type of the DSO.

DSO types                   methods of accessing
Standard                    Open SQL SELECT / INSERT or UPDATE / BAPI_ODSO_READ_DATA_UC / RSDRD_SEL_DELETION

Direct Update             Open SQL SELECT statement / BAPI_ODSO_READ_DATA_UC / RSDRI_ODSO_INSERT, RSDRI_ODSO_MODIFY_RFC, RSDRI_ODSO_UPDATE_RFC / RSDRI_ODSO_DELETE_RFC

Write-Optimized        Open SQL SELECT statement 
                                  / BAPI_ODSO_READ_DATA_UC


Note that in earlier versions of BW the FM BAPI_ODSO_READ_DATA was available but it is obsolete (as of version NW2004s) and BAPI_ODSO_READ_DATA_UC should be use instead.

RSDRI* FM are also available as non RFC enabled ones.


More information:

Time between SAP application server and server time not in sync

In case time of SAP server and server where SAP runs is not coordinated, there is an ABAP ZDATE_ILLEGAL_LOCTIME dump like below:

Category               Internal Kernel Error
Runtime Errors         ZDATE_ILLEGAL_LOCTIME
Application Component  Not assigned
Date and Time          08.04.2019 14:15:00
Short Text
     The local time on the application server is not correct.

Many SAP applications and functions are working based on premise that time always increase. When the times mentioned are not in sync it may lead to inconsistences of SAP data. These can be e.g.: generated ABAP source, inconsistent data creation by applications based on timestamps. Issue is even more relevant in today’s modern approach when SAP runs on virtual machines where it is hosted by host OS. 

Normally when this situation is observed a particular SAP application server on which the issue occurred must be shut down immediately. Afterwards OS must be checked but no reset of the OS time can be done if the SAP application server is still running. In some cases issue is with Network Time Protocol (NTP) that is responsible to synchronize times in a distributed SAP system among SAP servers and database server.


More information:
2591611 - ZDATE_ILLEGAL_LOCTIME
447839 - ZDATE_ILLEGAL_LOCTIME
2535959 - Dump ZDATE_ILLEGAL_LOCTIME occurs, what should be analyzed