04-10-2006 11:31 AM
Hello,
i have written a abap code statement which dynamically generates a transient abap program!
This dynamic generated program has a return structure, which will be filled inside the dynamic program.
After calling the program from a normal abap program, the return structure has the status "freed stack".
The reason is clear: the resources of the program are "freed" after completion of the program.
What can I do to avoid this process and use the data received from the dynamic generated program?
Thanx in advance...
Florian
10-30-2013 11:13 PM
Hi Florian,
I solved the Problem by copying the old reference variable in a global new referrence variable:
data: lo_data_ref TYPE REF TO CL_ABAP_DATADESCR.
lo_data_ref ?= CL_ABAP_DATADESCR=>describe_by_data_ref(
p_data_ref = ADD_EVENT_DATA ).
CREATE DATA wd_this->mr_bo_data type HANDLE lo_data_ref.
assign wd_this->mr_bo_data->* to <ls_add_event_data>.
assign ADD_EVENT_DATA->* to <ls_add_event_data_copy>.
<ls_add_event_data> = <ls_add_event_data_copy>.
ADD_EVENT_DATA is the local old refernce variable which was ´freed.
BR, Edgar
04-10-2006 12:03 PM
Hello,
In your dynamic generated program, you can use EXPORT itab = itab TO MEMORY. and in you main program you can receive that data by IMPORT from memory.
Hope this will slove your problem.
Regards,
Naimesh.
Reward points, if it is useful..!
04-10-2006 12:35 PM
Hi Naimesh,
thanks for your reply and your suggestion.
Unfortunately i have a reference in this structure and i cannot use "export" and/or "import" statements.
(I get an error: "Cannot export references")
Florian
01-21-2008 2:25 AM
Hello Florian,
Have you been able to solve your problem?
I have a similar problem, loosing a reference
to a class. Would be interested how you
solved this problem.
Thanks,
Rolf
10-30-2013 11:13 PM
Hi Florian,
I solved the Problem by copying the old reference variable in a global new referrence variable:
data: lo_data_ref TYPE REF TO CL_ABAP_DATADESCR.
lo_data_ref ?= CL_ABAP_DATADESCR=>describe_by_data_ref(
p_data_ref = ADD_EVENT_DATA ).
CREATE DATA wd_this->mr_bo_data type HANDLE lo_data_ref.
assign wd_this->mr_bo_data->* to <ls_add_event_data>.
assign ADD_EVENT_DATA->* to <ls_add_event_data_copy>.
<ls_add_event_data> = <ls_add_event_data_copy>.
ADD_EVENT_DATA is the local old refernce variable which was ´freed.
BR, Edgar
10-31-2013 11:00 AM
Hi Edgar,
This sounds correct but I have not tested it.... 7 years is a long time and I can't remember the project
Thanks for sharing this.