Read a logical database (you must have data in those tables, now LFA1), fill up an internal table. Sort the data by a given field and then display the internal table.
Solution:
report zldbread no standard page heading.
tables: lfa1.
data: begin of t occurs 0,
linfr like lfa1-lifnr,
name1 like lfa1-name1,
end of t.
start-of-selection.
get lfa1.
clear t.
move-corresponding lfa1 to t.
append t.
end-of-selection.
sort t by name1.
loop at t.
write: / t-name1, t-lifnr.
endloop.