RFC Calls II – Solution to mandatory Parameters to FM

By | April 20, 2009 | Function Module | 5,404 | 0

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

Like It? Share!!

Don't miss an Update

Get notified of the new post, right into your inbox

Naimesh Patel{274 articles}

I'm SAP ABAP Consultant for more than a decade. I like to experiment with ABAP especially OO. I have been SDN Top Contributor.
Follow :

Explore all of his 274 articles.

Load comments

Comments on this Post are now closed. If you have something important to share, you can always contact me.

You seem to be new here. Subscribe to stay connected.