After a witness called by the prosecuting attorney has testified on direct examination, the court shall, on motion of the defendant, order the prosecuting attorney to produce any statement, as defined in § 23A-13-10, of the witness in the possession of the prosecuting attorney which relates to the subject matter as to which the witness has testified. If the entire contents of any such statement relate to the subject matter of the testimony of the witness, the court shall order it to be delivered directly to the defendant for his examination and use.
SDCL 23A-13-7