cancel
Showing results for 
Search instead for 
Did you mean: 

Calling RFC and getting ABAP dump when maximum GUI sessions reached in sap

Former Member
0 Kudos

Hi ,

Please help on this.

Calling a RFC in a standard program and it is causing ABAP dump when maximum sessions reached. If a session is available, occurred no issue. Pleas help me to get solution.

Sample code:
CALL FUNCTION 'Z_SALES_ORDER_CHANGE' STARTING NEW TASK 'TSK1' DESTINATION 'NONE' PERFORMING return_info ON END OF TASK

EXPORTING

i_vbeln = lwa_vbap2-vbeln

TABLES

it_sales_order = lit_sales_tmp .

IF sy-subrc = 0.

WAIT UNTIL functioncall ='X'.

IMPORT lit_return2[] FROM MEMORY ID 'ABC'.

functioncall = space.

ENDIF.

FORM RETURN_INFO using tsk1 TYPE any.

RECEIVE RESULTS FROM FUNCTION 'Z_SALES_ORDER_CHANGE'
TABLES
IT_SALES_ORDER = lit_sales_tmp
functioncall = 'X'.

ENDFORM. " RETURN_INFO

Accepted Solutions (0)

Answers (3)

Answers (3)

horst_keller
Product and Topic Expert
Product and Topic Expert

You have to check yourself if free sessions are available before calling the asynchronous RFC in order to avoid the dump.

call function 'TH_USER_INFO'
  importing
  act_sessions = act_sessions
  max_sessions = max_sessions.
kiran_k8
Active Contributor
0 Kudos

Horst,

In this scenario,can we call the FM in background task so that dependency on active session can be avoided ?

K.Kiran.

Former Member
0 Kudos

Thanks Guys for your reply.
@Keller,
From the point which you have provided, we can avoid the issue but trying to find a solution for that.We can do as you said but this RFC is getting called when sales order is changed and saved. If we show error when max sessions reached I think user may not agree.

pokrakam
Active Contributor
0 Kudos

Maybe rethink design, why are you using RFC for this?

Sandra_Rossi
Active Contributor
0 Kudos

Horst told you to test the number of sessions to avoid the popup.

But in your case, you have chosen the wrong type of RFC. I agree with Kiran and Mohammad, do CALL FUNCTION ... IN BACKGROUND TASK (tRFC). You won't get the popup. If any error happens, you will have to analyze the issue and possibly restart the task via transaction SM58.

And Mike may be right too, depending on what you exactly want to achieve, and on the exact context, you may have to rethink the solution.

Former Member
0 Kudos

why I have used RFC is , for example when we change and save a sales order B, before saving B based on some conditions need to update few item details in sales order A(which is preceding order to B).

pokrakam
Active Contributor
0 Kudos

Either you need it synchronously so you might as well execute it in a BADI, or you don't in which case you can dispatch it into background (via output, events/workflow, asynch RFC, whatever). I just don't see the point in RFC if you need to wait for the results.

Former Member
0 Kudos

yes results not required as of now.

Former Member
0 Kudos

You still think updating of sales order A will take lot of time so you are updating in new task rather than updating in the same session of sales order B?

Sandra_Rossi
Active Contributor

Really a short dump? Or is it a popup "maximum number of sessions". To know if there is an issue while calling a function module via RFC, you must handle these special RFC exceptions:

  • COMMUNICATION_FAILURE (connection broken...)
  • SYSTEM_FAILURE (short dump happening in the called function module, maximum of sessions...)

And, as it's (asynchronous RFC with) wait for answer, those exceptions must be handled in the RECEIVE RESULTS FROM FUNCTION, not in the CALL FUNCTION !

For more information, refer to the ABAP documentation.

Former Member
0 Kudos

Yes I have used RECEIVE RESULTS FROM.

Former Member
0 Kudos

If possible better call the RFC in the background task.

horst_keller
Product and Topic Expert
Product and Topic Expert