cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in ABAP Language

06-23-2026 11:32 AM
1534 views 4 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

I just discovered my first bug in the ABAP Programming language introduced with SAP NetWeaver 7.4.

Some of our customers are still on very old releases and the bug just came up when they upgraded their system.

Prior to SAP NetWeaver 7.4, you were able to do the following:

FIELD-SYMBOLS: <result> type USR02.
DATA: results type table of USR02.

append initial line to results assigning <result>.

select * from usr02 into corresponding fields of <result>.
  append initial line to results assigning <result>.
endselect.

This code does exactly what you would expect it to do on a release lower than NW 7.4 - It appends all entries of USR02 to the table RESULTS.

However, starting with NW 7.4 the following happens:

  1. An initial line is appended to RESULTS and <RESULT> is assigned. <RESULT> now points to the first row of RESULTS.
  2. <RESULT> is populated with the first row of USR02, therefore the first row of RESULTS now also contains the data of USR02.
  3. A new initial line is appended to RESULTS and <RESULT> is assigned. <RESULT> now points to the second row of RESULTS.
  4. A new row of USR02 is selected. <RESULT> does not get populated, however the first row of RESULTS gets changed. The second row of RESULTS remains empty.

...

This is clearly a bug.

My guess:

Prior to NW 7.4, a pointer was passed to the select, now, the field symbol is no longer handled as a pointer within the select, instead the address of the work area is passed to the select.

This is confusing behaviour, as the same field symbols used in INTO CORRESPONDING FIELDS OF and between SELECT and ENDSELECT now point to different addresses. This should not happen.

I suggest, that either the compiler will error when having to compile this, or that the previous, correct behaviour is restored.

 

 

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

holm
Participant
0 Likes
"It's not a bug, it's a feature" 😄 Thank you for finding this!

Answers (1)

Answers (1)

patrick_winkler
Product and Topic Expert
Product and Topic Expert

 

Even in higher releases the behavior is as you describe. You should open an incident for component BC-ABA-LA.