Thursday, September 18, 2014

How to trace RFC calls

Integration projects where we deal with different systems communicating between each other are pretty challenging. Comparing to other projects where everything happens in one system there is a huge effort to check if integrated systems are communicating together. This can be sometimes really tricky. Sometimes one cannot even be sure about single BAPI whether its call properly reached the system or not.

One of the ways how to simple check if RFC function residing in SAP (e.g. BAPI) was called can be achieved in TA ST05. Here it is possible to set so called RFC Trace. This is functionality which listens on calls from remote systems and tracks it down.


All what needs to be done to set this trace on, perform the remote call to SAP, deactivate the trace and analyze the trace results:



Tuesday, September 16, 2014

Report RSPPARAM – display profile parameters

Today - just very quick one related one useful tool. There are transactions available in the system to see what are values of system profile’s parameters. Just to name few:

RZ10                 Maintain Profile Parameters – complex one, you can choose different profiles and 
its version, and you can maintain the parameters here via Extended maintenance radio button

RZ11                 Profile Parameter Maintenance – you can display just one parameter at the same time and change its value


But what to do if I need to see values of several parameters? I do not want to go one by one within TA RZ11… There is nice and handy ABAP report called RSPPARAM. It allows displaying of current settings of the several profile parameters at the same time in one screen. Moreover I can select pattern for name of params using wildcards.








PS: I mentioned this report for first time in this blog at this post: Strange question marks appeared in SAP user interface?

Thursday, September 11, 2014

Refresh Function for Individual Query in BEx Analyzer

Sometimes BW power users are maintaining huge workbooks with many queries. Kind of their “personal dashboards” with important data out of BW systems. The problem with these workbooks is that sometimes it takes very long time to get the workbook refreshed. To solve this; users were looking to kind of functionality where they could decide which query contained in the workbook should be refreshed.

Finally this function is available there. It is called "The Single Query refresh" functionality of the BexAnalyzer. It allows refreshing individual queries if there are several queries used in the workbook. Before once user clicked on refresh of one query; it refreshed it but also other queries were refreshed.
To implement this we need:

1. In BW server: enable parameter ANA_SINGLEDPREFRESH with value X in transaction RS_FRONTEND_INIT.


2. In the workbooks: on General tab of the Workbook in Settings dialog, a flag "Allow Refresh Function for Individual Queries" must be checked. Once this is done there in context menu of an item that belongs to the query a query it has one more option called "Refresh This Query".

ABAP Report that only carries texts

I found very interesting report. It has no ABAP code at all. But it has a lot of text in there instead. Name of the report mentioned in here is RSR_BEXANALYZER_TEXT. The texts which it carries are related to BW’s BEx Analyzer. So basically all the texts used within this Windows based tool are stored with the report.











The texts are downloaded to user’s folder (%temp%\BW\COMMON\texts\ into the file e.g. BExTexts_EN.xml as per language used for login) when first logon to BEx Analyzer is performed. There are many SAP Notes which deal with the report. Mostly they deliver new or changed texts. So once you are not able to see new/changed text delivered by Note you may want to delete this folder or file to get refreshed texts to your workstation. See SAP Note “1732598 - Text Elements do not appear correctly in BEx Analyzer” for details.

I was curious to know how many texts the report has. So I prepared short ABAP report to count that. Here it is:

DATAlt_tpool TYPE TABLE OF textpool,
      lv_lin   
TYPE i.

    
CALL FUNCTION 'RS_TEXTPOOL_READ'
      
EXPORTING  OBJECTNAME 'RSR_BEXANALYZER_TEXT'
                 ACTION     
'DISPLAY'
                 
LANGUAGE   'E'
      
TABLES     TPOOL      lt_tpool
      
EXCEPTIONS others     0.

DESCRIBE TABLE lt_tpool LINES lv_lin.
WRITE/ lv_lin.

BTW: in my system based on SAP_BW 731 SP 0002 it has 827 texts.


So basically this is how I was playing tonight J

Limitations of SAP RFC

