08-20-2007 8:43 AM
when we reading the data from application server, we r checking the conditoin like
sy_subrc...
y we are checking the condition?
can anybody explain about this ?
Reagards,
swathi.
08-20-2007 8:48 AM
Hi,
How are you reading the Data from the application server?
Suppose that you are using a Funcion module call to read the data then
For that function module call you will have some Exceptions listed with a number assigned for each exception.
The function module when called, raises an exception then the number that you assign to that exception will be stored in SY-SUBRC.
SO you need to check SY-SUBRC to see if the function module call is succesful in which case the value of SY-SUBRC will be 0 else it will be the number of the exception that is raised by the Function module.
There are many statements that effect SY-SUBRC, so after a statement if your code has a check for SY-SUBRC then assume that you are checking if the previous statement was sucessful or not.
To see the complete list of commands that effect SY-SUBRC use transaction "ABAPDOCU" and goto "Appendix" there.
Regards,
Sesh
08-20-2007 8:48 AM
Hi,
How are you reading the Data from the application server?
Suppose that you are using a Funcion module call to read the data then
For that function module call you will have some Exceptions listed with a number assigned for each exception.
The function module when called, raises an exception then the number that you assign to that exception will be stored in SY-SUBRC.
SO you need to check SY-SUBRC to see if the function module call is succesful in which case the value of SY-SUBRC will be 0 else it will be the number of the exception that is raised by the Function module.
There are many statements that effect SY-SUBRC, so after a statement if your code has a check for SY-SUBRC then assume that you are checking if the previous statement was sucessful or not.
To see the complete list of commands that effect SY-SUBRC use transaction "ABAPDOCU" and goto "Appendix" there.
Regards,
Sesh
08-20-2007 8:58 AM
08-20-2007 9:00 AM
thank u for your reply Sesh..
This is by using bdc..
Regards,
swathi
08-20-2007 9:01 AM
Hi,
Then you must be using CALL TRANSACTION and this statement will set SY-SUBRC.
So in you case
CALL TRANSACTION with USING sets SY-SUBRC to 0 if processing was successful, otherwise <>0.
Hope this was helpful
Regards,
Sesh
08-20-2007 10:16 AM
Hi.. Swathi..
To Open a file On Application Server we have the Commands.
We must check the SY-SUBRC to know whether a particular operation is successful.
Eg:
OPEN DATASET V_DSN FOR INPUT IN TEXT MODE ENCODING DEFAULT.
<b>IF SY-SUBRC NE 0. "TO CHECK FILE IS OPENED/EXISTS</b> Message 'File Not Opened' Type 'E'.
Endif.
Do.
Read dataset v_dsn into wa.
<b> IF SY-SUBRC NE 0. "To check END OF FILE</b>
EXIT.
ENDIF.
ENDDO.
<b>Reward if Helpful</b>
08-20-2007 8:49 AM
Hi Swathi
sy-subrc is for checking the result
if it is zero means successful
is this is ur req?
reward points to all helpful answers
kiran.M