I am using this FM 'MATERIAL_MAINTAIN_DARK' to create/change material on a certain target system by extracting the information from a certain source system and calling an RFC FM which eventually calls MATERIAL_MAINTAIN_DARK.
Case1: Creating material, only basic data. Here field AMARA_UEB-TCODE = MM01. This case works fine.
Case2: Material is changed (in basic data) and extended to a new plant.
Here if I give AMARA_UEB-TCODE = MM01, then change will not be reflected on the target system. But plant extension is done.
If I give AMARA_UEB-TCODE = MM02, then the change in basic data will reflect but plant extension will not be done.
So I will have to make 2 calls. One for create and one for change.
Case3: Further variations of case2 where Sales views, Valuation views Storage views are created and changed. Here it becomes really hard to have multiple calls for each views create and change functionalities.
Is there a better way to handle this?
P.S. 1. I have read the FM documentation and there it says to group logically related operations. But nothing is available about the problem stated above.
2. Using BAPI is not an option.