Hi Anil,
I've worked on such self loops on DSOs. When it comes to infocube I believe we need to create two internal tables in the start routine / end routine say with the structure same as SOURCE_PACKAGE. To one internal table we should append the original record as it is but multiplied by -1 for all its key figures (sign change). To another internal table we need to populate the original record with the looked up value for the new keyfigure / characteristics. Finally we need to modify the source_package from the two internal tables. Or just append the records from these two internal tablees into infocube data. So now the infocube has
a. original record,
b. another record which is the same as original record with all key figures negative, and
c. one more record which is the original record with the new infoobject holding historical value.
The original record will get negated. Give these ideas to an ABAPer and he/she will be able to jot down a performance friendly code in no time.
Again, I'm just providing an idea here, I have not implemented such logic on infocubes. But I'm pretty sure this will work
Hope this helps. Do let us know how you got it to work.
Thanks,
Manohar. D