As said in previous post an RFC technique is heavily used within SAP systems and while SAP systems are communicating with external systems as well. When it comes to RFC based communication it caused some problems. This is due to the fact that also RF as every other technology has its limits.

Below I list potential issues within RFC and things can be done to solve or to forego them:
1. Delays while processing RFC calls by Registered Server Program on Gateway (TA SMGW): It can be observed e.g. by huge amount of IDocs in yellow status (status 30: delays transferring outbound IDoc from the layer to RFC layer). This may be caused by not utilizing all max connections that can are available. Solution is to increase max connection setting for RFC queue. To be done in TA SMQS: menu Go to transaction SMQS: menu Edit -> Registration and on next pop-up increase the "Max. Conn." field. More details.

2. While calling RFC enabled FM there is a ABAP dump: OPEN_TASK_LIMIT_EXCEEDED: This is due to insufficient check on available resources. You may want to configure open task limit using profile parameter rdisp/task_limit. Moreover check configuration of quota for RFC resource check by parameter rdisp/rfc_max_open_tasks. More details.

3. Getting errors like: "No WP block received" or "No APPC block received" or "No free block found in the WP Communication Area" in system log (TA SM21): Maximum number of RFC connections by parameter rdisp/max_comm_entries needs to be reviewed. More details.

4. No resources made available for parallelization with asynchronous RFC (dump RESOURCE_FAILURE): Some of following system parameters needs to be reviewed: rdisp/rfc_min_wait_dia_wp, rdisp/rfc_max_own_used_wp, rdisp/wp_no_dia, rdisp/rfc_max_queue, disp/rfc_max_login, rdisp/rfc_max_own_login, rdisp/rfc_max_comm_entries. See more details at help.sap.com

5. Time limit for execution of RFC call: As RFC calls are executed through dialog work processes it depends on max runtime allocated to a dialog workprocess in system. Therefore check system parameter: rdisp/max_wprun_time.

6. Max limit of supported simultaneous RFC connection: Review system parameter rdisp/rfc_max_login. More details.


7. Limitation of data volume passed back to calling app by RFC enabled Function Module: There is no limitation from data volume point of view. But the RFC should not time out processing the particular data volume. See point no 5.

SAP RFC

A lot of data is moved within SAP systems or while SAP systems are interfaced to/from external systems by RFC. RFC stands for Remote Function Call. Basically it means that one systems calls particular function (Function Module) in other system remotely. Needless to say that this functionality is heavily used within SAP.

If the SAP ABAP based (NetWeaver) system is called from other SAP ABAP based system then the system where the call of Function Module is supposed to take place as recognized by destination.

If non SAP ABAP system is calling SAP ABAP system then instead of Function Module programmed function is called. This function is delivered within SAP connector. It does simulate a function module. Depending on platform from where calling app sits there are multiple connectors for SAP available: JAVA, .NET. By this several programming languages are supported: JAVA, C/C++, C#, Visual Basic, PHP, etc.

The RFCs calls can be:

·        Synchronous - Remote function call that waits for the processing of the remote function to be completed

·        Asynchronous - the calling systems is not aware of how processing of the remotely called function ended

·        Transactional – RFC call flags the remote function to be executed and starts it with a COMMIT WORK.


Slovak specific SAP enhancement: VAT Ledger

From time to time there are some legal changes into laws in some countries. As SAP is ERP system used also to report the data by organizations to state’s authorities such a change must be implemented in SAP to support customer while providing the data. This is also case of recent change in Slovakia. As of 1st Jan 2014 an amendment of Act 222/2004 collection on Value Added Tax came into force. It mandates the organization to provide electronic VAT ledger (Kontrolny vykaz DPH - so called in Slovak language).


SAP provides the VAT ledger functionality within SAP Note: 1957498 - VAT Ledger for Slovakia.

Wednesday, September 3, 2014

Strange entries in table RSRREPDIR

