2008 Aug 07 7:18 AM
Dear all,
I have an error when excuting a sql statement in SAP ABAP.
When i debug and find sy-subrc is set to '2'.
Who can tell me what is meaning for 'SY-SUBRC = 2'?
Best Regards,
Steven Liu
Dear all,
I have an error when excuting a sql statement in SAP ABAP.
When i debug and find sy-subrc is set to '2'.
Who can tell me what is meaning for 'SY-SUBRC = 2'?
Best Regards,
Steven Liu
2008 Aug 07 7:21 AM
Well that depends on the statement you are executing.
Do a F1 help on that statement, in the help documentation you should find the cause of sy-subrc = 2.
2008 Aug 07 11:46 AM
Hi,
sy-subrc returns the value 2 mean, If the system cannot find an entry.
SY-SUBRC = 2 Source code table (internal table) is empty or a blank line range was selected..
regards
Thirumaran k
2008 Aug 07 11:56 AM
Kindly check the additions FROM and TO .(there was some error was there)
regards
Thirumaran k
2008 Aug 07 11:58 AM
Hi Steven Liu,
Please go through the link ,
http://www.sapbrainsonline.com/sapinfo/tutorial.php?artid=410
Regards,
Sreekar.Kadiri
2012 Sep 05 9:37 AM
DATA: BEGIN OF LINE,
COL1 TYPE I,
COL2 TYPE I,
END OF LINE.
DATA ITAB LIKE HASHED TABLE OF LINE WITH UNIQUE KEY COL1.
DO 4 TIMES.
LINE-COL1 = SY-INDEX.
LINE-COL2 = SY-INDEX **
2.
INSERT LINE INTO TABLE ITAB.
ENDDO.
LINE-COL1 = 2. LINE-COL2 = 3.
READ TABLE ITAB FROM LINE INTO LINE COMPARING COL2.
WRITE: 'SY-SUBRC =', SY-SUBRC.
SKIP.
WRITE: / LINE-COL1,
LINE-COL2.
The output is:
SY-SUBRC = 2
2 4
The program fills a hashed table with a list of square numbers. The work area
LINE, which is compatible with the line type, is filled with the numbers 2 and
3. The READ statement reads the line of the table in which the key field COL1
has the same value as in the work area and copies it into the work area.
SY-SUBRC is set to 2, because the contents of field COL2 were different.
this might helps...
also try this
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb35f8358411d1829f0000e829fbfe/content.htm
2013 May 01 3:38 PM