Skip to Content
0

Loop thorugh and change data in ABAp 7.40/7.50

Apr 11, 2017 at 09:27 AM

82

avatar image

Hi,

In abap 7.40/7.50, is there an easier way to loop through an itab and change data than this example?

Didn't find a way to use gt_data = VALUE #( ... )

* Get mara
Select *
from mara
into table @data(lt_mara).

* Reconcile

Loop at gt_data assigning field-symbol(<ls_data>).
<ls_data>-bismt = lt_mara[ matnr = <ls_data-matnr ]-bismt.
Endloop.


10 |10000 characters needed characters left characters exceeded

Looks easy enough to me... You can probably do it use a table comprehension.

1
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Evgeniy Astafev Apr 11, 2017 at 12:42 PM
0

You can only try to join mara in query where you fill gt_data if it possible.

Or do you want some magic command to move corresponding fields by key?

Share
10 |10000 characters needed characters left characters exceeded
Per Åge Themte Apr 18, 2017 at 07:03 AM
0

Yep, it was the magic I was looking for ;) But if it's not invented yet, the loop works :) Thanks!

Share
10 |10000 characters needed characters left characters exceeded