From time to time BW guys need to have a look into table RSRREPDIR. The table is directory of all BW’s BEx queries. One of cases when the table needs to be checked is if there is inconsistency within the query. If it is the case then OBJSTAT flag is set to inactive. To fix this the BEx query has to be regenerated in TA RSRT.

However I want to talk about something different here in this post. Within the data in the table there may be some strange values appearing. This fact was brought to my attention within following post in the SCN forum: SAP Bex query shows "!!A" in RSRREPDIR table.


!!A mystery:
Basically it is about COMPUID and COMPID fields. There can be a values in these starting with: !!A. As it is correctly answered in the mentioned forum post – it is caused that query which starts with !!A was directly created in BEx Query Analyzer on top of multiprovider or cube. So no BEx Query Designer was used to build the query. This practice is common when we need to get some data out of the infoprovider but we do not have authorization to run BEx Query Designer e.g. in test or production environment.


$$DEFAULT mystery:

Other strange characters that may popup in the RSRREPDIR table is double $ sign ($$). These two characters are usually present in table in form: $$DEFAULT in fields COMPUID and INFOCUBE. The $$DEFAULT is technical object which needs to be located in the table. It represents default BEx query in BW system. There are few checks performed for this object (represented by cl_rsr_supprmess=>n_c_default) in standard SAP code. Seems even several lines in the table with this value are possible in some systems. Despite the fact that there are some SAP Notes mentioning the $$DEFAULT I wasn’t able to figure out what is its purpose. Fact is that such value is there and seems it is not causing any issues in BW system.

Run time comparison of Process Chains

There is an easy way of how to compare PC’s runtimes. The comparing function is available in TA ST13. I already blogged about the TA here. Basically it contains a set of useful tools for not only for BW. One of the tool - BW-TOOLS enables BW administrator to easily compare runtimes of PCs. It is possible to filter dates on which the PC ran and based on this analyze it.















Other posts on ST13 topic:

Time zones in SAP

I blogged already few times (see below) about time zones in SAP application servers. Also about an importance of it. One of the very basic requirements while it comes to time zones is to check what current time zone of server and how to change it. As time zones topic is very complex SAP is providing few SAP Notes explaining the topic. 

One of them is: 198411 - Current data and information about time zones. The note contains an attachment where the topic is discussed at very detailed level. As someone is being SAP Basis consultant this Note may be interesting for such a person.

Other posts related to time zones:

Monday, September 1, 2014

Software archeology in terms of SAP

"REPORT HAS BEEN DEACTIVATED". You may find statement saying that within ABAP code like reports. One may wonder what does it actually mean. Usually the case is that the code is obsolete and it should not be longer used.

What makes SAP code obsolete? These are cases I’m thinking of:

·      Particular function was rewritten (refactored) and an old one is not needed any more and is obsolete.

·       Functionality implementation error. Some part of functionality was intended to be present but later it was decided to do not implement it but some initial code remains. Thus remaining code is obsolete.

·     Implementation errors in security area. There is potential security risk or vulnerable patterns with the code. These can be following - just to name few: hardcoded users or passwords, performing certain code without logging it or without checking authorization objects, direct access to critical DB tables, injections issues (ABAP, SQL one), RFC execution, directory traversing, using of wait commands, etc. These errors were not detected during security checks of development cycle and were rolled out to customer’s systems. These kind of errors make parts of the code obsolete.

As soon as the refactored code is delivered or implementation type of errors were explored a corrections are prepared (mostly in form of SAP Notes). These corrections mark the code as obsolete and prevent execution of it.














That’s basically what happened in case if we see e.g. REPORT HAS BEEN DEACTIVATED in the ABAP code.
To enforce that particular ABAP code will not be used it is even commented out. The code needs to be comment out instead of simply removing whole objects in order to prevent unnecessary ABAP dump. By this user informed about obsolescence: 





























Other point of view (as suggested in the comment that introduces deactivation of the function) is software archeology (see 1st screenshot). Even seems it is practice in SAP that after few more releases particular code is not only commented but also removed it is very nice to see a track of software archeology J

