Dear Sagar
We use this function module also to do some data preparation before the actual mapping. For my experience we do not have similar issues. Could it be that your inbound IDOC is not being processed with the AIF runtime?
Michal Krawczyk wrote a nice blog entry about how to configure that: Michal's tips: Application Interface Framework (AIF) - IDOC processing with AIF actions
Kind regards
Thimo