To export and import the printers later we need their short names.
Lname , padest columns of table tsp03l gives us the long and short name of the printer. To find which of these printers are used as default printers by users we need to check Spld column from usr01.
We use distinct to choose unique names to eliminate duplicate printer names. So the command for selecting short names of default printers used in an SAP systm with db2 database will look like this .
db2 => select distinct a.lname from sapdca.tsp03l a, sapdca.usr01 b where b.spld=a.padest