Hi Surajit,
I think that code is not necesseary, fot that kind of coping fields. If you are creating fields with same ID,
DataType, Lenght, in that tables (f.e. Sales OrderHeader/SalesInvoiceHeader), you can use function transferfields.
Best regards,
Aleksandra.