cancel
Showing results for 
Search instead for 
Did you mean: 

Sort order of table t156F changed after unicode migration

Farid
Active Participant
0 Kudos

Hello,

We are running SAP ECC6 EhP5 SPS7 on top of Oracle 11g HPUX 11.31.

We have perfromed an unicode migration last week of our DEV system,

and after that the behaviour of MIGO transaction has changed.

After analysis, it turns out that the sorting order of table t156f

has changed at the ORacle level, and therefore at the abap level.

When running the SQL request both on DEV (unicode migrated) and QAS (note yet migrated)

select *

  from sapsr3.t156F

where segst = 'E01'

Here is the output on DEV :

SEGST     CNT02  FELDV                                            FELDS
--------- ------ ------------------------------------------------ --------------
E01       10     EKPO-BSMNG                                       XEKPO-WESBB
E01       11     EKPO-UNTOM                                       XEKPO-WESBB
E01       01     EKPO-BSMNG
E01       02     EKPO-BSMNG                                       XEKPO-WEMNG
E01       04     EKPO-BSMNG                                       XEKPO-WESBS
E01       05     EKPO-UNTOM
E01       06     EKPO-UNTOM                                       XEKPO-WEMNG
E01       07     EKPO-UNTOM                                       XEKPO-WESBS
E01       08     EKPO-WEMNG                                       XEKPO-WEMNG
E01       09     EKPO-BPWEM                                       XEKPO-BPWEM

10 rows selected.

And here is the output on QAS

SEG CN FELDV            FELDS            FELDM            FELDL            X K X
--- -- ---------------- ---------------- ---------------- ---------------- - - -
E01 01 EKPO-BSMNG                        DM07M-UETMG      LGAUS-BSMNG
E01 02 EKPO-BSMNG       XEKPO-WEMNG                                          -
E01 04 EKPO-BSMNG       XEKPO-WESBS                                          -
E01 05 EKPO-UNTOM                        DM07M-UNTMG      LGAUS-UNTMG
E01 06 EKPO-UNTOM       XEKPO-WEMNG                                          -
E01 07 EKPO-UNTOM       XEKPO-WESBS                                          -
E01 08 EKPO-WEMNG       XEKPO-WEMNG                       LGAUS-WEMNG      X   X
E01 09 EKPO-BPWEM       XEKPO-BPWEM                       LGAUS-BPWEM      X   X
E01 10 EKPO-BSMNG       XEKPO-WESBB                                          -
E01 11 EKPO-UNTOM       XEKPO-WESBB                                          -

10 rows selected.

For some reasons, on DEV, result are no more sorted,

I tired refresh of the statistics, rebiuld the primary index, it didn't help.

Any idea ?

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

stefan_koehler
Active Contributor
0 Kudos

Hi Raoul,

well that is pretty easy. You have not specified an ORDER BY clause and in this case the data is not guaranteed to be sorted (by a FULL TABLE SCAN or INDEX FAST FULL SCAN).

If the SQL uses and index (for example the primary index with an INDEX RANGE SCAN) - the data is sorted by the primary key columns, but in case of a FULL TABLE SCAN the data is returned as it is physical stored. This means that it can be ordered (very usual with only a few rows) but it don't have to.

As you have performed an unicode migration the export is usually also done unsorted which increases the chance of unsorted data (especially with split tables).

Regards

Stefan

Farid
Active Participant
0 Kudos

Thank you Stephen for your clear explanations.

The problem is actually happening when calling transaction MIGO ,and the function module is SAP standard, not changed by us, it is not a customer exit.

So I guess, that the only thing to do is to open a sap customer call and ask SAP to adjust the abap coding so that an ORDER BY clause is added ?

Thanks

Raoul

stefan_koehler
Active Contributor
0 Kudos

Hi Raoul,

yes the ABAP coding needs to be modified, if the application requires the data sorted (or does not sort it in an internal table afterwards) in any case.

Regards

Stefan

Answers (1)

Answers (1)

Farid
Active Participant
0 Kudos

It turns out that the ROWID sequence has changed on DEV after the migration, that is why the table seems not correctly sorted.

But I didn't know it was supposed to be a consequence of the unicode migration, and how to solve it ?