def record_modify_subfield(rec, tag, subfield_code, value, subfield_position,<EOL>field_position_global=None,<EOL>field_position_local=None):
subfields = record_get_subfields(<EOL>rec, tag,<EOL>field_position_global=field_position_global,<EOL>field_position_local=field_position_local)<EOL>try:<EOL><INDENT>subfields[subfield_position] = (subfield_code, value)<EOL><DEDENT>except IndexError:<EOL><INDENT>raise InvenioBibRecordFieldError(<EOL>"<STR_LIT>" % subfield_position)<EOL><DEDENT>
Modify subfield at specified position.

    Specify the subfield by tag, field number and subfield position.