Q name and reference

When I am doing q name in command then it's coming

"Sctn 2 of frmwork 1 of stru /xxxxx"

But when I calling it in a variable it's coming reference number.

"=56577/678"

  • So how to get "Sctn 2 of frmwork 1 of stru /xxxxx" in a variable.