‎2020 Jan 25 2:11 AM
I am trying to directly call the method which has a returning parameter in the select query where condition . but this does't work. Gives an error. However this works for an IF condition.
if zclass->get_attribute( ) = 1. "this works
endif.
select a from ztable into table @data(lt_table)
where
b = zclass->get_attribute( ). "doesn't work
Does anyone have any idea about it? I am trying to avoid having local variables for all the getter methods and then passing them in the select query as there's quite a few of them and these values are required in multiple methods.
Thanks in advance.
‎2020 Jan 25 6:41 AM
kaundinya,
Try the below Code and let us know if it works,
select a from ztable into table @data(lt_table)
where
b = @( zclass->get_attribute( ) ) .
Regards!
‎2020 Jan 25 6:41 AM
kaundinya,
Try the below Code and let us know if it works,
select a from ztable into table @data(lt_table)
where
b = @( zclass->get_attribute( ) ) .
Regards!
‎2020 Jan 26 9:45 AM
This works. Thanks!
Just a little change. The into table @data(lt_table) will come at the end like this.
select a from ztable where
b =@( zclass->get_attribute( ) )
into table @data(lt_table).
‎2020 Jan 26 11:46 AM
For information, the following part of the above code is named a host expression and exists since ABAP 7.50:
@( zclass->get_attribute( ) )
‎2021 Mar 17 8:35 PM
select a from ztable where
b = @( zclass->get_attribute())intotable@data(lt_table).