‎2013 May 22 10:28 AM
Hi All,
I have called a Bapi inside a program. In this Bapi there are no Exceptions maintained.
Thus when I check my program through Code Inspector it throws an error stating EXCEPTION specification that sets the SY-SUBRC Thus the value of SY-SUBRC is always 0.
Call to FM is as follows,
CALL FUNCTION 'BAPI_USER_GETLIST'
EXPORTING
* MAX_ROWS = 0
with_username = lv_user
* IMPORTING
* rows =
TABLES
* SELECTION_RANGE =
* SELECTION_EXP =
userlist = lt_user
* RETURN
Please tell me how to tackle this error as i cannot add exception in the Standard Bapi.
‎2013 May 22 10:45 AM
CALL FUNCTION 'BAPI_USER_GETLIST'
EXPORTING
* MAX_ROWS = 0
with_username = lv_user
* IMPORTING
* rows =
TABLES
* SELECTION_RANGE =
* SELECTION_EXP =
userlist = lt_user
* RETURN
EXCEPTIONS
others = 0.
‎2013 May 22 10:45 AM
CALL FUNCTION 'BAPI_USER_GETLIST'
EXPORTING
* MAX_ROWS = 0
with_username = lv_user
* IMPORTING
* rows =
TABLES
* SELECTION_RANGE =
* SELECTION_EXP =
userlist = lt_user
* RETURN
EXCEPTIONS
others = 0.
‎2013 May 23 12:56 PM
‎2013 May 22 10:59 AM
hi,
if it is standard bapi then u can ignore such error by adding
"#EC at end of error point and proceed the code inspector will hide such errors.
‎2013 May 22 11:00 AM
Hi,
I do agree with above post.
Add exceptions as others = 0 / 1/ 2, as explained above.
if you are using,
Exceptions
Others = 1.
that means your sy-subrc will be 1 when you are catched with exception.
‎2013 May 22 11:05 AM
‎2013 May 22 11:09 AM
Which version of ABAP are you working on?
BAPIs don't have exceptions and you do not need to handle them as well. No sure why CI is throwing this error? Can you share the screenshot of your Code Inspector?
BR,
Suhas
‎2013 May 22 11:13 AM
Code inspector depends on how its rules are configured. It sometimes gets it wrong. Unfortunately, some quality teams fail to understand this.
‎2013 May 22 11:11 AM
Hi ,
If you are referring to the Extended Code Checks then you can suppress this message
by using pragma ##FM_SUBRC_OK (or pseudo comment "#EC FB_RC).
There is no harm in implementing this and this message can be ignored . This is just an information that even if you verify sy-subrc it will always be 0.
Thanks and Regards,
Sriranjani Chimakurthy.
‎2013 May 22 11:13 AM
Hi,
Are you checking sy-subrc after the FM call may be thats why the message comes in extended check. indicating that its a redundant sy-subrc check as it has no exceptions.
Cheers,
Arindam
‎2013 May 22 1:34 PM
You might be checking sy-subrc after function module call.
since BAPI's don't have exceptions you no need to check sy-subrc value, instead of that check
RETURN parameter of bapi and give messages accordingly.
call function 'BAPI_USER_GETLIST'
..
..
if lt_return[] is not initial.
loop lt_return ....
.......
endloop.
endif.
‎2013 May 29 3:06 PM