How to copy a material in same client by referring another material
Generally, you may consider using the MASTERIDOC_CREATE_MATMAS function to do this job. However, if you copy it within the same system, there may also be a convenient alternative to call the MATERIAL_MAINTAIN_DARK directly with the correct data provided. Z-Fields in MARA table are usually copied into a new material when they are part of a proper APPEND-structure of MARA. If you send IDocs to the same system, you have to create a second logical system pointing back to your system (you can use destination NONE), as the integrity checker will not allow sending IDoc to your own system.