Earlier quoted context omitted.
If hams are fungible from a customs point of view (why would they not be?) you could try pre-curing the hams and have them ready just across the border. Ham in, ham out, ham in again, no extra trip to Spain required. Then you sell the uncured hams you needed for the stamps to a pet-food factory or for German “salami” or whatever.
They possibly need to be cured in Spain so that they can be called Spanish (e.g. Serrano or Ibérico). And I guess they aren’t fungible because they get tested for health reasons and protein content. In the EU, tracking is needed. If people get ill from eating ham, it’s important to exactly know where the meat came from (factory, farm, sometimes even the specific pig. Conversely, if animals get ill, it’s important to…
However, you have reminded me that indeed this would probably not work because of all the tracking required to prevent the Mad Swine Pox and so on.