‎2019 May 07 3:45 PM
Maybe another ABAP kernel bug, not corrected yet?
With the code below, the DATA(name) = ... does a SHORT DUMP with GETWA_NOT_ASSIGNED. In some other situations, it may not fail but return a value which is at a different offset an with a different length !!
DATA(text) = 'hello'.
FIND ALL OCCURRENCES OF 'l' IN text RESULTS DATA(matches).
LOOP AT matches ASSIGNING FIELD-SYMBOL(<match>).
DATA(name) = to_upper( CONV string( text+<match>-offset(<match>-length) ) ). " short dump
ENDLOOP.
It's due to the constructor expression combined with the subfield access. If I remove one of them, then it's okay.
It seems that subfield access/constructor expression is really a problem, because I also had another issue with COND (not CONV) inside a table comprehension. Moving it to a LET aux = str+off(len) had solved the issue, but I didn't see a note about that topic (only 1972833 was close but was for an old kernel 741).
Do you have the same issue, what is your ABAP version/kernel, do you know what SAP note/kernel solves?
My ABAP versions:
Thank you very much.
Sandra
‎2019 May 08 10:47 AM
For the record, I have posted an incident at SAP support. I will keep you informed.
(link for my own use: 258494 / 2019 constructor + subfield access -> short dump GETWA_NOT_ASSIGNED)
UPDATE 20190603: it's corrected by the SAP note 2791097 - ABAP Expressions with Offset/Length Access Yield Wrong Result
‎2019 May 07 4:39 PM
Hello Sandra, hope you're well
The error happened because the interpretor cannot convert a static char into string (as you have done before). The field-symbol statement has the capablity to change a variable content dinamically (without using MODIFY statement, or any other...), so it's not possible to convert a char(5) to string(255) because a string value is to long for the table content.
I did a few changea on your code. Please test it again
DATA(text) = CONV string( 'hello' ).
FIND ALL OCCURRENCES OF 'l' IN text RESULTS DATA(matches) .
LOOP AT matches ASSIGNING FIELD-SYMBOL(<match>) .
* DATA(name) = to_upper( CONV string( text+<match>-offset(<match>-length) ) ) . " short dump
DATA(name) = to_upper( text+<match>-offset(<match>-length) ) . " no dump :)
ENDLOOP .KR,
Arthur Silva
‎2019 May 07 4:57 PM
The ABAP runtime can "convert char into string". String is not 255 characters.
You may check this code, it works well:
data(v1) = 'Hello'.
data(v2) = to_upper( conv string( v1+2(1) ) ).I expect more an answer about a patch for correcting the bug.
(or maybe I should contact the SAP support)
‎2019 May 07 4:52 PM
NOTE: the question is not about how to make the assignment work, the question is about what SAP note/kernel solves. And eventually could you run the code, say if it works and what is your ABAP version.
‎2019 May 07 5:16 PM
Sandra,
Did you try the code that I've sent ?
No field sympol, no error:
data(v1) = 'Hello'.
data(v2) = to_upper( conv string( v1+2(1) ) ).With field-symbol: error:
DATA(name) = to_upper( CONV string( text+<match>-offset(<match>-length) ) ) .Don't confuse the use of field-symbol with inline-declaration.
‎2019 May 07 6:04 PM
‎2019 May 07 7:26 PM
Matthew Billingham I can't test now, but probably that would work. But that's not my question 😉
‎2019 May 08 7:33 AM
For what it is worth, it dumps here on SAP_ABA 750 SP9 as well.
‎2019 May 08 7:46 AM
its ok if i do like this:
DATA(text) = 'hello'.
DATA part.
FIND ALL OCCURRENCES OF 'l' IN text RESULTS DATA(matches).
LOOP AT matches ASSIGNING FIELD-SYMBOL(<match>).
part = text+<match>-offset(<match>-length).
ENDLOOP.
but its syntax error if i do like this:
DATA(text) = 'hello'.
FIND ALL OCCURRENCES OF 'l' IN text RESULTS DATA(matches).
LOOP AT matches ASSIGNING FIELD-SYMBOL(<match>).
DATA(part) = text+<match>-offset(<match>-length).
ENDLOOP.if i separate the inline like this, there is no dump:
FIND ALL OCCURRENCES OF 'l' IN text RESULTS DATA(matches).
LOOP AT matches ASSIGNING FIELD-SYMBOL(<match>).
DATA(conv) = CONV string( text+<match>-offset(<match>-length) ).
DATA(name) = to_upper( conv ).
ENDLOOP.mightbe its about generic type in inline declaration...
‎2019 May 08 10:04 AM
sandra.rossi Oh yes, I know. But if you're going to use old-fashioned constructs... 😉
‎2019 May 08 10:44 AM
matthew.billingham let's discuss about substring/text+off(len) in this new question
‎2019 May 08 10:47 AM
For the record, I have posted an incident at SAP support. I will keep you informed.
(link for my own use: 258494 / 2019 constructor + subfield access -> short dump GETWA_NOT_ASSIGNED)
UPDATE 20190603: it's corrected by the SAP note 2791097 - ABAP Expressions with Offset/Length Access Yield Wrong Result
‎2019 May 14 8:50 AM
SAP answered they are about to correct the bug, and they'll issue a new SAP note... to be continued...