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: 

Loop thorugh and change data in ABAp 7.40/7.50

perage
Participant

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.


3 REPLIES 3

matt
Active Contributor

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

former_member210008
Active Participant
0 Kudos

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?

perage
Participant
0 Kudos

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