German retail giant Metro Group has moved to a net profit in the first half of the year.