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 stmt

Former Member
0 Likes
547

In READ TABLE stmt, can we specify multiple keys?

Like

READ TABLE itab with key matnr = '0000000023' ersda = '010108'.

Plz suggest!

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
530

Yes like

> READ TABLE t_cobk INTO cobk

> WITH KEY mandt = coep-mandt

> kokrs = coep-kokrs

> belnr = coep-belnr

> BINARY SEARCH.

Look at [Reading Lines of Tables|http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb35f8358411d1829f0000e829fbfe/frameset.htm]

Regards

4 REPLIES 4
Read only

Former Member
0 Likes
530

Hi,

Yes u can specify multiple keys in READ TABLE stmt.

It will work but dont forget to check SY-SUBRC otherwise clear workarea after every record.

READ TABLE itab with key matnr = '0000000023'

ersda = '010108'

ernam = 'SAPABAP'.

IF sy-subrc EQ 0.

-


ENDIF.

Regards,

Srinivas Ch

Read only

RaymondGiuseppi
Active Contributor
0 Likes
531

Yes like

> READ TABLE t_cobk INTO cobk

> WITH KEY mandt = coep-mandt

> kokrs = coep-kokrs

> belnr = coep-belnr

> BINARY SEARCH.

Look at [Reading Lines of Tables|http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb35f8358411d1829f0000e829fbfe/frameset.htm]

Regards

Read only

Former Member
0 Likes
530

Hi Santo,

you can read the table using multiple keys.

READ TABLE itab with key matnr = '0000000023' ersda = '010108'.

if sy-subrc eq 0.

reward points if useful..

Regards,

Goutham.

Read only

Former Member
0 Likes
530

Thx