cancel
Showing results for 
Search instead for 
Did you mean: 

Reset or Clear SAP user context by external RFC caller program

Former Member
0 Kudos

Hello,

I have a SAP system with performance problems due to a SAP user context starts using a lot of memory.

This user context comes from an External RFC caller program written in Delphi and which uses the SAP RFC SDK provided by SAPGUI 6.40: SAP Automation library, SAPFuntionsOCX, I mean, using methods in the object "SAPFunctions" in SAPFunctionsOCX in file "wdtfuncU.ocx", in SAPGUI directory.

Everytime we have performance problems, this RFC SAP user context is using near 1400 Mb of extended memory, although there is a lot of free physical RAM memory available, there are free dialog processes and CPU load is low (no more than 30%).

This performance problem is solved by closing the external program (written in Delphi) which connects to SAP via RFC.

This external program works for the warehouse management and connects to SAP several times per minute. Due to connection performance and the high frequency with which this external program must connect to SAP, the connection to SAP is not closed after each call to RFC SAP function modules.

The extended memory used by this SAP RFC user is growing along time. I detected, using ST03 transaction, that these user sessions have always the same transaction code hash, I mean, although the external programs call the same SAP RFC funcion modules several times (¡¡¡ always clearing the variables at the beginning and at the end of de ABAP code, with ABAP commands like REFRESH and FREE ¡¡¡¡) the technical transaction code is the same and I suppose the user context (in extended memory) is not deleted.

I think it is better than the external program close the context memory (similar to "/n" okcode in SAPGUI).

But we don't want to close the connection, because the external program connects to SAP with a high frequency, and the logon process is expensive.

Is there any way to send something similar to "/n" (end of transaction) from the external program? Is there any command in the SAP RFC SDK library (SAPFuntionsOCX or something similar?

I cannot find any method to do that in the object "SAPFunctions" in SAPFunctionsOCX in file "wdtfuncU.ocx", in SAPGUI directory.

Old information for Object Classes "SAPFunctions" in SAPFunctionsOCX in file "wdtfuncU.ocx", in SAPGUI directory, is described in the following URL:

http://help.sap.com/saphelp_45b/helpdata/en/39/7e00d1ac6011d189c60000e829fbbd/frameset.htm

But I cannot find anything related to something similar to a "/n" in SAPGUI.

As I have the SAPGUI installed on my desktop, I can see all SAP RFC classes and methods from Excel, by opening the Visual Basic editor.

I am only asking a way to send to SAP a command to free the user context used for an open RFC session in order to avoid the memory used to be continuously growing, without having to close the RFC session.

The external program only calls a certain SAP function module periodically and we want to free the user context between calls without logging off. This is the same, very similar, as if we called that function from SAPGUI and we used "/n" in SAPGUI between calls.

Anyone can help me?

Thanks and best regards.

Accepted Solutions (0)

Answers (1)

Answers (1)

brice_lagaly
Participant
0 Kudos

Hello,

I don't know if this will solve your problem, but you may be using MF 'RFC_CONNECTION_CLOSE' between each call of you RFC function.

Regards

Brice

Edited by: blsapsdn on Apr 15, 2011 5:27 PM