Skip to Content
0

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

Nov 16, 2017 at 10:45 AM

116

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Horst Keller
Nov 16, 2017 at 10:59 AM
2

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.
Show 8 Share
10 |10000 characters needed characters left characters exceeded

Horst,

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

K.Kiran.

0
Former Member

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.

0

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

0

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.

0
Former Member

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).

0

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.

0
Former Member

yes results not required as of now.

0
Former Member

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?

0
Sandra Rossi Nov 16, 2017 at 12:59 PM
1

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.

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Yes I have used RECEIVE RESULTS FROM.

0
avatar image
Former Member Nov 16, 2017 at 11:31 AM
-1

If possible better call the RFC in the background task.

Show 1 Share
10 |10000 characters needed characters left characters exceeded
0