Direct speech:
Question: "How can I get there?"
Reported speech: He asked me how he could get there.
Question: "What is your name?"
Reported speech: She asked me what my name was.
With the verb to be, take care to put the verb at the end.
Question: "When can you come?"
Reported Speech: She asked me when I could come.
Question: "**When **did they leave****?"
Reported Speech: He asked me when they left.
All direct speech can be converted to indirect speech. It can become slightly complicated but I have given a few more examples.
The problem is that you hear a lot of people just transposing the speech and not actually reporting it:
Question: "When are you expecting an answer"? [question form]
Incorrect: "They asked me when are you expecting an answer".
Correct: "They asked me when you are expecting an answer".
The verb must be put in some past tense.
Basically reported speech calls for questions to return to a statement form, which means you have to make sure the verbs are not inverted.