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 with two keys

Former Member
0 Likes
488

Hi all

My requirement is i have to read a internal table with two keys which is x ne 're' and y is not initial i have writen like this but its not working

READ TABLE INT_RBKP INTO WA_RBKP WITH KEY WA_RBKP IS NOT 'RE' WA_RBKP IS NOT INITAIL .

can any one suggest me soem better ways to do this??

Thanks and Regards

Arun Joseph

4 REPLIES 4
Read only

Former Member
0 Likes
459

Hi Arun,

You can not use NE with READ.

For that you may require to use LOOP AT..WHERE.

Regards,

Atish

Read only

Former Member
0 Likes
459

Hi Arun,

U can do this way

READ TABLE INT_RBKP INTO WA_RBKP WITH KEY <field_name> NE 'RE'.
IF NOT  WA_RBKP-<field_name> IS INITAIL .
<code>.......
.................
ENDIF.

Best regards,

raam

Read only

Former Member
0 Likes
459

Hi Arun,

The Operator 'NE' 'GE' etc... you cann't use in the READ statement only you have to use 'EQ'.

For your requirement,

1. Read the data from the internal table.

2. validate the data using IF statement.

READ TABLE INT_RBKP INTO WA_RBKP.

IF WA_RBKP IS NOT 'RE' and WA_RBKP IS NOT INITAIL .

  • True

ELSE.

*False.

Endif.

Reward if it is useful.

Regards,

Boobalan S.

Read only

Former Member
0 Likes
459

Thanks