Skip to Content
Jan 26, 2009 at 02:35 PM

Relational operators, help needed


Hi all,

I've got a simple task to ask for... I have to search in an itab for a particular (unique) work area that I can identify comparing some fields to my wanted values.

There's just one check I'm not able to code down, here it is:

the table has a field called EXT_DEM_POSID and I have a workarea in which this field has value '00020000000010'.

I need to find in my itab the entry that has the EXT_DEM_POSID field value equal to the first 5 digits of my workarea (in this case, '00020'). How can I simply formulate such a check in a WHERE statement?

Something like

LOOP AT itab INTO wa_wanted

WHERE .... AND EXT_DEM_POSID EQ first 5 digits of wa_item.

Another question: is there a way I can use directly a READ TABLE statement to do such a thing? Or must I loop the entire table since the condition is not just an equality one?

Thanks in advance