You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No Corresponding FORM - If "SELECT UP TO 1 ROWS" is inside the FORM #159
Hello,
I don't know if this is a issue, but I have an old report in which a SELECT is executed with the addition "UP TO 1 ROWS". This happens inside a FORM. When I want to run the ABAP CLeaner, I get the following error message:
If I comment out the addition "UP TO 1 ROWS", it works again.
this sound a bit like ABAP cleaner (wrongly) expects an ENDSELECT and therefore doesn't expect the FORM block to be closed yet when the ENDFORM is parsed. Unfortunately, it is not trivial to determine whether or not ENDSELECT is required – could you post the SELECT statement used here? (Exact table and field names don't matter, but the structure of the SELECT).
SELECT MAX( col ) UP TO 1 ROWS
FROM table
INTO variable
WHERE something EQ else
AND something1 EQ else1 .
I have not been an ABAP developer for very long. I would have said that only one value comes back with the SELECT, so I could leave out the addition, but I have read that it can apparently also be that several values come back. The report is already old and I don't want to change the logic.
ah, very good, now I could reproduce the issue. What confuses ABAP cleaner here is that "UP TO 1 ROWS" is in an unusual position – you'd usually have it after the "INTO" clause (see ABAP documentation for SELECT):
But nevertheless, since the ABAP compiler accepts the syntax from your example, ABAP cleaner should cope with it, too, so I shall try to fix this! In the meantime, if you move "UP TO 1 ROWS" below "INTO variable", ABAP cleaner should be fine with it, too.
Activity
jmgrassau commentedon Oct 20, 2023
Hi JoachimEck,
this sound a bit like ABAP cleaner (wrongly) expects an ENDSELECT and therefore doesn't expect the FORM block to be closed yet when the ENDFORM is parsed. Unfortunately, it is not trivial to determine whether or not ENDSELECT is required – could you post the SELECT statement used here? (Exact table and field names don't matter, but the structure of the SELECT).
Kind regards,
Jörg-Michael
JoachimEck commentedon Oct 20, 2023
Hi Jörg-Michael,
here's the SELECT-Statement:
I have not been an ABAP developer for very long. I would have said that only one value comes back with the SELECT, so I could leave out the addition, but I have read that it can apparently also be that several values come back. The report is already old and I don't want to change the logic.
Kind regards,
Joachim
jmgrassau commentedon Oct 20, 2023
Hi Joachim,
ah, very good, now I could reproduce the issue. What confuses ABAP cleaner here is that "UP TO 1 ROWS" is in an unusual position – you'd usually have it after the "INTO" clause (see ABAP documentation for SELECT):
But nevertheless, since the ABAP compiler accepts the syntax from your example, ABAP cleaner should cope with it, too, so I shall try to fix this! In the meantime, if you move "UP TO 1 ROWS" below "INTO variable", ABAP cleaner should be fine with it, too.
Kind regards,
Jörg-Michael
JoachimEck commentedon Oct 20, 2023
Thanks a lot :)
Kind regards,
Joachim
jmgrassau commentedon Oct 21, 2023
Hi Joachim,
this issue will be fixed in the next release!
Kind regards,
Jörg-Michael
fix Parser for UP TO ... ROWS in unusual position (SAP#159)
fix Parser for UP TO ... ROWS in unusual position (#159)
jmgrassau commentedon Oct 23, 2023
Hi Joachim,
thanks again for this finding – this should now be fixed in version 1.8.0, which was just released!
Kind regards,
Jörg-Michael