There are many different ways to do it.
Usually, I will avoid hardcoding the constants. But if you don't mind, this code works as what you want:
procedure TForm1.Button1Click(Sender: TObject);
var
S: string;
begin
S := Edit1.Text;
S := S.Replace('A', '1');
S := S.Replace('B', '2');
S := S.Replace('C', '3');
S := S.Replace('D', '4');
Edit2.Text := S;
end;