Hi Rajan,
In your RFC (Custom RFC) In the exceptions of the FM L_TO_CREATE_POSTING_CHANGE add another parameter error_message = 38. The error_message will hold the return value which is getting created in your program.
CALL FUNCTION L_TO_CREATE_POSTING_CHANGE
....
EXCEPTIONS
error_message = 38.
Regards,
Narayanan