04-05-2012 1:58 PM
The function module ‘ISU_MR_ORDER_PREPARE’ is supposed to return the meter reading orders according to input parameters set.
Only when the meter reading orders are read successfully sy-subrc value is to 0.
However for some reason this function module is setting sy-subrc value to zero even when no meter reading orders are fetched.
Is it a bug in FM?
04-05-2012 2:16 PM
It appears to me that you need to act upon sy-subr > 0, and if it's zero, you need to look at the tables returned and decide what to do. By supplying a set of parameters that are initial and blank tables, I'd expect zero return code and the same empty table. Does the program check for available input before it calls the FM?
04-05-2012 2:16 PM
It appears to me that you need to act upon sy-subr > 0, and if it's zero, you need to look at the tables returned and decide what to do. By supplying a set of parameters that are initial and blank tables, I'd expect zero return code and the same empty table. Does the program check for available input before it calls the FM?
04-06-2012 12:21 PM
Yes the program checks for availability of input parameters.
When there are no meter reading orders which match the criteria it should ideally
set sy-subrc value to zero.
But I see sy-subrc value is set to zero even when no meter reading orders are returned.
I have gone through FM but could not figure out why it would set sy-subrc to zero even when no Meter reading orders are found.
04-06-2012 12:47 PM
"However for some reason this function module is setting sy-subrc value to zero even when no meter reading orders are fetched" - It's not documented any where that this function will return subrc <> 0 if it doesn't match you condition.
Better check for available BAPI's for same operation, which itself has a return parameter.