In reply to UVM_LOVE:
You need to assign the value that you get for packets in your sequence.
class seq_from_test extends apb_basic_test;
`uvm_component_utils(seq_from_test)
apb_sequence s_apb_sequence;
function new(string name, uvm_component parent);
super.new(name, parent);
endfunction
task run_phase(uvm_phase phase);
phase.raise_objection(this, "s_apb_sequence");
s_apb_sequence = apb_sequence::type_id::create("s_apb_sequence", this);
if(!uvm_config_db#(int)::get(this,"","number_of_packets",s_apb_sequence.packets))
`uvm_info(get_type_name(),"the getting of packets variable failed",UVM_LOW)
s_apb_sequence.start(apb_environment.apb_agent.sequencer);
phase.drop_objection(this, "s_apb_sequence");
endtask
endclass