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

Former Member
0 Likes
682

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
Read only

Former Member
0 Likes
651

> 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
Read only

Former Member
0 Likes
651

Hi,

instead of read statement use loop at..

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

Regards,

Siddarth

Read only

Former Member
0 Likes
651

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

Read only

Former Member
0 Likes
652

> READ TABLE r_nsize with key r_nsize -low = specialword

Change the code like below..

READ TABLE r_nsize with keylow = specialword

Read only

Former Member
0 Likes
651

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

Read only

Former Member
0 Likes
651

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