Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Interactive Reports System Fields examples

Former Member
0 Likes
1,712

Hi all,

Can any body please send me examples for System fields I know Sy-lsind, sy-lisel can any body send me the examples for others

Thanks in advance

Ranjith

5 REPLIES 5
Read only

Former Member
0 Likes
1,229

HI Ranjith,

<b>SY-CPAGE</b>

Page number of the first displayed page of the list from which the event was triggered. Counting starts at 1

<b>

SY-LILLI</b>

Line from which the event was triggered Counting begins at 1 and includes the page header.

<b>

SY-LISEL</b>

Contents of the line from which the event was triggered

<b>SY-LISTI</b>

Index of the list from which the event was triggered

<b>SY-LSIND</b>

Index of the list that is being created (basic list: 0, detail list > 0). Each time an interactive list event occurs, the system automatically increases SY-LSIND by 1. SY-LSIND can be changed in the ABAP program to navigate between detail lists. Changes to SY-LSIND are not taken into account until the end of the list event. Therefore, any manipulation of SY-LISND should be done using the last command of the processing block.

<b>

SY-LSTAT</b>

ID for list levels within the program. SY-LSTAT can be filled with values during list creation in the ABAP program. The value valid when the list is completed is saved with the list. In the case of an interactive list event, SY-LSTAT is set to the value it was assigned during the creation of the list from which the event takes place. SY-LSTAT is no longer maintained and should therefore no longer be used.

<b>SY-STACO</b>

Number of the first displayed column of the list from which the event was triggered. Counting starts at 1.

<b>SY-STARO</b>

Number of the upper-most displayed row of the upper-most page of the list, from which the event was triggered. Counting begins at 1. This does not include the page header.

Regards

Sudheer

Read only

0 Likes
1,229

Hi Sudeer,

Thanks for ur answer,Can you please send me the examples for those syatem Fields

Thanks in Advance

Ranjith

Read only

Former Member
0 Likes
1,229

Goto Table

SYST

, you can find all the system fields.

Screens
Screens
System fields are set at the PAI event for every screen. These can be also used for interactive list processing, except for SY-DATAR, SY-LOOPC, and SY-STEPL.

SY-CUCOL
Horizontal cursor position Counting starts at column 2

SY-CUROW
Vertical cursor position Counting starts at row 1

SY-DATAR
Set to X at time of PAI if at least one screen input field was changed by the user or other data transfer, otherwise empty.

SY-LOOPC
Number of rows currently displayed in a screen table (table control).

SY-PFKEY
GUI status of current screen. Can be set at PBO using SET PF-STATUS.

SY-SCOLS
Number of columns in current screen.

SY-SROWS
Number of rows in current screen.

SY-STEPL
Index of current row in a screen table (table control). Is set at every loop pass. Outside a loop, for example during the POV event for a table row, SY-STEPL is not set appropriately.

SY-TITLE
Text that appears in the title bar of the screen. For selection screens and lists this is the program name, otherwise SAP. Can be set during PBO using SET TITLEBAR.

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:

· If there is an entry in the command field of the standard toolbar, this is transferred to SY-UCOMM as the function code.

· 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.

· If the command field does not contain an entry and no function code is assigned to the ENTERkey, it is empty and the content of SY-UCOMM is not affected.

Selection Screens
SY-SLSET
Variant used to fill the selection screen.

Creating Lists
When creating a list you can use the following system fields to navigate. They help to ensure that output statements do not overwrite any existing output and that the system does not try to write outside the list. The current output position is always in the system fields SY-COLNO and SY-LINNO and is rest for every output statement. The remaining system fields contain further values for the list creation.

SY-COLNO
Current column during list creation. Counting starts at 1. SY-COLNO is set by the following output statements:

· WRITE, ULINE, SKIPset SY-COLNO to the next output position.

· BACKsets SY-COLNO to 1.

· POSITION col sets SY-COLNO to col. If collies outside the page, the subsequent output statements are ignored.

