Skip to Content
0
May 07, 2012 at 09:45 AM

Single quote for where clause

493 Views

Hi ABAPers,

I am building a where clause t_where for selection to table:

CONCATENATE 'FIELD_A LIKE ''' '%' z_a '%'''
INTO z_where-text.

APPEND z_where TO t_where.

SELECT * INTO it_table
FROM z_table
WHERE (t_where).

The issue occurs when z_a contain single quote character '. For example z_a = "Test's data"

The where clause is FIELD_A LIKE '%Test's data%'

It will close the statement in '%Test' and will not recognize s data%'.

It cause run time error.

Any idea how to fix this?

Thanks

Regards

Hadi