Hi Rajvansh,
You can submit function module by RFC starting with "starting new task" statement. This is the way to call function in remote or current system and it is possible to retrieve results back here. This is asynchronous call, so new dialog process is made and current program is still running. However you can stop program until the response comes back from call. Results are retrieved by callback function, like mark_calc_finished as in this case. This statement can be even used for parallel processing if you want to control many tasks in parallel. Example syntax:
CALL FUNCTION 'ZCUSTOM_PROGRAM' DESTINATION 'NONE' " None works on current server STARTING NEW TASK gv_task_name PERFORMING mark_calc_finished ON END OF TASK EXPORTING it_item_guids = gt_calc_guids EXCEPTIONS COMMUNICATION_FAILURE = 1 MESSAGE l_rfc_error_msg SYSTEM_FAILURE = 2 MESSAGE l_rfc_error_msg RESOURCE_FAILURE = 3.
Useful example:
http://scn.sap.com/docs/DOC-31024
Regards,
Adam