‎2005 Dec 22 11:43 AM
Dear All,
I am having one ITAB which having 4000 records.
I want sort my records partialy.
E.g. Some records will be sorted against certain criteia and other will be some differnt criteria in a
Single Internal table.
Is it Possible?
If so kindly give me some input.
Thanking you in Advance.
Siladitya
‎2005 Dec 22 11:53 AM
Hi sarkar,
You can do this by using dynamic sorting.
Check this link...
2. I have found another link... See if it is help full.
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3800358411d1829f0000e829fbfe/content.htm
Hope this helps you.
Regards,
Vivek.
‎2005 Dec 22 11:51 AM
Hi siladitya,
1. I don't think it is possible in 1 straight shot.
2. u will have to take 2 extra itnernal tables
of same structure.
3. then using loop where
u must popultae the 1 extra table,
then using second loop where 2nd condition,
u must popultae the 2 extra table.
4. then u must sort them individually
using both criteria.
5. then u can merge them.
something of the above logic.
I hope it helps.
regards,
amit m.
‎2005 Dec 22 11:52 AM
split the table and sort them in different orders.
and combine..
regards
vijay
‎2005 Dec 22 11:53 AM
Hi sarkar,
You can do this by using dynamic sorting.
Check this link...
2. I have found another link... See if it is help full.
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3800358411d1829f0000e829fbfe/content.htm
Hope this helps you.
Regards,
Vivek.
‎2005 Dec 22 12:00 PM
Hi its not possible to sort the internal tables PARTIALLY.
in order to acheive ur functionality what u can do is...
sort based on ur requirements multiple times as follows.
sort itab by field1.
.....
.....
sort itab by field2.
....
....
sort itab by field3.
....
...
hope u got my point.
satish
‎2005 Dec 23 1:53 AM
to achieve this you can include generic field(s) solely for sorting. eg if you have a table with data fields Rec_type(1), matnr and date. You could create a table:
sort_field(20) " can be as long as the longest source field
rec_type,
matnr,
date.
You can then have logic to populate the sort field, say
if rec_type = 'A'.
concatenate matnr date into sort_field.
else.
sort_field = date.
endif.
You can then sort the table. Obviously you could have multiple fields, sort_field1,2 etc.