Skip to Content
author's profile photo
Former Member

sy_subrc

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.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    Posted on Aug 20, 2007 at 07: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

    Add comment
    10|10000 characters needed characters exceeded

    • 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>

  • author's profile photo
    Former Member
    Posted on Aug 20, 2007 at 07: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

    Add comment
    10|10000 characters needed characters exceeded