YOU SAID:
what had you had for dinner my friend
INTO JAPANESE
友達の夕食に何を食べましたか
BACK INTO ENGLISH
What did you eat for your friend's supper
INTO JAPANESE
友達の夕食に何を食べましたか
BACK INTO ENGLISH
What did you eat for your friend's supper
That didn't even make that much sense in English.