ABAP search source code functionality – part II

Very long time ago; I blogged about possibility of how to search within source code of ABAP reports. That was in year 2009 you can find that blog post here - ABAP search source code functionality. Meanwhile there are changes that occurred within field of source code searching.

First and foremost the ABAP report RSRSCAN1 which is most known as tool to do the searching is not supposed to be used anymore. Well this was the case also in 2009 but that time at least the RSRSCAN1 didn’t dump with error: READ_REPORT_LINE_TOO_LONG. However this is not the only change that happened. As suggested in the RSRSCAN1 we shall use TA SE38-> Utilities -> Find in source code function. This one has an disadvantage that while you choose this function it generates list of object that will be search. The list is prepared as per input that is in field “Program” in TA SE38. As most of us initially we would leave the “Program” field blank in order to search all the ABAP reports then this list is never generated and subsequently we would never get to dialog box which is need for adding of search criteria. Of course this is pretty reasonable and it makes no sense to search within all the ABAPs in the system. Usually we would need ot have search range in mind before searching. But all in all this means that searching within SE38 also do not work.

Another possibility is other standard ABAO report which is RS_ABAP_SOURCE_SCAN. As per its current version (last change on 13.01.2012) available in SAP NetWeaver 731 it actually works while it is schedule for run as background job. Nevertheless as per SAP Note 1968886 - RSRSCAN1 is no longer supported even the RS_ABAP_SOURCE_SCAN became obsolete and in within SAP Basis 74 it is removed.


Other possibilities: There are many possibilities of how to search in ABAP source code outside an SAP. Here I mean that an external tool is accessing ABAP’s repository sitting in SAP’s application server. These are usually the tools used by security companies which do the scanning of the code for exploring the code vulnerabilities. If you want to use such an approach have look into the blog series of Martin Ceronio: part 1, part 2, part 3.

Mapping between IDoc segment’s fields and SAP application fields

This blog is intended for ABAP developers (me including) dealing with interfaces. In particular the interfaces developed in SAP ALE – means IDoc technology.


From time to time I need to quickly check what is field mapped to field in IDoc’s segment. To do that it is very common to use TA WE60 – Documentation for IDoc basis types. Basically inhere I need to know what IDoc basic type I’m interested in and I can quickly get overview of all the fields within segment of that IDoc basic types are used.  So this gives me a list of all the fields within particular segment (or all segments in particular basic type of IDoc).



However sometimes it is a case other way round. I would like to know what segments are out there where particular SAP application field is used in. For this I can use table EDSAPPL.


Thursday, August 28, 2014

Something about SAP Application Interface Framework (AIF)

In 2010 SAP introduced new solution for monitoring of interfaces from business perspective. It is called SAP Application Interface Framework (AIF) and it enables decoupling of technical and business aspects of interfaces. By this business users can perform error handling and other corrective actions for interfaces in single framework.

While implementing a new interface with utilizing of the AIF there is an implementation framework. Within the framework there are configurable tools where mapping of business values and implementation of business validation rules take place. Following the implementation the mapping and validation are made available in a monitoring cockpit of AIF. In the cockpit the business users can monitor and fix an issue occurred in the interface.

Technically it is delivered as add-on into SAP ERP (ECC, CRM, ..) solution. The lowest version of SAP NetWeaver which is supported by AIF is 7.0 SP17 of Basis and ABAP component.


Basic transactions:
Main costuming of the AIF Use transaction code takes places in TA /AIF/CUST. Value mapping is maintained in TA /AIF/VMAP. Monitor is to be done in TA /AIF/IFMON.

More information:
1757038 - Developer Cookbook for SAP Application Interface Framework
1530212 - SAP Application Interface Framework FAQ

1529247 - Release strategy for the ABAP add-on AIF

Scanning custom ABAP code for security risks

Similarly as SAP is during security checks of the standard software that they are delivering they offering tools enabling doing of the same for customers. There is a tool called "SAP NetWeaver Application Server add-on for code vulnerability analysis" or also known as Code Vulnerability Analyzer (CVA).  The tool carries out a static analysis of the custom ABAP source code in order to reveal possible security risks.

