And when he saw it set in his presence , ( Solomon ) said : This is of the bounty of my Lord , that He may try me whether I give thanks or am ungrateful . Whosoever giveth thanks he only giveth thanks for ( the good of ) his own soul ; and whosoever is ungrateful ( is ungrateful only to his own soul 's hurt ) .