Remove strings and cut beans into one inch pieces; wash and cook in the boiling, salted water (1 teaspoon salt to 1 quart water), until tender, but not soft. Drain beans and save the water in which they were cooked. Reserve enough of this bean liquor to fill cans, add the sugar and vinegar, let just cook up, add the drained beans, cook all together and pour boiling hot into the cans. Seal at once. Use as a salad or sweet sour vegetable.