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

New SAP ABAP Syntax

2,383

Hi Expert,

Could you please provide me the code " How to use parallel cursor " using new abap syntax and also how to convert the multiple reads within loop into the new abap syntax .

Thanks in advance ,

Cheers.

Hi Expert,

Could you please provide me the code " How to use parallel cursor " using new abap syntax and also how to convert the multiple reads within loop into the new abap syntax .

Thanks in advance ,

Cheers.

7 REPLIES 7
Read only

roberto_forti
Contributor
1,617

Hi Nitin, Certainly, SAP transaction ABAPDOCU - ABAP Documentation and Examples will help you about it.

Regards,

Read only

0 Likes
1,617

Hi Nitin, example about parallel cursor algorithm...

...
SORT: lt_x[] by key field_a, lt_y[] by key field_a.
...
lv_index = 0.

LOOP AT lt_x[] INTO lw_x.
  LOOP AT lt_y[] INTO lw_y FROM lv_index.

    IF ( lw_y-field_a NE lw_x-field_a ).
      lv_index = sy-tabix.
      EXIT.
    ENDIF.
  ...
  ENDLOOP.
...
ENDLOOP.<br>

Read only

1,617

Thanks Roberto.

This syntax is know and already worked on it.

But i was actually looking for abap 7.50 .

For Example ..Below is the way to populate the internal table (replacement of Loop).

DATA(gt_citys) = VALUE ty_citys( FOR ls_ship IN gt_ships

WHERE ( route = ‘R0001’ ) ( ls_ship–city ) ).

*** So is there any way to replace the old parallel cursor syntaxes with the new syntax .

Regards,

Nitin

Read only

matt
Active Contributor
1,617

Parallel cursor technique hasn't been necessary since tables other than STANDARD were introducted into the ABAP langauge over 18 years ago.

Read only

0 Likes
1,617

Is it ?

But if we want to loop the internal table inside the loop , then we need to use the parallel cursor technique to avoid the unnecessary loops .

Regards,

Nitin

Read only

matt
Active Contributor
0 Likes
1,617

With HASHED tables (for example), the need to loop within a loop in this fashion can be made to disappear.

Read only

roberto_forti
Contributor
0 Likes
1,617

folowing example...