In reply to basilleaf:
You have declared seq_item local to the task body(), it is not visible to the write() method. Either pass it through an argument, or declare it as a shared class member, not inside the method.
As this code looks suspiciously like a uvm_sequence, there is already a sequence_item declared with the name ‘req’, so you do not need to declare a separate variable.