Skip to Content
0
Former Member
Sep 11, 2007 at 08:29 AM

Read table statement with dynamic key

1204 Views

Hi All,

I want to read a table for which a key is defined in another z table. So basically I want to achieve the following :-

Ideally we write a read statement like this :-

READ TABLE ITAB WITH KEY MATNR = '2021'.

But I want to read in the following way :-

data : var1 type string.

var1 = 'MATNR = ''2021'''.

READ TABLE ITAB WITH KEY VAR1.

The fields and conditions for the key are defined in a z table so I have to pass them dynamically to the read statement.

Please suggest how I can achieve this.

Thanks in advance,

Archana.