How to generate an unique serial ID based on a select value
You can use webform hooks for add your custom code before sending the data or saving it into the database. Create hidden field in webform and set the value of the same using hook_webform_submission_presave
For Ex. 

function yourmodule_webform_submission_presave($node, &amp;$submission) {
  // Update some component's value before it is saved.
  $component_id = 4; // where 4 is your hidden component id
  // Add your logic for registration code
  $submission-&gt;data[$component_id][0] = 'registration_code_you_wish_to_set';
}


Or If you want unique registration number check this module http://drupal.org/project/regcode

Hope this helps.