2.2.11

SAP Note 21450 - How do I sort the lines of the overview list?

Symptom:

Release 2.2: ============The lines of the overview list are either sorted according to key, text or value of a column. Often, however, another sorting is wanted. How can this be changed?

Release 3.0: ============The lines of the drill-down list are either sorted according to key, text, value of a column, or hierarchy if available and selected. Often, however, another sorting is wanted. How can this be changed?

Cause and prerequisites

Consulting problem

Solution
Release 2.2: ============The characteristic texts of the characteristics that are to be reordered are changed, namely, a number with n figures is written to the characteristic texts. The number specifies the sorting. The number of the attributes of the characteristic determines n (number<10-->n=1, number<100-->n=2, number<1000-->n=3, and so on).
Example: 00000001 Glasware
00000002 Ceramics
00000003 Steel products
00000004 Electrical goods
is changed to
00000001 3Glasware
00000002 2Ceramics
00000003 4Steel products
00000004 1Electrical goods
Note: You have to make this change in all used languages.

Then you have to make the following program changes:1.) Change routine WT in MKCBEF80:

FORM WT USING VALUE(WT_SORT) VALUE(WT_ZIEL) WT_FELD.
....
....
IF EQ 'N'.
perform check_sort_auspg changing . "SORT
ENDIF.

ENDFORM

2.) Create routine check_sort_auspg in MKCBEF80:

form check_sort_auspg changing csa_text. "SORT
"SORT
field-symbols: . "SORT
"SORT
assign csa_text+0(1) to . "n=1 "SORT
if co '0123456789'. "SORT
shift csa_text by 1 places. "n=1 "SORT
endif. "SORT
"SORT
endform. " CHECK_SORT_AUSPG "SORT

3.) Change routine LESEN_TEXT in MKCBRF10:

FORM LESEN_TEXT USING VALUE(LTE_SORT) LTE_TEXT LTE_TFLAG LTE_DFLAG.
.....
.....
IMPORTING
CHARACTERISTIC_TEXT = LTE_TEXT
DOCU_FLAG = LTE_DFLAG
TEXT_FLAG = LTE_TFLAG
EXCEPTIONS
CRITERIA_NOT_FOUND = 01
KEY_NOT_FOUND = 02
TABLE_NOT_FOUND = 03.
perform check_sort_auspg(sapmkcbe) changing lte_text. "SORT
ENDIF.
ENDFORM.
4.) Sort in ascending order according to the column text during the breakdown in the report. --> 00000004 Electrical goods
00000002 Ceramics
00000001 Glasware
00000003 Steel products

Release 3.0: ============Create and select a hierarchy to the characteristic and sort it by hierarchy.

No comments:

Post a Comment