Showing posts with label interfaces. Show all posts
Showing posts with label interfaces. Show all posts

Sunday, November 8, 2015

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!

Sunday, October 18, 2015

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

Monday, March 9, 2015

Manipulating line end marker for files in ABAP

None SAP system is standalone and needs to communicate with other systems therefore interfaces are very important ABAP deliverables. One of interface techniques is just transfer of the data via files or sometimes called flat files. While they are transferred sometimes even over different OS; there are requirements for different end line markers.
Here it is very important to have a possibility to influence what will be a end line marker set in particular file. This is possible within ABAP command called OPEN DATASET. Within its addition called WITH XXX LINEFEED this can be achieved. In case the statement for WINDOWS OS it looks like:

OPEN DATASET lv_filename FOR OUTPUT 
IN TEXT MODE 
ENCODING DEFAULT 
WITH WINDOWS LINEFEED.


Possible values of line feed:

XXX
End line marker
Unix
LF
WIN
CRLF
NATIVE
line end marker is interpreted in accordance with the current code page
SMART
line end marker depends on access type (INPUT/OUTPUT/APPENDING/UPDATE)

Monday, September 1, 2014

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.