Solve[{C Exp[-q a/2] == -A Sin[k a/2] + 
            B Cos[k a/2], 
        C q Exp[-q a/2] == 
          k (A Cos[k a/2] + B Sin[k a/2]), 
        A Sin[k a/2] + B Cos[k a/2] == D Exp[-q a/2], 
        k (A Cos[k a/2] - 
                B Sin[k a/2]) == -D q Exp[-q a/2]}, {A, 
        B, C, D}]