China's yuan gave up earlier gains and ended domestic trading at a near two-week low against dollar on Friday, as major state-owned banks bought the greenback.