To Sort Table Maintenance Before Display.
I found the below steps very useful to sort the table maintenance before display.
- Go to SE11 and enter table name(eg. ZTEST) ->Display
- Click UTILITIES menu->Table Maintenance Generator
- Click on ENVIRONMENT menu->Modification->Maintenance screens->Double click on record in the popup.
- Write one MODULE SORT_EXTRACT (in PBO of the maintenance view screen) to sort exactly before Table Control loop statement(LOOP AT EXTRACT WITH CONTROL)
- Write the below piece of code at SORT_EXTRACT to sort Table Maintenance.
MODULE SORT_EXTRACT OUTPUT.
DATA : IT_ZTEST LIKE ZTEST OCCURS 1WITHHEADER LINE .
IF NOT SY-UCOMM = ‘NEWL’.
IT_ZTEST = EXTRACT.
SORT IT_ZTEST BY F1 F2 F3.
EXTRACT = IT_ZTEST.
ENDMODULE. ” SORT_EXTRACT OUTPUT
Source: An SAP Consultant: SAP ABAP – sorting Table maintenance
I have "optimized" the MODULE Content, to be able to use it more than once
CASE objh-objectname. "global field 🙂
DATA : IT_ZTEST LIKE <YOUR_MAINTVIEW> OCCURS 1 WITH HEADER LINE .
Hi Chitra Sankar,
Very nice, thanks.
Hello Chitra, it doesn't work, I've a dump OBJECTS_TABLES_NOT_COMPATIBLE ( description: Two internal tables are not compatible or convertible )
Hi Chitra / Leanid,
I have modified above code for better performance.
Thanks, quick and elegant.
Hi,Mr.Manoj Mohanty, thank you. this is a alternative solution to my question herehttps://answers.sap.com/questions/12903934/how-to-handle-this-error-assign-base-wrong-alignme.html?childToView=12903953&answerPublished=true#answer-12903953
Can you help check why that is happenning?
boss ! thanks this is working, but when we manipulate EXTRACT or TOTAL then standard
functionalities like SAVE, DELETE go high and they do not work in fact the memory id
(SAPLZMM_E006)<ACTION> is set to '#' instead of 'U' , so can u help on this ?
Hello Shubham, How did you resolve this point?
Hi Pablo, No !
Unfortunately we had to conclude that we can't manipulate and save the SM30 view, only thing we can do is in display mode only like SORT and EXPORT.
Hi Manoj Mohanty,
it works fine for sorting, but I can't delete rows. I have the message:
"Select entries before performing the function".
Try like this.
If you want to be indepentent from regeneration, you can try event 10 with the following coding:
Thank you Christian. Simple and straight forward.
Hey, I'm a Functional Consultant so hopefully my code is not too woeful. I created a cluster view using transaction SE54. The records were not sorted, so I created a variation on the code above but tried to keep it generic so I can use the same module for any table to sort the underlying view by the primary index (a.k.a. key).
I was facing the same problem. I was able to sort but couldn't delete or copy rows.
The following solution fit for me to sort and still being able to delete and copy correctly: