Hi Antonio,
Hope you never used key fields.
Pass the sale order and item number to vbfa table, Separate the delivery no and billing document no by the following field vbtyp_n.
Pass the vbfa field to the lips key field.
OR Create secondary index for lips.
Before doing code View the entries of the tables.
Hope it helpful.
Regards,
Venkat.