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: 

how to write read statement from the loop parallel cursor

0 Kudos
308

* LOOP AT it_mard where matnr = ls_mara-matnr and werks in p_werks . """""""commented on 30 nov

READ TABLE it_mard with key matnr = ls_mara-matnr werks = p_werks BINARY SEARCH.
if sy-subrc = 0.
lv_index1 = sy-tabix.

i am not getting how to write the read statement from the loop "werks " in the read statement . plzz help me getting this answer soon .

thanks reagards

Mohammed Mubashir.

2 REPLIES 2

Jelena_Perfiljeva
Active Contributor
0 Kudos
244

There is no "parallel cursor" involved... It looks like you're trying to replace LOOP with reading a single record (?) and trying to use BINARY SEARCH to speed it up?

My guess is that you need to add INTO or TRANSPORTING NO FIELDS. This can be found in ABAP keyword documentation. I see that LOOP has no INTO either, so I guess it_mard has a header line. This must be a seriously old program if that's the case...

Not sure what is the actual goal here but I don't recommend using BINARY SEARCH and if you absolutely must, table needs to be sorted first. If you need faster performance then change the definition of IT_MARD table and use the best table type for the occasion. Of course, not getting too much unnecessary data into the table in the first place is a good option too.

Good luck and please read Help (F1) first before posting questions and try to include more details next time.

TarunTakshak
Participant
0 Kudos
244

Hi mubashirbennishirur,

Please find below sample code for parallel cursor

Thanks

Tarun