System for locking a shelf of a piece of furniture or a shelving unit to a fixed element projecting from the wall of the piece of furniture or shelving unit, comprising • a shelf comprising a supporting surface for supporting objects and the opposite sides of the shelf each comprise a surface groove having an inlet at the base of the side and a blind end connected by a channel (22, 24) which deviates with respect to a line orthogonal to the supporting surface; wherein the channel comprises a first segment connected to a second segment, the first segment being substantially orthogonal to an imaginary plane on which the supporting surface lies and having at one end said inlet, the second segment being angled with respect to the first one and ending with said blind end; • a first fixed element projecting from the wall of the piece of furniture or shelving unit; the groove being configured so that the fixed element can be inserted into the inlet, and the groove and the fixed element being configured so that the groove is couplable to the fixed element thereby bringing the latter to the blind end by travelling the first and second segments (22, 24) in sequence; • a second element insertable in the first segment to block the fixed first element inside the second segment, wherein said second element comprises an elastically deformable portion adapted to press against the shelf when said second element is inserted in the first segment, and characterized in that the shelf comprises a frame formed by a front segment, a rear segment and two lateral segments, wherein the segments (14, 16, 18) are assembled to form an overall rectangular or square frame, and the lateral segments are each provided with at least two identical of said grooves which are carved out of the material or obtained by material removal. • a shelf comprising a supporting surface for supporting objects and the opposite sides of the shelf each comprise a surface groove having an inlet at the base of the side and a blind end connected by a channel (22, 24) which deviates with respect to a line orthogonal to the supporting surface; wherein the channel comprises a first segment connected to a second segment, the first segment being substantially orthogonal to an imaginary plane on which the supporting surface lies and having at one end said inlet, the second segment being angled with respect to the first one and ending with said blind end; a supporting surface for supporting objects and the opposite sides of the shelf each comprise a surface groove having an inlet at the base of the side and a blind end connected by a channel (22, 24) which deviates with respect to a line orthogonal to the supporting surface; wherein the channel comprises a first segment connected to a second segment, the first segment being substantially orthogonal to an imaginary plane on which the supporting surface lies and having at one end said inlet, the second segment being angled with respect to the first one and ending with said blind end; • a first fixed element projecting from the wall of the piece of furniture or shelving unit; the groove being configured so that the fixed element can be inserted into the inlet, and the groove and the fixed element being configured so that the groove is couplable to the fixed element thereby bringing the latter to the blind end by travelling the first and second segments (22, 24) in sequence; the groove being configured so that the fixed element can be inserted into the inlet, and the groove and the fixed element being configured so that the groove is couplable to the fixed element thereby bringing the latter to the blind end by travelling the first and second segments (22, 24) in sequence; • a second element insertable in the first segment to block the fixed first element inside the second segment, wherein said second element comprises an elastically deformable portion adapted to press against the shelf when said second element is inserted in the first segment, and the segments (14, 16, 18) are assembled to form an overall rectangular or square frame, and the lateral segments are each provided with at least two identical of said grooves which are carved out of the material or obtained by material removal.