Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
Showing results for 
Search instead for 
Did you mean: 

Line_exists - odd compiler error

Former Member

I was trying to use line_exists today and ran into an unexpected issue you can see below. When I use line_exists for an if statement expression, it handles the usage correctly. If I try to save the value directly to a boolean variable however, it will fail with the odd "line_exists( expected, not line_exists(" error. Just curious if anybody knew if there was a note out there to address this problem or if this is not allowed usage for line_exists.


0 Kudos


According to SAP Help, the table expression line_exists is only used to check the existence of the specified row. No temporary result is created.

I think you can't assign the result to a variable, the result doesn't exist.



0 Kudos

I saw the same thing, but I thought it was in reference to the actual table read statement in terms of not storing a reference to the found line, not the result of the check. My assumption is that the result of the check is reported somewhere in order for the IF statement to be able to access it. I might be reading it wrong though!

just in case, you should use rv_is_dc = boolc( line_exists( ... ) ).

0 Kudos

Hi sandra.rossi

Your syntax is fine and it should be accepted as best answer. I don't know if moderators can do that. Moderators! Do it if you can. 🙂

0 Kudos

nemanja.simovic.avnet I guess they won't do it, it's up to the OP to select the best answer. You can post an answer so that people can find yours and possible comment. Thanks. PS: no need to mention my name.