In baseball, an at bat (AB) or time at bat is a batter's turn batting against a pitcher. An at bat is different from a plate appearance. A batter is credited with a plate appearance regardless of what happens during his turn at bat. A batter is only credited with an at bat if that plate appearance does not have one of the results enumerated below. While at bats are used to calculate certain statistics, including batting average and slugging percentage, a player can only qualify for the season-ending rankings in these categories if he accumulates 502 plate appearances during the season.
A batter will not receive credit for an at bat if their plate appearance ends under the following circumstances:
Section 10.02.a.1 of the official rules of Major League Baseball defines an at bat as: "Number of times batted, except that no time at bat shall be charged when a player: (1) hits a sacrifice bunt or sacrifice fly; (2) is awarded first base on four called balls; (3) is hit by a pitched ball; or (4) is awarded first base because of interference or obstruction..."(Wikipedia)