cancel
Showing results for 
Search instead for 
Did you mean: 

Extended Check

Former Member
0 Kudos

Hi ,

I have written a statement READ TABLE outtab WITH KEY 'LV_CUST_ACCNO'.

when i done Extended Programming Check it is showing following error

The current ABAP command is obsolete

The variant " WITH KEY k" is no longer supported in the OO context. Use an

explicit key specification instead . . . .

Can anyone help me to write READ TABLE statement without using KEY .

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Solved

h_senden2
Active Contributor
0 Kudos

The correct statement is :

READ TABLE itab WITH TABLE KEY k1 = v1 ...kn = vn [additions].

READ TABLE itab WITH KEY k1 = v1 ...kn = vn [BINARY SEARCH]

In OO context (so within classes) the rules are more strict than in normal Abap.

regards,

Hans

Please reward all helpful answers !!!!!

Former Member
0 Kudos

hi Hans ,

I have done accordingly but now it is giving error as follows

In the OO context either an INTO or an ASSIGNING specification or the addition

"TRANSPORTING NO FIELDS" must be used . be used. be used. be used. be used. be

used.

Former Member
0 Kudos

Hi Pavan,

You ITAB looks to have a header line

In OO context itabs with header lines are not allowed

You have to use a workarea instead

 READ TABLE ITAB INTO WA_ITAB WITH KEY FIELD1 EQ V_FIELD.

h_senden2
Active Contributor
0 Kudos

Hi,

actually in OO also no internal tables with header lines are permitted. So you have to use a workarea (INTO WA) or field-symbol (ASSIGNING <fs>).

regards,

Hans

Please reward all helpful answers !!!!!