HH is Headquarters Holding.
A bod could be posted under a variety of conditions
P is posted but in most cases the clerical scribe omits this from the records - it means that the man has been posted to the unit to fill an establishment position. Within reason the unit will use him as it sees fit within his trade. They are also responsible for pay. messing, training, equipment, clothing etc.
A is attached. Here the bod has been assigned for a short time to the receiving unit and they are responsible pay, messing and training but he is not counted as part of their establishment. He can be paid from the new location but it must claim the money paid out back from the original unit.
HH is Headquarters Holding. In this case the bod has not been posted to the unit to fill an establishment post. He is there as part of the Command/Force manpower reserve and can be withdrawn and posted elsewhere as HQ sees fit. The Unit listed is obliged to provide training, pay, messing etc while they have him and to keep him gainfully employed. (not to be confused with H which is Home Force or HH/H which is usually first holding job on entry)
As Eccles from the Goon show says "everybody got to be somewhere!"
This should help you understand attachments in that he never really left the supervision of the original unit.
Ross