This needs to be done at the BW transformation and it needs to be done for each incoming record.
So RFC enabled FM will not help as it is going to be performance intensive. I am trying to create the same FM in BW with necessary structure and includes, will let you know once it works. Thanks.