As the logo is about to complete, I need to remove the both sides (left and right) from the rectangle. But, at the same time, the white background should retain in the logo. The left side or right side is possible to remove with direct selection tool, but as I apply the same tool for either side, it takes away the background as well. How to deal with this issue in adobe illustrator?
3 sides left, one removed do not change the fill; remove the other end and the fill vanishes because you have 2 separate lines. If the stroke has no other function than to make the shape bigger and the shape is easily scalable like a rectangle is use strokeless shapes to avoid the whole problem.
Let the grey background rectangle be at first as wide and high as the white foreground shape. Let both of them have no stroke, only fill. Then make the grey a little higher and align it to the same centerpoint with the white one.