In t-codes, we can see tree structures on right side of the screen. This is not recorded with non GUI modes. In direct SAP, we can record with the help of 'Script recording and Playback'.
Launch application >> File >> Options>> Data Settings>>
Disable Trim leading Spaces and Disable Trim trailing Spaces.