· NEW-LINE sets SY-COLNO to 1.

· NEW-PAGE sets SY-COLNO to 1.

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.

· LINE-COUNT in the statements REPORT, PROGRAM, FUNCTION POOL sets SY-LINCT for the current program.

· LINE-COUNT in the SUBMIT statement sets SY-LINCT for the called program.

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:

· WRITE, ULINE, SKIPraise SY-LINNO by 1 in the case of a line break.

· BACK sets SY-LINNO to the first row after the page header. BACKin connection with RESERVE sets SY-LINNO to the first row of a block of lines.

· NEW-LINE raises SY-LINNO by 1.

· 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.

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.

· LINE-SIZE in the statements REPORT, PROGRAM, FUNCTION POOL sets SY-LINSZ for the current program.

· LINE-SIZE in the SUBMIT statement sets SY-LINSZ for the called program.

SY-PAGNO
Current page during the list creation.

· WRITE, ULINE, SKIPraise SY-PAGNO by 1 in the case of a line break.

· NEW-PAGE raises SY-PAGNO by 1, but only if at least one output follows both on the current page and after the NEW-PAGE statement.

· NEW-SECTION of the NEW-PAGE PRINT ON statement sets SY-PAGNO to 1.

SY-TVAR0 ... SY-TVAR9
In the program, you can assign values to these system fields. During the TOP-OF-PAGE event, the system replaces the placeholders of the program’s list and column headers with the contents of the system fields SY-TVAR0 to SYTVAR9.

SY-WTITL
Is set to N in the statements REPORT, PROGRAM, and FUNCTION-POOLif the NO STANDARD PAGE HEADING addition is used, otherwise empty. NEW-PAGE does not set SY-WTITL.

List Processing
At each interactive list event and for READ LINE, the system automatically fills the following system fields:

SY-CPAGE
Page number of the first displayed page of the list from which the event was triggered. Counting starts at 1

SY-LILLI
Line from which the event was triggered Counting begins at 1 and includes the page header.

SY-LISEL
Contents of the line from which the event was triggered

SY-LISTI
Index of the list from which the event was triggered

SY-LSIND
Index of the list that is being created (basic list: 0, detail list > 0). Each time an interactive list event occurs, the system automatically increases SY-LSIND by 1. SY-LSIND can be changed in the ABAP program to navigate between detail lists. Changes to SY-LSIND are not taken into account until the end of the list event. Therefore, any manipulation of SY-LISND should be done using the last command of the processing block.

SY-LSTAT

ID for list levels within the program. SY-LSTAT can be filled with values during list creation in the ABAP program. The value valid when the list is completed is saved with the list. In the case of an interactive list event, SY-LSTAT is set to the value it was assigned during the creation of the list from which the event takes place. SY-LSTAT is no longer maintained and should therefore no longer be used.

SY-STACO

Number of the first displayed column of the list from which the event was triggered. Counting starts at 1.

SY-STARO

Number of the upper-most displayed row of the upper-most page of the list, from which the event was triggered. Counting begins at 1. This does not include the page header.

Printing Lists

When printing lists, the spool and runtime systems require certain internal information, which is available in the following system fields and is set during print activation.

SY-CALLR

Contains a value that displays where printing was started, for example NEW-PAGE for program-controlled printing or RSDBRUNT for printing from the selection screen.

SY-PRDSN

Contains the name of the spool file during printing.

SY-SPONO

Contains the name of the spool number during printing.

SY-MAROW, SY-MACOL

The SET MARGINstatement fills the system fields SY-MAROW and SY-MACOL, which determine the number of lines on the upper margin and the number of columns on the left margin when printing.

Print Parameters

The print parameters are transferred to the spool system by the runtime system in a structure of dictionary type PRI_PARAMS. Before this structure was used, its purpose was served by system fields. Today a subset of the PRI_PARAMS structure is still written to system fields with the same names when printing is activated. This information is redundant and should not be used.

Messages

