Hi Charlie,
You achieve this by using the 'SORT' property for alv.
First you need to create an internal table with the table type 'LVC_T_SORT' or with the structure 'LVC_S_SORT'.
Say for Example,
DATA : it_sort TYPE TABLE OF LVC_S_SORT, "Internal Table Declaration
wa_sort TYPE LVC_S_SORT. "Work Area Declaration
" Now append the field name of original field Created BY to it_sort
CLEAR wa_sort.
wa_sort-spos = 1.
wa_sort-fieldname = 'CREATED_BY'. "Replace with actual field name
wa_sort-up = 'X'.
APPEND wa_sort TO it_sort.
CLEAR wa_sort.
....
"Pass the sort table to function call for displaying alv
CALL METHOD GRID_SALE->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
is_variant = gs_variant
i_save = 'A'
is_layout = wa_layout
CHANGING
it_fieldcatalog = git_salefcat
it_sort = it_sort
it_outtab = it_outtab
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4.
IF SY-SUBRC <> 0.
MESSAGE S082 DISPLAY LIKE 'E'.
ENDIF.
Regards,
FB