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

Splitting an Internal Table

Former Member
0 Likes
806

Hi,

whats the most efficient way of splitiing a standard internal table. I have an internal like below:

<u> <b>Element</b></u> <u><b> value</b></u>

ElementA dsds

ElementA d343

ElementB dsfds23

ElementC sfdsf

and want split it into a new internal table for each element type. Is the best way to loop round the internal table, adding the element to a new internal table, checking when it changes, doing my processing, and repeating the process?

Thanks.

1 ACCEPTED SOLUTION
Read only

eddy_declercq
Active Contributor
0 Likes
655

Hi,

I would suggest.

loop at itab into wa.

at new element.

itab2-element = wa-element.

  • or do anything you like with this row.

endat.

endloop.

Eddy

5 REPLIES 5
Read only

eddy_declercq
Active Contributor
0 Likes
656

Hi,

I would suggest.

loop at itab into wa.

at new element.

itab2-element = wa-element.

  • or do anything you like with this row.

endat.

endloop.

Eddy

Read only

Former Member
0 Likes
655

Hi,

yes that will be the simplest way to handle.

Regards,

Jagath

Read only

0 Likes
655

Hi,

Perfect. But for this to work perfectly, you'll need to sort the itab on element field.

Cheers,

Sam.

Read only

0 Likes
655

Do you allready know how much elements there are or have internal tables for each element also have to be created dynamically? (If you know how to do that I would be intersted

Read only

0 Likes
655

Bas, this post has already been closed. Please ask your question in a new post. Thanks.

Regards,

Rich Heilman