The tool is available in NetWeaver ABAP Stack based deployments starting with version:

7.0 NetWeaver: in EHP2 SP 14 or higher
7.0 NetWeaver: in EHP3 SP 09 or higher
7.3 NetWeaver: in EHP1 SP 09 or higher
7.4 NetWeaver: in SP05 or higher

In order to use the CVA tool first execution of system wide security checks needs to be enabled with report RSLIN_SEC_LICENSE_SETUP. Afterwards in standard ABAP code checking tools like: ABAP Test Cockpit (ATC), Code Inspector (SCI), and extended program check; the security checks are available. Option of these checks is usually called: "Security Analyses in Extended Program Check".

Notice that usage of the security check features for custom code is licensed separately and there are additional costs incurred. Also notice that the tool has several limitations -> see SAP Notes below for details.


More information:
1855773 - Security checks for customer-specific ABAP programs
1697494 - Customer Code Scans
1841643 - Customer Security Vulnerability Scans

1949276 - Code vulnerability analyzer: Restrictions

Tuesday, August 26, 2014

Inserting data into InfoProviders manually

Usually in case of need for manual input of data we speak about planning applications in BW area. There are technologies like BW-SEM (Strategic Enterprise Management), BPS (Business Planning and Simulation) BW-IP (Integrated Planning) where those applications are being developed for specific needs of business users. Of course there are more planning offering from SAP I just mentioned here a few.

Although it is quite rare situation BW developers sometimes face situation where customers are demanding function to enter the data into InfoProviders manually even application is completely not related to planning. In this case it means to have a possibility to insert the data into BW’s InfoProvider w/o any InfoPackage/DTP any transformation/update rule. The requirement like this may sound strange. To name few situations where this can be applicable can be: lack of data in development/test/QA environment and no time to develop regular BW flow to populate the data. Also one could create planning function to the manual entry but again we do not want anything from planning be involved in here.

So given this there are following options available in BW to insert the data manually:


1. TA RSINPUT (Manual Data Entry) – supports cube and DSO objects but cube must be type of real-time and DSO must be type of direct update. There are 2 steps that need to be carried out. First you can configure which fields will be marked as for selection, maintenance, no entry, mandatory and as default value.  This is done on CONFIGURE screen. On next screen which is CHANGE/CREATE screen we can actually enter the data. ALV type layout is displayed for convenient entering of the data.

2. ABAP report CUBE_SAMPLE_CREATE – works with the cube regardless of its type. It can be “Standard InfoCube” or “Real-Time InfoCube” However the report works only for cubes no other infoproviderrs (e.g. DSOs are supported).
Values can be populated into the cube in following modes:

A) Generated Values – all values are randomly generated just to fit the type of infoobjects used.

B) Vales from Master Data Table – values from corresponding Master Data tables are used to fill up the data.

C) Ready-For-Input ALV – Only values that are entered by user are saved in the cube. User gets ALV input screen and can freely add the data as he/she wishes.

3. Custom ABAP report – One can create custom report similar to option no 2. This can be tailored only for specific cube and can be designed to run in background. You can use FM CUBE_SAMPLE_CREATE_NEW to see how data should be processed and FM RSDRI_CUBE_WRITE_PACKAGE to insert the data.


Additional info:

NetWeaver Unified Connectivity (UCON)

UCON is new connection framework in SAP NetWeaver aiming to deal also with security aspects of RFC (Remote Function Calls) calls from outside systems into SAP NetWeaver systems. The UCON framework reduces no of Remote Function Modules (RFM) which can be accessed or let say called from outside systems.

SAP ERP solution contains approximately 38k of RFMs. By default one can call all of them without any issues. As typically in customers production systems only few of them are needed so by utilizing UCON one can limit those RFMs which are needed.

What needs to be done in order to deploy the UCON?