If you execute the MESSAGE statement, the following system fields are set. If you execute the MESSAGE … RAISING statement in function modules and methods, these fields are also set in the calling program, if it handles the exception.

SY-MSGID

SY-MSGID contains the message ID.

SY-MSGNO

SY-MSGNO contains the message number.

SY-MSGTY

SY-MSGTY contains the message type.

SY-MSGV1,…,SY-MSGV4

SY-MSGV1 to SY-MSGV4 contain the field contents that are used for the message’s placeholders.

Special Actions that Fill Message Fields

· If you request database locks using the ENQUEUE function module, the field SY-MSGV1 contains the name of the user who holds the lock, in the case of the FOREIGN_LOCK exception.

· IN the case of CALL TRANSACTION or CALL DIALOG with the USING addition, a message displayed during the called screen sequence is returned in the fields SY-MSGID, SY-MSGTY, SY-MSGNO, SY-MSGV1, ... , SY-MSGV4.

· During Remote Function Call (RFC), error messages are transferred from the remote system to the calling system and SY-MSGID, SY-MSGTY, SY-MSGNO,SY-MSGV1, SY-MSGV2, SY-MSGV3, SY-MSGV4 are set. If short dumps or type X messages occur, the system also sets the fields.

Internal system fields

Internal system fields are only for internal use in the ABAP runtime environment and are defined in the kernel. Under no circumstances must they be overwritten in ABAP programs and they should also not be read (processed).

SY-CFWAE

Undocumented

SY-CHWAE

Undocumented

SY-DEBUG

Undocumented

SY-DSNAM

Name of spool output file.

SY-ENTRY

Undocumented

SY-FFILE

Flat file (USING/GENERATING DATASET).

SY-FLENG

Length of a field.

SY-FODEC

Number of decimal places of a field.

SY-FOLEN

Output length of a field.

SY-FTYPE

Data type of a field.

SY-GROUP

Bundling

SY-INPUT

Undocumented

SY-LPASS

Undocumented

SY-NEWPA

Undocumented

SY-NRPAG

Undocumented

SY-ONCOM

On Commit flag. This system field is set to different values depending on the call status of an ABAP program. Of these, only the value of ‘P’ is guaranteed. If at all, SY-ONCOM must only be queried for ‘P’.

The value 'P' means that the program is already executing a subroutine started using PERFORM … ON COMMIT and therefore a further subroutine call using PERFORM ... ON COMMIT would cause a runtime error.

SY-PAUTH

Undocumented

SY-PLAYO

Undocumented

SY-PLAYP

Undocumented

SY-PNWPA

Undocumented

SY-PRI40

Undocumented

SY-PRINI

Undocumented

SY-PRLOG

Undocumented

SY-REPI2

Undocumented

SY-RSTRT

Undocumented

SY-SFOFF

Undocumented

SY-SUBCS

Call status of an executable program.

SY-SUBTY

Call type of an executable program.

SY-TABID

Undocumented

SY-TLOPC

Undocumented

SY-TSTIS

Undocumented

SY-XCODE

Extended function code Is filled, like SY-UCOMM, by user actions on lists. Before the length of SY-UCOMM was increased from 4 to 70 characters, SY-XCODE was used internally to evaluate lengthy entries in the command field of the list’s standard toolbar. Use SY-UCOMM in application programs.

SY-XFORM

SYSTEM-EXIT subroutine.

SY-XPROG

SYSTEM-EXIT program.

Obsolete System Fields

In the transition from R/2 to R/3, some system fields were carried over that are no longer filled. These system fields are obsolete and can no longer be used.

SY-APPLI

In R/2, ID for which SAP applications are installed. No longer filled.

SY-BATZD

In R/2, ID for daily background scheduling. No longer filled.

SY-BATZM

In R/2, ID for monthly background scheduling. No longer filled.

SY-BATZO

In R/2, ID for single background scheduling. No longer filled.

SY-BATZS

In R/2, ID for immediate background scheduling. No longer filled.

SY-BATZW

In R/2, ID for weekly background scheduling. No longer filled.

