Let's say the variable to hold the item ID is variable #5. Then all you'd have to do is a script call:
For an item:
$game_party.gain_item($data_items[$game_variables[5]], amount)
For a weapon:
$game_party.gain_item($data_weapons[$game_variables[5]], amount)
For armor:
$game_party.gain_item($data_armors[$game_variables[5]], amount)