generate commerce coupon bulkly
I think your code is good but you forget save entity .I hope this get clue to you to achieve your job.

$No=$form_state["values"]["code_NO"];
    $type_id=$form_state["values"]["type"];
    $record['type']='discount_coupon';
    $record['code']=commerce_coupon_generate_coupon_code($type_id);
    $record['commerce_discount_reference']['und']['0']['target_id'] =$type_id;
    $record['commerce_coupon_conditions']['und'][0]=Array('condition_name'=&gt;'commerce_coupon_usage_evaluate_usage',
            'condition_settings' =&gt;Array( 'max_usage'=&gt; 1),
            'remove_condition'=&gt; 'Remove',);
$entity=entity_get_controller('commerce_coupon')-&gt;create($record);
commerce_coupon_save($entity);