im Kopf haben

Etymology
lit. 'to have (something) in one’s head'.

Verb

 * 1)  to remember, to know by heart