Application Development 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 at range

Former Member
0 Kudos
107

Hello Experts,

r_nsize

is a range and I want to check whether a word is existing or not ?

READ TABLE r_nsize with key r_nsize -low = specialword is not possible.

How can I operate in this case

Regards

sas

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos
76

> READ TABLE r_nsize with key r_nsize -low = specialword

Change the code like below..

READ TABLE r_nsize with keylow = specialword

5 REPLIES 5

Former Member
0 Kudos
76

Hi,

instead of read statement use loop at..

loop at r_nsize.
  if r_nsize-low = 'specialword'.
"processing logic
endif.
endloop.

Regards,

Siddarth

Former Member
0 Kudos
76

no I need way on how to find out if the specialword is existing or not.

Because I want to output a message if the word is NOT existing

former_member188685
Active Contributor
0 Kudos
77

> READ TABLE r_nsize with key r_nsize -low = specialword

Change the code like below..

READ TABLE r_nsize with keylow = specialword

Former Member
0 Kudos
76

Try this.

TABLES : scustom.

RANGES : r_nsize FOR scustom-name.

r_nsize-low = 'AAAA'.

APPEND r_nsize.

r_nsize-low = 'BBBB'.

APPEND r_nsize.

READ TABLE r_nsize WITH KEY low = 'BBBB'.

IF sy-subrc EQ 0.

WRITE : r_nsize-low.

ENDIF.

Regards,

Roopa

Former Member
0 Kudos
76

Hi,

Try

READ TABLE r_nsize with key low = specialword

You can not use <tablename>-<fieldname> in the key parameter when reading a table. So replace r_nsize-low by low.

Check the value of sy-subrc if check if record with specialword exists.

Hope this helps.

Regards,

Sachin