This website has been archived, it is working in read-only mode.

This website has been archived, it is working in read-only mode.

The following program results in a short dump, for now I've chalked it up to a bug with the ABAP compiler/run-time. Various other permutation upon the same theme runs fine... just this particular combination of dynamic class and returning a char1 to an exporting any seems to crash. (a char2 works fine, leading me to suspect UTF-16 handing bugs too)

The resulting short dump message: Access to string reference with destroyed content (it occurs on the final WRITE statement.)

To be clear I understand the error message, I just don't see how it is happening that my reference can possibly be pointing to destroyed content.

Also we have a up-to-date development system with all relevant SAPNOTES applied.

REPORT  z_error_test.
*----------------------------------------------------------------------*
CLASS cl_test DEFINITION.
  PUBLIC SECTION.
    METHODS method_true RETURNING value(r_val) TYPE char1.
    METHODS execute EXPORTING e_result TYPE any.
ENDCLASS.
*
CLASS cl_test IMPLEMENTATION.
  METHOD method_true.
    r_val = 'X'.
  ENDMETHOD.
  METHOD execute.
    e_result = method_true( ).
  ENDMETHOD.
ENDCLASS.

START-OF-SELECTION.
  DATA: lcl_test  TYPE REF TO cl_test,
        l_result  TYPE string.

  CREATE OBJECT lcl_test.
  lcl_test->execute( IMPORTING e_result = l_result ).
  WRITE :/ l_result.

asked 31 May '13, 09:11

Marius%20Piedallu%20van%20Wyk's gravatar image

Marius Pieda...
1612411
accept rate: 33%

It also happens in my test system. I agree, this looks wrong. It will be interesting to test with 7.4 when such trial becomes available.

(02 Jun '13, 17:31) pedrolima ♦♦

Not working on 7.4 either. Te problem is already in e_result = method_true( ) method doesn't return anything called that way. It works this way:

METHODS execute RETURNING value(e_result) TYPE char1.
 l_result = lcl_test->execute( ) .

And more important like this:

METHODS execute EXPORTING e_result TYPE string.
permanent link

answered 23 Aug '13, 03:36

Pawel%20Hixohe%20Grze%C5%9Bkowiak's gravatar image

Pawel Hixohe...
2112511
accept rate: 16%

'Veronica Mars' Begins Filming: See Set Photos Here! Fans didn't just ask for a "Veronica Mars" movie, they actively supported one, contributing more than $5 million to its budget via Kickstarter. Related Article: http://www.tauramall.com/Toddler-Boy-Summer-Outdoor-Casual-Short-Pants-p1995.html

permanent link

answered 18 Jun '13, 23:40

iuyuyuy's gravatar image

iuyuyuy
(suspended)
accept rate: 0%

Afghan attack kills US soldiers hours after news of talks Four US soldiers have been killed in Afghanistan, hours after the US announced direct talks with the Taliban. The soldiers were killed by "indirect fire" from insurgents at Bagram air base, US officials said. Read and more: http://www.tauramall.com/Toddler-Girl-Winter-Double-Faces-Coral-Fleece-Dresses-p1956.html

permanent link

answered 23 Jun '13, 06:58

fwfwfw's gravatar image

fwfwfw
(suspended)
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×28
×2
×1
×1

question asked: 31 May '13, 09:11

question was seen: 10,825 times

last updated: 23 Aug '13, 03:36