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

Need help...

Former Member
0 Likes
703

hi,

i have internal table like below:

0567(plant) 08(chrac.length)

0567 12

0570 12

0570 14

0580 16

now i have 3-different plant with 4-different length

now i want internal table like below:

0567 08

0567 12

0567 14

0567 16

0570 08

0570 12

0570 14

0570 16.

etc.......................

how can i make logic to make above format....

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
684

One way to do this as

0567(plant) 08(chrac.length)

0567 12

0570 12

0570 14

0580 16

for this sort table by plant and save only plant to one internal table. then sort by length and store it in diffrent internal table so now you have two internal table with one having plant and other having length. delete if any duplicate from both. then loop at one and again loop at second and store all combination into third internal table. note that i am considering length also one of the field in internal table.

6 REPLIES 6
Read only

Former Member
0 Likes
684
Sort itab by plant length.
Read only

0 Likes
684

can u plz once have a look into my requirement and then let me know how to do ?

Read only

0 Likes
684

sorry i thought just sorting

Edited by: jose on Feb 8, 2008 4:59 AM

Read only

Former Member
0 Likes
685

One way to do this as

0567(plant) 08(chrac.length)

0567 12

0570 12

0570 14

0580 16

for this sort table by plant and save only plant to one internal table. then sort by length and store it in diffrent internal table so now you have two internal table with one having plant and other having length. delete if any duplicate from both. then loop at one and again loop at second and store all combination into third internal table. note that i am considering length also one of the field in internal table.

Read only

Former Member
0 Likes
684

Hi

ITAB1 contains PLant and Itab2 contains Length ( u know length)

ITAB3 contains plant and field

SORT ITAB1 BY PLANT .

SORT ITAB2 BY Length .

LOOP At itab1 .

Loop at itab2 .

itab3-plant = itab1-plant .

itab3-length = itab2-length.

append itab3 .

endloop .

ENDLOOP .

Hope it helps,.

Praveen

Read only

Former Member
0 Likes
684

hi,

If it has two fields like plant and length then you can do like sort internal table and if suppose these are different ..in this case you have to take another internal table which will have two fields i.e. plants and length then you can take all records into new internal table and then sort....