Hi Vishnu,
Why you need FM?
Are you going to reuse this FM in more than one program.
Fetch the data from the respective infotype which has endda 31.12.9999.
Loop Pa0000 and read the other infotypes with key fields and pass it to workarea.
Then append the workarea to final internal table.
With Regards,
Giriesh M