Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Read table in OO context

Former Member
0 Likes
5,202

Hi Abappers,

I want to use a rad statement in the BADi method but when i write:

READ TABLE ITAB WITH KEY MATNR = P_MATNR.

It gives the following syntax error.

'The variant " WITH KEY k" is no longer supported in the OO context. Use an explicit key specification instead.'

Can u please give me the correct syntax of the read stmt in OO context or some alternative.

Thanks,

Mansi.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,289

in OO context you have to use internal tables with header lines

READ TABLE ITAB <b>INTO WA_ITAB</b> WITH KEY MATNR = P_MATNR.

Hi Abappers,

I want to use a rad statement in the BADi method but when i write:

READ TABLE ITAB WITH KEY MATNR = P_MATNR.

It gives the following syntax error.

'The variant " WITH KEY k" is no longer supported in the OO context. Use an explicit key specification instead.'

Can u please give me the correct syntax of the read stmt in OO context or some alternative.

Thanks,

Mansi.

1 REPLY 1
Read only

Former Member
0 Likes
2,290

in OO context you have to use internal tables with header lines

READ TABLE ITAB <b>INTO WA_ITAB</b> WITH KEY MATNR = P_MATNR.