2006 Dec 15 5:59 AM
Call Function Z_function.
Imports
Exports
EXCEPTIONS
no_entry_found = 1
OTHERS = 2
IF sy-subrc = 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Suppose
if sy-subrc = 1.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
Giving me popup and is troubling.
Could you please tell me if I comment below
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4....
and proceed will it effect me in case of sy-subrc <> 0.
Thank you
2006 Dec 15 6:01 AM
No it will not affect in any way. You can put a generric error sayign that
If sy-subrc NE 0.
Write : 'ERROR'.
endif.
- Guru
Reward points for helpful answers
2006 Dec 15 6:03 AM
Hi !
If you'll comment the MEESAGE-Line the sy-subrc <> 0 will not have any efect to your program. But are you sure you want that... ?!?
If you want to be sure not hat have any bad effects in later following lines if sy-subrc is still <> 0 set the SY-SUBRC = 0 after the call function.
Regards
Rainer
Some points would be nice if that helped.
2006 Dec 15 6:04 AM
Hi,
Just goto the function module and see what kind of error message it is displaying if sy-subrc = 1.
if its information message popping up than you can comment..not an issue
but in case of warning or error message it will effect.
Regards,
pankaj singh
<i><b>**** reward if helpful</b></i>
2006 Dec 15 6:04 AM
Hello Sam,
There is no issue if u comment. I beleive it is for handling more specific error and sending out proper msg. Ignoring it in that case detecting an error will be a problem.
2006 Dec 15 6:21 AM
Hi Sam,
Yes you can. But some times the programs emphasises specific program errors.
For e.g.
Use the following code for function module for GENEREIC case.
In this case you can remove total piece of code suggested by you. and replace the following code.
If sy-subrc ne 0.
Messae 'Error in function module' Type 'E'.
Endif.Use the following code for function module for SPECIFIC case.
case sy-subrc.
when '1'.
Message 'No_entry found' type 'E'.
when '2'.
Message 'Undetermined error in Function module. Please contact system administrator' Type 'E".
Endcase.Regards
Bhupal Reddy