In The Piano Lesson, Boy Willie has one over-riding goal - to buy Sutter's land. Boy Willie has two ways to get the money for this purchase. He wants to sell the truckload of watermelons and to sell the family piano.
Until Boy Willie sells the watermelons and empties the load in the truck, the sale of the piano is put off. This plot device allows tension to build as the discussion of whether or not to sell the family piano becomes increasingly complicated and heated.
Relatively early on in the play, we can see that the decision about what to do with the piano will constitute the play's climax and pit brother Boy Willie against sister Berniece.
When the wave of watermelon sales are over, we see that Boy Willie is not "all talk" and is capable of following through with his plans. This helps to heighten the tension between the two opponents, Boy Willie and Berniece because Boy Willie's plan to sell the piano becomes more realistic in the aftermath of his first success.
As the play moves toward its climax it is only the watermelons that stand as a time barrier putting off the inevitable show-down between the siblings regarding the piano. The play's tense climax arrives soon after the watermelons are sold completely.
In summation, we might simply say that the watermelons provide a narritive device allowing time for exposition of the play's true conflict, which centers on the piano and the characters' relationships with the past.