Skip to Content
0
Former Member
Jun 03, 2008 at 11:05 AM

Problem in sorting of table

26 Views

Hi Friends:

Below are the records in my table:

a...|b|c...... |d.....|e................|f

100||25000|......|0000012998|0002259999

100|*|25000|1405|0000012998|0002251405

100|*|25000|1406|0000012998|0002251406

100|*|25000|1407|0000012998|0002251407

100|*|25000|1409|0000012998|0002251409

100|*|25000|1410|0000012998|0002251410

100|*|25000|1411|0000012998|0002251411

100|*|25000|1419|0000012998|0002251419

100|*|25000|1420|0000012998|0002251420

100|*|25000|1421|0000012998|0002251421

a = client

b= Leg.Dept Code

c= Legacy Product

d= Legacy Location

e= Cost Center

f= Profit Center

Please consider '.' as space.

The problem arises in the sorting of the table records. The first record shown in the record set above has the following entry:

a...|b|c...... |d.....|e................|f

100||25000|......|0000012998|0002259999

This is the default entry that is to be used if there is no Leg.Location (where Leg. Location = *). If there is an entry for the specific Leg. Location, then it should be used prior to using this record.

Problem appears to be that the ABAP program locates this default record prior to encountering the specific record, for example:

a...|b|c...... |d.....|e................|f

100|*|25000|1419|0000012998|0002251419

Because the program encounters the wildcard one first, even if the Leg. Location that the program is searching for is 1419 (which appears in the table, just lower in the listing) the program returns a Profit Center of 2259999 instead of the correct value of 2251419.

Is it possible to change the native sort of this table so that the wildcard entries appear at the bottom of the listing instead of the top? If yes, can it be done permanently.

This would allow the program to encounter the specific entries prior to encountering the wildcard ones.