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

Obsolete READ VARIANT

Former Member
0 Likes
951

Hi ALL

When i do an EPC im getting a syntax check warning saying:

<b>Read Variant is Obsolete.You should specify the key in the form k1=v1.....kn=vn.</b>

The code is as follows:

read table i_tcurx with key v_t001-waers

binary search.

<i>V_t001 is defined like:

data: begin of it_t001 occurs 0,

bukrs like t001-bukrs, " Company Code

waers like t001-waers, " Currency Code

end of it_t001.

data : v_t001 like it_t001 occurs 0 with header line.</i>

How do i rectify this???

<b>Note: I need to take care of this warning</b>

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
794

read table i_tcurx with key <b>v_t001-waers</b>---->wrong

binary search.

key is for comparing.u rite only one field of table

rite like.

read table i_tcurx with key <b>waers = v_t001-waers</b> binary search.

Hi ALL

When i do an EPC im getting a syntax check warning saying:

<b>Read Variant is Obsolete.You should specify the key in the form k1=v1.....kn=vn.</b>

The code is as follows:

read table i_tcurx with key v_t001-waers

binary search.

<i>V_t001 is defined like:

data: begin of it_t001 occurs 0,

bukrs like t001-bukrs, " Company Code

waers like t001-waers, " Currency Code

end of it_t001.

data : v_t001 like it_t001 occurs 0 with header line.</i>

How do i rectify this???

<b>Note: I need to take care of this warning</b>

4 REPLIES 4
Read only

Former Member
0 Likes
794

You need to specify the value for v_t001-waers . The syntax would be

read table i_tcurx with key waers = value

binary search.

Read only

Former Member
0 Likes
795

read table i_tcurx with key <b>v_t001-waers</b>---->wrong

binary search.

key is for comparing.u rite only one field of table

rite like.

read table i_tcurx with key <b>waers = v_t001-waers</b> binary search.

Read only

dani_mn
Active Contributor
0 Likes
794

you have not mention the value for which the read statement to compare.

Use this

Read table i_tcurx with key v_t001-waers = 'search_text'

binary search.

Read only

Former Member
0 Likes
794

Navaneeth Murali,

You may need to mention

read table i_tcurx with key v_t001-waers = g_waers
binary search.

where g_waers is the currency you need to find.

This is needed because your program is unicode enabled.(Check Program attributes).

Cheers,

Thomas.

Please mark points if you got solution.