German chemicals company Merck KGaA is considering shedding its generics business, which could fetch 4 billion euros ($5.2 billion).