cancel
Showing results for 
Search instead for 
Did you mean: 

SYSTEM_DATA_ALREADY_FREE + FREED STACK

Former Member

Hi guys,

I am developing a gateway method to call a RFC on the backend. When I execute the service on Gateway Client, it calls the methods below at this order:

Class:

/ITSTGW/CL_ST10_ORDER_DPC_EXT

Methods:

1 - /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CHANGESET_BEGIN         (cv_defer_mode = abap_true) - to inform the framework that it can process all changeset operations at once

2 - /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CHANGESET_PROCESS   (check the type of the changeset to call the method below)

3 - HANDLE_CHANGESET_CREATES                                                          (find the RFC destination and call the RFC on the backend)

4 - /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CHANGESET_END              (ends the execution and return to the client)

In the third method when I try to find the RFC destination name, a dump is thrown.

Code:

     DATA lo_dp_facade TYPE REF TO /iwbep/if_mgw_dp_facade.

     DATA LV_DESTINATION type RFCDEST.

*   Get RFC destination

     lo_dp_facade = /iwbep/if_mgw_conv_srv_runtime~get_dp_facade( ).

     lv_destination = /iwbep/cl_sb_gen_dpc_rt_util=>get_rfc_destination( io_dp_facade = lo_dp_facade ).


When it executes the first line, it obtains: 'FREED STACK'. That is the problem.

When I put the same code in another method of the same class, it works fine.

Dump:

SYSTEM_DATA_ALREADY_FREE

/IWBEP/CL_MGW_DP_FACADE=======CP

Call of service/sap/opu/odata/NAMESPACE/PM_ORDER_SRV/$batchterminated because of an error. The following error text was processed in system :Accessing data that has already been released is not permitted.

Any thoughts guys?

Thank you very much,

Danilo

Accepted Solutions (1)

Accepted Solutions (1)

AshwinDutt
Active Contributor
0 Kudos

Hello Danilo,

Check using the below code.

DATA: ls_changeset_request  TYPE /iwbep/if_mgw_appl_types=>ty_s_changeset_request.

   data:

   lo_req_obj   TYPE REF TO /IWBEP/CL_MGW_REQUEST,

   ls_req_data TYPE/IWBEP/IF_MGW_CORE_SRV_RUNTIME=>TY_S_MGW_REQUEST_CONTEXT,

   ls_system_alias_info     TYPE /iwbep/s_defi_alias_info.

   LOOP AT it_changeset_request INTO ls_changeset_request.

       lo_req_obj ?= ls_changeset_request-request_context.

       CALL METHOD lo_req_obj->GET_REQUEST_DETAILS( RECEIVING RS_REQUEST =ls_req_data ).

       ls_system_alias_info = ls_req_data-SYSTEM_ALIAS_INFO.

   ENDLOOP.


Where ls_system_alias_info will have the RFC Destination.


Regards,

Ashwin

Former Member
0 Kudos

Hello Ashwin,

Perfect, at this mode it worked very smoothly!

Thank you very much!

Regards,

Danilo

shilpa_manthan
Explorer
0 Kudos

Where shall I call this code ? In changeset_process I cant pass reference for facade class.

Dump is occurring in Update entity mapping .

Answers (1)

Answers (1)

kammaje_cis
Active Contributor
0 Kudos

Danilo,

HANDLE_CHANGESET_CREATES seems to be your custom method. Is it?

The basic fact is that when the control comes to this method, it no longer has the reference to dp_facade.


So your option is to do the above call in changeset_process, and pass on the lo_dp_facade to HANDLE_CHANGESET_CREATES.


Regards

Krishna

Former Member
0 Kudos

Hello Krishna,

Yes, I created this method. What you mentioned is exactly what is happening, losing the reference.

I had already tried to do the call in both changeset_begin and changeset_process, but for some reason the same occurs.

I could solve changing the way of calling, as Ashwin mentioned above.

Thank you very much for your help, really appreciate!

Regards,

Danilo