In the last post RFC Calls: Function Module Parameter Passing , we have seen how system take care of the obligatory parameters even though the calling program doesn’t pass it to the RFC FM.
Why does system needs to do that: Error handling. RFC FM can be called from outside SAP application also. If we don’t pass the obligatory parameters, it would lead to runtime error of the missing obligatory parameters CALL_FUNCTION_PARM_MISSING. It could lead SAP System to errorenous status. It could become severe when we are dealing with the LUW – COMMIT WORK and ROLLBACK WORK.
This would raise an question: how do the programmer will design his code to make sure he got all the obligatory parameters filled in?
The simple solution would be: Create all the parameters as optional. Check all the parameters in the code with addition IF field IS NOT SUPPLIED and fill the return table with proper messages. This would notify the calling system that it didn’t pass the obligatory parameters to execute the requested Function Module.
More reading on RFCs:
SAP Help – RFC
Master of the Five Remote Function Call (RFC) in ABAP