SY-BREP4

In R/2, root name of request report for background processing. No longer filled.

SY-BSPLD

In R/2, ID for immediate spool output for background processing. No longer filled.

SY-CCURS

In R/2, rate specification/result field from CURRENCY CONVERSION. No longer filled.

SY-CCURT

In R/2, table rate from CURRENCY CONVERSION. No longer filled.

SY-CDATE

In R/2, rate date from CURRENCY CONVERSION. No longer filled.

SY-CTABL

In R/2, rate table from CURRENCY CONVERSION. No longer filled.

SY-CTYPE

In R/2, rate type from CURRENCY CONVERSION. No longer filled.

SY-DCSYS

Dialog system of R/2 System No longer filled.

SY-FMKEY

Previously, current function code menu. No longer filled.

SY-LOCDB

Local database, not implemented.

SY-LOCOP

Local database operation, not implemented.

SY-MACDB

Previously, name of file for matchcode access. No longer filled.

SY-MARKY

Current line character for the MARK statement. However, the language element MARK will only be supported for a short time.

SY-PAGCT

In R/2, maximum number of pages per list. No longer filled.

SY-PREFX

ABAP prefix for background jobs. No longer filled.

SY-SFNAM

Undocumented

SY-SPONR

In R/2, you could process spool files using the TRANSFER statement, set by SY-SPONR. No longer filled.

SY-TFDSN

Previously, name of external storage file for extracts. No longer filled.

SY-TMAXL

Previously, maximum number of entries in an internal table. No longer filled.

SY-TNAME

Previously, name of an internal table after an access. No longer filled.

SY-TOCCU

With the statements DESCRIBE TABLE, LOOP AT, and READ TABLE, SY-TOCCU was filled with the value of the initial main memory requirements for the addressed internal table. No longer filled.

SY-TPAGI

Previously, ID whether an internal table is stored in the paging area. No longer filled.

SY-TTABC

Previously, index of last read row in an internal table. No longer filled.

SY-TTABI

Previously, offset of internal tables in roll area. No longer filled.

SY-WAERS

Previously, company code currency after reading booking segment. No longer filled.

SY-WILLI

In R/2, number of selected list row for detail list in window. Use SY-LILLI.

SY-WINCO

In R/2, cursor position for detail list in window. Use SY-CUCOL.

SY-WINDI

In R/2, index of list for detail list in window. Use SY-LSIND.

SY-WINRO

In R/2, cursor position for detail list in window. Use SY-CUROW.

SY-WINSL

In R/2, content of selected row for detail list in window. Use SY-LISEL.

SY-WINX1

In R/2, window coordinate for detail list in window. No longer used.

SY-WINX2

In R/2, window coordinate for detail list in window. No longer used.

SY-WINY1

In R/2, window coordinate for detail list in window. No longer used.

SY-WINY2

In R/2, window coordinate for detail list in window. No longer used.

http://help.sap.com/saphelp_nw2004s/helpdata/en/7b/fb96c8882811d295a90000e8353423/frameset.htm

Prakash.

Read only

Former Member
0 Likes
1,229

Hi Ranjith,

Example Programs for youe sake ..

<b>1St one:-</b>

REPORT demo_list_interactive_1.
START-OF-SELECTION.
  WRITE: 'Basic List, sy-lsind =', sy-lsind.
AT LINE-SELECTION.
  WRITE: 'Secondary List, <b>sy-lsind</b> =', sy-lsind.

http://www.sap-basis-abap.com/abap/check-boxes-in-an-interactive-report.htm

http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dba2eb35c111d1829f0000e829fbfe/content.htm

http://www.karakas-online.de/forum/viewtopic.php?t=3353

Even you will find the Example programs in <b>ABAPDOCU</b>

enter this ABAPDOCU in the command linem you will get all the example programs

Regards

Sudheer

Read only

Former Member
0 Likes
1,229

check in the structure SYST in SE11 for all system fields what u are looking in different scenarios