Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

condition

HI All

I have a variable v1 = 'ztest'

and I have objid field values as 'ztest1', 'ztest2', 'ztest3', 'ztest'

I need to give a select command with a condition as follows

select count ( * ) into cnt from table where objid = v1.

It is giving the count value as 4 . But I want the exact match that is it has to consider only 'ztest' and not 'ztest1','ztest2' etc.

What should I do for this.

Regards

renuka.

Tags:
Former Member replied

Try this way

  concatenate v1 '%' into v1.
  condense v1 no-gaps.
  select count ( * ) into cnt from table where objid like v1.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question