- NetWeaver system where UCON will be used must have following system profile parameter UCON/RFC/ACTIVE set to 1.
- Set up and generate communication assembly (CA) in TA UCONPHTL.
- Schedule batch job SAP_UCON_MANAGEMENT to collect RFC statistic recording.

Notice that UCON is only available as of SAP NetWeaver version 7.4.


Further information:

Monday, August 25, 2014

What is SAP_LOCAL_DOWNPORT_ASSISTANT ?

There are many occurrences of term SAP_LOCAL_DOWNPORT_ASSISTANT across a SAP Notes and in ABAP reports delivered by SAP via the SAP Notes. One who is searching for the SAP Notes can observe this term very often. It was also my case.

Usually in the SAP Note there is a ABAP report mentioned in format NOTE_*. Where asterisk is a placeholder for not number (e.g. NOTE_2036310). After ABAP report is implemented there is a following text in its source code (example taken from the Note: 2042755 - Prerequisites: ABAP Dictionary enhancements, messages, and report texts for SAP Note 2036310):


* Generated by SAP_LOCAL_DOWNPORT_ASSISTANT Version 4.53 on 16.07.2014

* The individual coding starts at 'FORM update.' ( line 3.131 )
* Perform global search (menu edit - find) for "-- to get a complete list of changed objects

* Generation done for objects found in one of the following transports:
* BR1K053972


To me this indicates that the SAP_LOCAL_DOWNPORT_ASSISTANT is most likely internal SAP tool to migrate ABAP source code between different versions of NetWeaver ABAP stack.


Feel free to share your experience or observation about the SAP_LOCAL_DOWNPORT_ASSISTANT in the comments of this blog post.

Friday, August 22, 2014

Unlock InfoObjects option in cube maintenance

I was recently changing structure of one info cube in BW system. I had to remove one infoobject and add other one. For no particular reason I didn’t want to use Remodeling functionality to do that. What I did was just I simply put right click on desired IO to be removed and choose Delete option. However nothing happened and my IO stayed in the cube’s structure. I was sure that cube had no data loaded. I also checked aggregates and indexes. None of them existed. I had suspicion that there are still some data left in the cube. But how come as also dimension tables were deleted.

Moreover I observed that some of my IOs in the cube’s dimension are blue ones and on other hand some of them are black. Again blue ones were those I suspected having the data.

After some examination I found out one option. There is a function called Unlock InfoObjects available in TA RSA1 and RSDCUBE. While I went to cube maintenance screen in menu “Extras” there I found this function. 




What actually this function just did? It released those blue IOs in the cube. Seems it did action kind of deletion cube data also from the IOs which had still same data. After using the function it should be possible to add and/or delete IO from the cube’s structure.

To complete this blog post I need to mention that technically function is implemented in class CL_RSD_STRUCT_MAINT and in method SET_GET_IOBJ_LOCD.

Thursday, August 21, 2014

How to reorganize Process Chains log’s table

Questions about fast growing tables in SAP systems are very often asked in SCN forums. Such a tables consumes disk space and even more importantly processing large volumes of data in these tables slows down the system. This also true in area of BW systems. Therefore it is common for SAP Basis guys to do housekeeping on regular basis of these tables. There are SAP Notes available which deals with those tables and advise how to reorganize them. Perfect example of such a Note is 706478 - Preventing Basis tables from increasing considerably. There are many tables discussed in the Note per different areas and also BW areas.

One of them depicts table related to process chains log - RSPCLOGCHAIN.


The table holds logs of Process Chains. In large BW systems running many chains on daily basis table can increase its volume very easily. One of the tables involved in logging of process chains runs is RSPCLOGCHAIN. Regular way of how to get rid of the log of process chains run is to do it from transactions like RSPC or RSPC1. In the log view there is Delete functionality available in the menu:









To you this functionality in automated way an ABAP report RSPC_LOG_DELETE needs to be utilized.  You can set up the job running this report on regular basis for particular chains with selection on logs from date/time or Log ID. I found this report quite useful in BW housekeeping tasks.