IMPORTANT SYSTEM VARIABLES Used in SAP ABAP :
IMPORTANT SYSTEM VARIABLES IN SAP ABAP :
A).SY-MANDT - Client number of the user logged on with, for example 000, 400.For database accesses with Open SQL, SY-MANDT is used as the first key field of the WHERE clause.
B).SY-LANGU - One-digit language key, for example D, E, F.Either logon language of user or set using the SET LOCALE LANGUAGE statement.
C).SY-UNAME- Logon name of user, for example KELLERH, BC400-01.
D).SY-DATLO- Local date of user, for example 19981129, 19990628.
E).SY-DATUM- Current (application server) date, for example 19981130, 19990627.
F).SY-TIMLO- Local time of user, for example 154353, 225312.
G).SY-TZONE- Time difference to Greenwich Mean Time (UTC) in seconds, for example 3600, 10800.
H).SY-CALLD- SY-CALLD contains SPACE if the program is the first and only program in a call chain.SY_CALLD contains 'X' if the program is a called program in a call chain.
· a).SY-CALLD is set to ‘X‘ in a program called using CALL TRANSACTION, CALL DIALOG, or SUBMIT … AND RETURN.
· b).SY-CALLD is set to space in a program called using LEAVE TO TRANSACTION, entering a transaction code on a screen, and processing batch input folders.
· c).With SUBMIT (without RETURN) SY-CALLD retains the previous value.
I).SY-DYNNR- Number of current screen During the selection screen processing,SY-DYNNR contains the screen number of the current selection screen.During list processing,SY-DYNNR contain the number of the container screen.Whileasubscreenisbeing processed,SY-DYNNR contains its screen number.This also apply to tabstrips.
J).SY-TCODE- Name of current transaction code.
K).SY-BATCH- SY-BATCH is set to X in an ABAP program running in the background. Otherwise it is empty.
L).SY-ULINE- Contains a horizontal line with length 255.Can be used when creating the list.
M).SY-VLINE- Contains a vertical line (|).Can be used when creating the list.
N).SY-INDEX- SY-INDEX contains the number of loop passes in DO and WHILE loops, including the current loop pass.
O).SY-TABIX- Current line in an internal table.With the following statements SY-TABIX is set for index tables.With hashed tables,SY-TABIX is not filled or it is set to 0.
· a).APPEND sets SY-TABIX to the index of the last table row,that is the total number of entries in the target table.
· b).COLLECT sets SY-TABIX to the index of the existing or appended table row.With hashed table,SY-TABIX is set to 0.
· c).LOOP AT set SY-TABIX to the index of the current table row at the beginning of every loop pass.After leaving aloop,SY-TABIX is set to the value it had beforeenteringtheloop.With hashed table, SY-TABIX is set to 0.
· d).READ TABLE sets SY-TABIX to the index of the table row read.If no row is found with binary search while reading,SY-TABIX contains the index of the next highest row or the total number of rows +1.If no row is found with linear search while reading, SY-TABIX is undefined.
· e).SEARCH itab FOR sets SY-TABIX to the index of the table row, in which the search string was found.
P).SY-DBCNT- SQL statements set the content of SY-DBCNT to the number of database lines processed.With SELECT loops in Open SQL, SY-DBCNT is set after the ENDSELECT statement.In Native SQL, SY-DBCNT is set after the ENDEXEC statement.
· a).DELETE sets SY-DBCNT to the number of lines deleted.
· b).FETCH sets SY-DBCNT to the number of lines already read by the current cursor.
· c).INSERT sets SY-DBCNT to the number of lines inserted.
· d).MODIFY sets SY-DBCNT to the number of lines processed.
· e).UPDATE sets SY-DBCNT to the number of lines changed.
Q).SY-SUBRC- Return value set by the following ABAP statements.In general, a content of 0 means that the statement was executed without problems.
· a).ASSIGN sets SY-SUBRC to 0 if assignment to field symbol is possible, otherwise 4.
· b).ASSIGN dref->* sets SY-SUBRC to 0 if dereferencing is possible, otherwise 4.
· c).AUTHORITY-CHECK sets SY-SUBRC to 0 if the user has the necessary authorization, otherwise 4, 8, 12, 16, 24, 28, 32, or 36 depending on the cause.
· d).CALL DIALOG with USING sets SY-SUBRC to 0, if processing was successful, otherwise <>0.
· e).CALL FUNCTION sets SY-SUBRC according to the exception handling.
· f).CALL METHOD sets SY-SUBRC according to the exception handling.
· g).CALL SELECTION-SCREEN sets SY-SUBRC to 0 if the user chose Enter or Execute and 4 if the user chose Cancel.
· h).CALL TRANSACTION with USING sets SY-SUBRC to 0 if processing was successful, otherwise <>0.
· i).CATCH SYSTEM-EXCEPTIONS sets SY-SUBRC if there are runtime errors after the ENDCATCH statement.The value is specified in the program.
· j).COMMIT WORK sets SY-SUBRC to 0.
· k).COMMIT WORK AND WAIT sets SY-SUBRC to 0 if update was successful, otherwise <>0.
· l).COMMUNICATION INIT DESTINATION … RETURNCODE sets SY-SUBRC as specified.
· m).CONCATENATE sets SY-SUBRC to 0 if the result fits into target variable, otherwise 4.
· n).CREATE OBJECT sets SY-SUBRC if the exceptions of the instance constructor are handled.
· o).CREATE OBJECT in OLE2 sets SY-SUBRC to 0 if an external object was created, otherwise 1,2, 3 with different causes.
· p).DELETE sets SY-SUBRC to 0 if operation was successful, otherwise 4 or <> 0 depending on cause.
· q).DEMAND … MESSAGES INTO sets SY-SUBRC to 0 if a message table is empty, otherwise <> 0.
· r).DESCRIBE LIST sets SY-SUBRC to 0 if row or list exists, otherwise 4 or 8.
· s).EXEC SQL - ENDEXEC sets SY-SUBRC to 0 in almost all cases.Only if no set was read with FETCH is SY-SUBRC 4.
· t).FETCH sets SY-SUBRC to 0 if at least one row was read, otherwise 4.
· u).GENERATE SUBROUTINE POOL sets SY-SUBRC to 0 if generation was successful, otherwise 8.
· v).GET CURSOR sets SY-SUBRC to 0 if the cursor is correctly positioned, otherwise 4.
· w).GET PARAMETER sets SY-SUBRC to 0 if value found in SAP Memory, otherwise 4.
· x).IMPORT sets SY-SUBRC to 0 if import of data objects was successful, otherwise 4.
· y).INSERT sets SY-SUBRC to 0 if operation was successful, otherwise 4.
· z).LOAD REPORT sets SY-SUBRC to 0 if operation was successful, otherwise 4 or 8 depending on cause.
· aa).LOOP sets SY-SUBRC to 0 if loop over extract was passed at least once, otherwise 4.
· ab).LOOP AT sets SY-SUBRC to 0 if loop over internal table was passed at least once, otherwise 4.
· ac).MODIFY sets SY-SUBRC to 0 if operation was successful, otherwise 4.
· ad).MODIFY LINE sets SY-SUBRC to 0 if list row was changed, otherwise <> 0.
· ae).MODIFY sets SY-SUBRC to 0 if operation was successful, otherwise 4.
· af).OLE2 automation, bundled commands set SY-SUBRC to 0 if all were successfully executed, otherwise 1, 2, 3, 4 depending on cause.
· ag).OPEN DATASET sets SY-SUBRC to 0 if the file was opened, otherwise 8.
· ah).Open SQL commands set SY-SUBRC to 0 if operation was successful, otherwise <>0.
· ai).OVERLAY sets SY-SUBRC to 0 if at least one character is overlayed, otherwise 4.
· aj).READ DATASET sets SY-SUBRC to 0 if the read operation was successful, otherwise 4 or 8 depending on cause.
· ak).READ LINE sets SY-SUBRC to 0 if list row exists, otherwise <> 0.
· al).READ TABLE sets SY-SUBRC to 0 if the table row was found, otherwise 2, 4, 8 depending on cause.
· am).REPLACE sets SY-SUBRC to 0 if search string could be replaced, otherwise <> 0.
· an).ROLLBACK WORK always sets SY-SUBRC to 0.
· ao).SCROLL sets SY-SUBRC to 0 if scrolling in list successful, otherwise 4 or 8 depending on cause.
· ap).SEARCH sets SY-SUBRC to 0 if search string was found, otherwise 4.
· aq).SELECT sets SY-SUBRC to 0 if at least one row was read, otherwise 4 or even 8 with SELECT SINGLE FOR UPDATE.
· ar).SET COUNTRY sets SY-SUBRC to 0 if country ID was found in table T005X, otherwise 4.
· as).SET BIT sets SY-SUBRC to 0 if bit was set, otherwise <> 0.
· at).SET TITLEBAR sets SY-SUBRC to 0 if title exists, otherwise 4.
· au).SHIFT … UP TO sets SY-SUBRC to 0 if position was found in character string, otherwise 4.
· av).SPLIT sets SY-SUBRC to 0 if size of target fields is sufficient, otherwise 4.
· aw).UPDATE sets SY-SUBRC to 0 if operation successful, otherwise 4.
· ax).WRITE … TO sets SY-SUBRC to 0 if assignment successful, otherwise 4.
R).SY-UCOMM- Function code that triggered the event PAI.Every user action that triggers PAI is assigned a unique function code, with one exception:Choosing ENTER triggers PAI and different function codes can be transferred to SY-UCOMM:
· a).If there is an entry in the command field of the standard toolbar, this is transferred to SY-UCOMM as the function code.
· b).If there is no entry in the command field and a function code is assigned to the ENTER key, this function code is transferred to SY-UCOMM.
· c).If the command field does not contain an entry and no function code is assigned to the ENTER key, it is empty and the content of SY-UCOMM is not affected.
S).SY-LINCT- Page length of list.SY-LINCT is 0 for a standard list of any length and has a value unequal to 0 for lists with fixed page length.
· a).LINE-COUNT in the statements REPORT, PROGRAM, FUNCTION POOL sets SY-LINCT for the current program.
· b).LINE-COUNT in the SUBMIT statement sets SY-LINCT for the called program.
T).SY-LINNO- Current row during the list creation.Counting begins at 1 and includes the page header.SY-LINNO is set by the following output statements:
· a).WRITE, ULINE, SKIPraise SY-LINNO by 1 in the case of a line break.
· b).BACK sets SY-LINNO to the first row after the page header.BACK in connection with RESERVE sets SY-LINNO to the first row of a block of lines.
· c).NEW-LINE raises SY-LINNO by 1.
· d).SKIP TO LINE lin sets SY-LINNO to lin.If lin does not lie between 1 and the page length, the system ignores the statement.
U).SY-LINSZ- Line width of list Without further influence this is the standard window width: If SY-SCOLS >= 84, SY-LINSZ = SY-SCOLS; if SY-SCOLS < 84, SY-LINSZ = 84.
To change the width of the output list, use the LINE-SIZE option of the REPORTor NEW PAGE statement.
· a).LINE-SIZE in the statements REPORT, PROGRAM, FUNCTION POOL sets SY-LINSZ for the current program.
· b).LINE-SIZE in the SUBMIT statement sets SY-LINSZ for the called program.
Comments
Post a Comment
If you have any doubts let me know