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: 

a littel problem with the sort of itAB

Former Member
0 Kudos
110

hello ALL;

THE ITAB LIKE LIKE

names position RATE

mILLER ADMIN 1

sTONE DEV 2

steve admin 3

i need the result

admin Miller 1

steve 3

Dev stone 2

how could i do this

Thanks for your help.

Chris

1 ACCEPTED SOLUTION

Former Member
0 Kudos
86

use the following syntax:

Sort Itab by Position name rate assending.

loop at itab.

write 😕 itab-position, itab-name, itab-rate.

end loop.

Regards,

Guru

PS - Reward answers if helpful

8 REPLIES 8

Former Member
0 Kudos
87

use the following syntax:

Sort Itab by Position name rate assending.

loop at itab.

write 😕 itab-position, itab-name, itab-rate.

end loop.

Regards,

Guru

PS - Reward answers if helpful

0 Kudos
86

Ok ist helpfull.

but i want this

admin MILLER

STEVEN

DEV sCOTT

0 Kudos
86

use the following syntax:

Sort Itab by Position name rate assending.

loop at itab.

on change of itab-position.

write 😕 itab-position, itab-name.

exit.

endon.

write 😕 itab-name.

end loop.

- Guru

Reward helpful answers

0 Kudos
86

ist correkt,

i dont want to display the table, i want to change the table (modify)

Thanks for help

0 Kudos
86

I didnt get you. If you are trying to modify the internal table then instead of wrie you can use the update itab syntax. That will modify your internal table.

BTW, what is that you are trying to do exactly?

- Guru

0 Kudos
86

Is correct to

Ok againe

Select * from table into it_tab.

Itab looks like

Position Name

admin Miller

dev scott

admin Steve

Loop at itab

  • modify itab

endloop.

The result should look like

admin Miller

Steve

Dev Scott

0 Kudos
86

If you are tryign to get the value of name field into the position field, then in the loop before modify statement put this syntax.

itab-position = itab-name.

but I still dotn understand your intentions to do this. why would you be concerned on moving the value to the first column. You can always handle this logically in yoru program accordign to the need.

- guru

Former Member
0 Kudos
86

Soved it on my own.