Author Archive

ABAP -ALV DrillDown Report to Transcation Code ME23N

TABLES:     ekko.

type-pools: slis.                                 ”ALV Declarations
*Data Declaration
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
statu TYPE ekpo-statu,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
peinh TYPE ekpo-peinh,
END OF t_ekko.

wa_ekko TYPE t_ekko.

*ALV data declarations
data: fieldcatalog type slis_t_fieldcat_alv with header line,
gd_tab_group type slis_t_sp_group_alv,
gd_layout    type slis_layout_alv,
gd_repid     like sy-repid,
gt_events     type slis_t_event,
gd_prntparams type slis_print_alv.


perform data_retrieval.
perform build_fieldcatalog.
perform build_layout.
perform build_events.
perform build_print_params.
perform display_alv_report.

*       Build Fieldcatalog for ALV Report
form build_fieldcatalog.

fieldcatalog-fieldname   = ’EBELN’.
fieldcatalog-seltext_m   = ’Purchase Order’.
fieldcatalog-col_pos     = 0.
fieldcatalog-outputlen   = 10.
fieldcatalog-emphasize   = ’X’.
fieldcatalog-key         = ’X’.
*  fieldcatalog-do_sum      = ’X’.
*  fieldcatalog-no_zero     = ’X’.
append fieldcatalog to fieldcatalog.
clear  fieldcatalog.

fieldcatalog-fieldname   = ’EBELP’.
fieldcatalog-seltext_m   = ’PO Item’.
fieldcatalog-col_pos     = 1.
append fieldcatalog to fieldcatalog.
clear  fieldcatalog.

fieldcatalog-fieldname   = ’STATU’.
fieldcatalog-seltext_m   = ’Status’.
fieldcatalog-col_pos     = 2.
append fieldcatalog to fieldcatalog.
clear  fieldcatalog.

fieldcatalog-fieldname   = ’AEDAT’.
fieldcatalog-seltext_m   = ’Item change date’.
fieldcatalog-col_pos     = 3.
append fieldcatalog to fieldcatalog.
clear  fieldcatalog.

fieldcatalog-fieldname   = ’MATNR’.
fieldcatalog-seltext_m   = ’Material Number’.
fieldcatalog-col_pos     = 4.
append fieldcatalog to fieldcatalog.
clear  fieldcatalog.

fieldcatalog-fieldname   = ’MENGE’.
fieldcatalog-seltext_m   = ’PO quantity’.
fieldcatalog-col_pos     = 5.
append fieldcatalog to fieldcatalog.
clear  fieldcatalog.

fieldcatalog-fieldname   = ’MEINS’.
fieldcatalog-seltext_m   = ’Order Unit’.
fieldcatalog-col_pos     = 6.
append fieldcatalog to fieldcatalog.
clear  fieldcatalog.

fieldcatalog-fieldname   = ’NETPR’.
fieldcatalog-seltext_m   = ’Net Price’.
fieldcatalog-col_pos     = 7.
fieldcatalog-outputlen   = 15.
fieldcatalog-do_sum      = ’X’.
fieldcatalog-datatype     = ’CURR’.
append fieldcatalog to fieldcatalog.
clear  fieldcatalog.

fieldcatalog-fieldname   = ’PEINH’.
fieldcatalog-seltext_m   = ’Price Unit’.
fieldcatalog-col_pos     = 8.
append fieldcatalog to fieldcatalog.
clear  fieldcatalog.
endform.                    ” BUILD_FIELDCATALOG

*&      Form  BUILD_LAYOUT
*       Build layout for ALV grid report
form build_layout.
gd_layout-no_input          = ’X’.
gd_layout-colwidth_optimize = ’X’.
gd_layout-totals_text       = ’Totals’(201).
*  gd_layout-totals_only        = ’X’.
*  gd_layout-f2code            = ’DISP’.  ”Sets fcode for when double
*                                         ”click(press f2)
*  gd_layout-zebra             = ’X’.
*  gd_layout-group_change_edit = ’X’.
*  gd_layout-header_text       = ’helllllo’.
endform.                    ” BUILD_LAYOUT

*       Display report using ALV grid
form display_alv_report.
gd_repid = sy-repid.
call function ’REUSE_ALV_GRID_DISPLAY’
i_callback_program      = gd_repid
i_callback_top_of_page   = ’TOP-OF-PAGE’  ”see FORM
i_callback_user_command = ’USER_COMMAND’
*            i_grid_title           = outtext
is_layout               = gd_layout
it_fieldcat             = fieldcatalog[]
*            it_special_groups       = gd_tabgroup
it_events               = gt_events
is_print                = gd_prntparams
i_save                  = ’X’
*            is_variant              = z_template
t_outtab                = it_ekko
program_error           = 1
others                  = 2.
if sy-subrc <> 0.
endform.                    ” DISPLAY_ALV_REPORT

*&      Form  DATA_RETRIEVAL
*       Retrieve data form EKPO table and populate itab it_ekko
form data_retrieval.

select ebeln ebelp statu aedat matnr menge meins netpr peinh
up to 10 rows
from ekpo
into table it_ekko.
endform.                    ” DATA_RETRIEVAL

* Form  TOP-OF-PAGE                                                 *
* ALV Report Header                                                 *
Form top-of-page.
*ALV Header declarations
data: t_header type slis_t_listheader,
wa_header type slis_listheader,
t_line like wa_header-info,
ld_lines type i,
ld_linesc(10) type c.

* Title
wa_header-typ  = ’H’.
wa_header-info = ’EKKO Table Report’.
append wa_header to t_header.
clear wa_header.

* Date
wa_header-typ  = ’S’.
wa_header-key = ’Date: ’.
CONCATENATE  sy-datum+6(2) ’.’
sy-datum+4(2) ’.’
sy-datum(4) INTO wa_header-info.   ”todays date
append wa_header to t_header.
clear: wa_header.

* Total No. of Records Selected
describe table it_ekko lines ld_lines.
ld_linesc = ld_lines.
concatenate ’Total No. of Records Selected: ’ ld_linesc
into t_line separated by space.
wa_header-typ  = ’A’.
wa_header-info = t_line.
append wa_header to t_header.
clear: wa_header, t_line.

it_list_commentary = t_header.
*            i_logo             = ’Z_LOGO’.

*       FORM USER_COMMAND                                          *
*       –> R_UCOMM                                                *
*       –> RS_SELFIELD                                            *
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.

* Check function code
CASE r_ucomm.
WHEN ’&IC1′.
*   Check field clicked on within ALVgrid report
IF rs_selfield-fieldname = ’EBELN’.
*     Read data table, using index of row user clicked on
READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
*     Set parameter ID for transaction screen field
*     Sxecute transaction ME23N, and skip initial data entry screen

*&      Form  BUILD_EVENTS
*       Build events table
form build_events.
data: ls_event type slis_alv_event.

call function ’REUSE_ALV_EVENTS_GET’
i_list_type = 0
et_events   = gt_events[].
read table gt_events with key name =  slis_ev_end_of_page
into ls_event.
if sy-subrc = 0.
move ’END_OF_PAGE’ to ls_event-form.
append ls_event to gt_events.

read table gt_events with key name =  slis_ev_end_of_list
into ls_event.
if sy-subrc = 0.
move ’END_OF_LIST’ to ls_event-form.
append ls_event to gt_events.
endform.                    ” BUILD_EVENTS

*       Setup print parameters
form build_print_params.
gd_prntparams-reserve_lines = ’3′.   ”Lines reserved for footer
gd_prntparams-no_coverpage = ’X’.
endform.                    ” BUILD_PRINT_PARAMS

*&      Form  END_OF_PAGE
data: listwidth type i,
ld_pagepos(10) type c,
ld_page(10)    type c.

write: sy-uline(50).
write:/40 ’Page:’, sy-pagno .

*&      Form  END_OF_LIST
data: listwidth type i,
ld_pagepos(10) type c,
ld_page(10)    type c.

write:/40 ’Page:’, sy-pagno .

alv – slis_layout_alv

It is used for column widht optimize , alternate colors, subtotal text etc.

no_colhead(1) type c, ” no headings
no_hotspot(1) type c, ” headings not as hotspot
zebra(1) type c, ” striped pattern
no_vline(1) type c, ” columns separated by space
no_hline(1) type c, “rows separated by space B20K8A0N5D
cell_merge(1) type c, ” not suppress field replication
edit(1) type c, ” for grid only
edit_mode(1) type c, ” for grid only
numc_sum(1) type c, ” totals for NUMC-Fields possib.
no_input(1) type c, ” only display fields
f2code like sy-ucomm, ”
reprep(1) type c, ” report report interface active
no_keyfix(1) type c, ” do not fix keycolumns
expand_all(1) type c, ” Expand all positions
no_author(1) type c, ” No standard authority check
* PF-status
def_status(1) type c, ” default status space or ‘A’
item_text(20) type c, ” Text for item button
countfname type lvc_fname


ABAP System Fields

System Information

Information on the Current SAP System


Central database system, for example INFORMIX, ORACLE


Application server, for example HS0333, PAWDF087


Operating system of application server, for example HP-UX, SINIX


Release status of the SAP System, for example 30D, 46A


Name of the SAP System, for example B20, I47

Information on the User Session


One-digit language key, for example D, E, F. Either logon language of user or set using the SET LOCALE LANGUAGE statement.


Client number 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.


Indexes external modes. Zero in first mode. In new modes, opened using the Create Mode function or by calling a transaction using /o, it is raised by 1. If previous modes were deleted, the free numbers are used first. Modes opened using CALL TRANSACTION … STARTING NEW TASK start back at 0.


Logon name of user, for example KELLERH, BC400-01.

Date and Time Information

The following system fields are always set automatically. If necessary, the GET TIME statement synchronizes the application server time with that of the database server and writes it to the system field SY-UZEIT. SY-DATUM and the system fields for the local time zone, that is SY-TIMLO, SY-DATLO, and SY-ZONLO are also reset.


Local date of user, for example 19981129, 19990628.


Current (application server) date, for example 19981130, 19990627.


During daylight saving time X, otherwise empty.


Factory calendar weekday, Sunday 0 … Saturday 6.


Local time of user, for example 154353, 225312.


Time difference to Greenwich Mean Time (UTC) in seconds, for example 3600, 10800.


Current (application server) time, for example 164353, 215312.


Time zone of user, for example CET, UTC.

Information on the Current ABAP Program


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.

  • SY-CALLD is set to ‘X‘ in a program called using CALL TRANSACTION, CALL DIALOG, or SUBMIT … AND RETURN.
  • 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.
  • With SUBMIT (without RETURN) SY-CALLD retains the previous value.

In externally called procedures, the name of the calling program, otherwise the name of the current program. If an externally called procedure calls another external procedure, SY-CPROG keeps the name of the first main program and is not given the name of the main program of the further caller.


With executable programs this is the linked logical database.


Screen group of current screen. You can assign several screens to a common screen group. You can use this, for example, to modify all of the screens in the group in a uniform way.


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 contains the number of the container screen. While a subscreen is being processed, SY-DYNNR contains its screen number. This also applies to tabstrips.


With executable programs, the database program of the linked logical database.


Name of current ABAP program. With externally called procedures this is the name of the procedure’s main program.

If SY-REPID was transferred to an external procedure as an actual parameter before Release 6.10, the formal parameter was not given the name of the caller, but the name of the procedure’s main program. SY-REID had to be transferred to an auxiliary variable before the call or you had to use SY-PROG.

As of Release 6.10, SY-REPID is a separate constant that is no longer part of the structure SYST or SY. It can be transferred to external procedures directly.


Name of current transaction code.

Background Processing


SY-BATCH is set to X in an ABAP program running in the background. Otherwise it is empty.

Batch Input


SY-BINPT is set to X during processing of batch input folders and in ABAP programs called with CALL TRANSACTION USING. Otherwise it is empty.

  • OPTIONS FROM in the CALL TRANSACTION USINGstatement can set SY-BINPT to empty for the whole program execution, as well as at the end of the BDC data.
  • In CATT procedures, SY-BINPT is always empty.


ABAP Programming



Contains the Alphabet. Can be used to access individual letters independently of the codepage by specifying offset.


Contains a horizontal line with length 255. Can be used when creating the list.


Contains a vertical line (|). Can be used when creating the list



SY-INDEX contains the number of loop passes in DO and WHILE loops, including the current loop pass.

Character Strings


Found location for operations with character-type fields.

  • If the operators CO, CN, CA, NA, CS, NS, CP, NP are used in comparisons, SY-FDPOS is assigned offset values depending on the comparison result.
  • SEARCH … FOR … sets SY-FDPOS to the offset of the found search string.

Internal Tables


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.

  • APPENDsets SY-TABIX to the index of the last table row, that is the total number of entries in the target table.
  • COLLECTsets SY-TABIX to the index of the existing or appended table row. With hashed tables, SY-TABIX is set to 0.
  • LOOP ATsets SY-TABIX to the index of the current table row at the beginning of every loop pass. After leaving a loop, SY-TABIX is set to the value it had before entering the loop. With hashed tables, SY-TABIX is set to 0.
  • 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.
  • SEARCH itab FOR sets SY-TABIX to the index of the table row, in which the search string was found.

With the statements DESCRIBE TABLE, LOOP AT, and READ TABLE, SY-TFILL is filled with the row number of the addressed internal table.


With the statements DESCRIBE TABLE, LOOP AT, and READ TABLE, the system fills SY-TLENG with the row size of the addressed internal table.

Database Accesses


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.

  • DELETEsets SY-DBCNT to the number of lines deleted.
  • FETCHsets SY-DBCNT to the number of lines already read by the current cursor.
  • INSERTsets SY-DBCNT to the number of lines inserted.
  • MODIFYsets SY-DBCNT to the number of lines processed.
  • UPDATE sets SY-DBCNT to the number of lines changed.

Return Value


Return value set by the following ABAP statements. In general, a content of 0 means that the statement was executed without problems.

  • ASSIGNsets SY-SUBRC to 0 if assignment to field symbol is possible, otherwise 4.
  • ASSIGN dref->* sets SY-SUBRC to 0 if dereferencing is possible, otherwise 4.
  • 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.
  • CALL DIALOG with USING sets SY-SUBRC to 0, if processing was successful, otherwise <>0.
  • CALL FUNCTION sets SY-SUBRC according to the exception handling.
  • CALL METHOD sets SY-SUBRC according to the exception handling.
  • CALL SELECTION-SCREEN sets SY-SUBRC to 0 if the user chose Enter or Execute and 4 if the user chose Cancel.
  • CALL TRANSACTION with USING sets SY-SUBRC to 0 if processing was successful, otherwise <>0.
  • CATCH SYSTEM-EXCEPTIONS sets SY-SUBRC if there are runtime errors after the ENDCATCH statement. The value is specified in the program.
  • COMMIT WORK sets SY-SUBRC to 0.
  • COMMIT WORK AND WAIT sets SY-SUBRC to 0 if update was successful, otherwise <>0.
  • CONCATENATE sets SY-SUBRC to 0 if the result fits into target variable, otherwise 4.
  • CREATE OBJECT sets SY-SUBRC if the exceptions of the instance constructor are handled.
  • CREATE OBJECT in OLE2 sets SY-SUBRC to 0 if an external object was created, otherwise 1,2, 3 with different causes.
  • DELETEsets SY-SUBRC to 0 if operation was successful, otherwise 4 or <> 0 depending on cause.
  • DEMAND … MESSAGES INTO sets SY-SUBRC to 0 if a message table is empty, otherwise <> 0.
  • DESCRIBE LIST sets SY-SUBRC to 0 if row or list exists, otherwise 4 or 8.
  • EXEC SQL – ENDEXEC sets SY-SUBRC to 0 in almost all cases. Only if no set was read with FETCH is SY-SUBRC 4.
  • FETCHsets SY-SUBRC to 0 if at least one row was read, otherwise 4.
  • GENERATE SUBROUTINE POOL sets SY-SUBRC to 0 if generation was successful, otherwise 8.
  • GET CURSOR sets SY-SUBRC to 0 if the cursor is correctly positioned, otherwise 4.
  • GET PARAMETER sets SY-SUBRC to 0 if value found in SAP Memory, otherwise 4.
  • IMPORTsets SY-SUBRC to 0 if import of data objects was successful, otherwise 4.
  • INSERTsets SY-SUBRC to 0 if operation was successful, otherwise 4.
  • LOAD REPORT sets SY-SUBRC to 0 if operation was successful, otherwise 4 or 8 depending on cause.
  • LOOPsets SY-SUBRC to 0 if loop over extract was passed at least once, otherwise 4.
  • LOOP ATsets SY-SUBRC to 0 if loop over internal table was passed at least once, otherwise 4.
  • MODIFYsets SY-SUBRC to 0 if operation was successful, otherwise 4.
  • MODIFY LINE sets SY-SUBRC to 0 if list row was changed, otherwise <> 0.
  • MODIFYsets SY-SUBRC to 0 if operation was successful, otherwise 4.
  • OLE2 automation, bundled commands set SY-SUBRC to 0 if all were successfully executed, otherwise 1, 2, 3, 4 depending on cause.
  • OPEN DATASET sets SY-SUBRC to 0 if the file was opened, otherwise 8.
  • Open SQL commands set SY-SUBRC to 0 if operation was successful, otherwise <>0.
  • OVERLAYsets SY-SUBRC to 0 if at least one character is overlayed, otherwise 4.
  • READ DATASET sets SY-SUBRC to 0 if the read operation was successful, otherwise 4 or 8 depending on cause.
  • READ LINE sets SY-SUBRC to 0 if list row exists, otherwise <> 0.
  • READ TABLE sets SY-SUBRC to 0 if the table row was found, otherwise 2, 4, 8 depending on cause.
  • REPLACEsets SY-SUBRC to 0 if search string could be replaced, otherwise <> 0.
  • ROLLBACK WORK always sets SY-SUBRC to 0.
  • SCROLLsets SY-SUBRC to 0 if scrolling in list successful, otherwise 4 or 8 depending on cause.
  • SEARCHsets SY-SUBRC to 0 if search string was found, otherwise 4.
  • SELECTsets SY-SUBRC to 0 if at least one row was read, otherwise 4 or even 8 with SELECT SINGLE FOR UPDATE.
  • SET COUNTRY sets SY-SUBRC to 0 if country ID was found in table T005X, otherwise 4.
  • SET BITsets SY-SUBRC to 0 if bit was set, otherwise <> 0.
  • SET TITLEBAR sets SY-SUBRC to 0 if title exists, otherwise 4.
  • SHIFT … UP TO sets SY-SUBRC to 0 if position was found in character string, otherwise 4.
  • SPLITsets SY-SUBRC to 0 if size of target fields is sufficient, otherwise 4.
  • UPDATEsets SY-SUBRC to 0 if operation successful, otherwise 4.
  • WRITE … TO sets SY-SUBRC to 0 if assignment successful, otherwise 4.




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.


Horizontal cursor position Counting starts at column 2


Vertical cursor position Counting starts at row 1


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.


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


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


Number of columns in current screen.


Number of rows in current screen.


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.


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.


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


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.


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.

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.

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.

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.

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.

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.


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:


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


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


Contents of the line from which the event was triggered


Index of the list from which the event was triggered


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.


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.


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


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.


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.


Contains the name of the spool file during printing.


Contains the name of the spool number during printing.


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.


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 contains the message ID.


SY-MSGNO contains the message number.


SY-MSGTY contains the message type.


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








Name of spool output file.






Length of a field.


Number of decimal places of a field.


Output length of a field.


Data type of a field.












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.






















Call status of an executable program.


Call type of an executable program.








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.


SYSTEM-EXIT subroutine.


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.


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


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


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


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


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


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


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


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


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


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


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


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


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


Dialog system of R/2 System No longer filled.


Previously, current function code menu. No longer filled.


Local database, not implemented.


Local database operation, not implemented.


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


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


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


ABAP prefix for background jobs. No longer filled.




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


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


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


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


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.


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


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


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


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


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


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


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


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


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


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


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


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


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


abap debugger ok-codes

/h activate debugging

/hs activate system debugging

/ha skip dynpro (PAI, PBO) and directly debug ABAP code

/hx detach debugger

/hmusa create memory snapshot (can be used in the transaction S_MEMORY_INSPECTOR for memory consumption analysis)

jdbg in SM37 restart of a finished or crashed background job for debugging

/ron start ABAP Runtime Analysis measurement (transaction SE30)

/roff stop ABAP Runtime Analysis measurement (transaction SE30)


MM and FI connection

Area and Tech Name and Description

EKKO – PO Header
EKPO – PO Item
EBAN – Purchase requisition
EKBE – History per Purchase doc.
EKKN – Account Assignment in Purchasing Document /span>

BKPF – Accounting Document Header
BSEG – Accounting Document Segment
CSKS – Cost Center Master Data
PRPS – WBS master data
AUFK – Order master data

CEPC – Profit Center master data
RBSELBEST – PO associated with aparked invoice

Line items (Rep: RPUDRIG0)
COOI – Commitments Management: Line Items

PPDHD – Transfer to Accounting: Document Header
PPDIT – Transfer to Accounting: Lines in HR IDOCs

Order data (Network)
AUFK – Order master data
AFKO – Order header data
AFPO – Order item data

AFVC – Operation within an order
AFVV – quantities/dates/values in the operation

Invoice data
EKKO – PO Header
RSEG – Incoming invoice (Invoice doc, PO doc)
RBKP – Invoice receipt

Project plan/WBS
PROJ – Project data
PRHI – WBS breakdown within project

VBAK – Header
VBAP – Item
VBPA – Sales Document Partner

VTTK – Shipment Header
VTTP – Shipment Item

LIKP – Delivery Header
LIPS – Delivery item

LFA1 – Vendor Master
LFB1 – Vendor Master (Company Code)

KNA1 – Customer Master
KNB1 – Customer Master (Company Code)

MARA – Material data
MARC – Material Plant Details

PNP – Get Pernr (Personnel data)
PCH – Get Objec

TEM table structure

sap mm transaction code (t-code)

List of mm Tcode

Transaction codes for materials

MM01: Create material
MM02: Change material
MM03: Display material

Transaction codes for Reservations

MB21: Create Reservation
MB22: Change Reservation
MB23: Display Reservation
MB25: List of Reservations

Purchasing display transaction codes

ME53: Display purchase requisition
ME23 Display purchase order
ME43: Display RFQ
ME48: Display quotation
ME33K: Display contract
ME33L: Display scheduling agreement
ME13: Display info record
ME03: Display source list
MEQ3: Display quota arrangement
MP02: Display approved manufacturer parts list
ME62: Display vendor evaluation
MN03: Display RFQ message
MN06: Display purchase order message
MN09: Display outline purchase agreement message
MN12: Display scheduling agreement delivery schedule message
MN15: Display service entry sheet message
MN26: Display inbound delivery message
WWNC: Display messages for settlement run
MEB3: Display rebate arrangements
WWSC: Display conditions for subsequent
MEK3: Display conditions in purchasing

Transaction codes for processing RFQ (Request for quotation)

ME41: Create RFQ
ME42: Change RFQ
ME43: Display RFQ
ME44: Maintain RFQ supplement
ME45: Release RFQ

Transaction codes to maintain quotations

ME47: Enter quotation
ME48: Display quotation
ME49: Quotation price comparison list

Transaction codes to process a purchase requisition

ME51N: Create purchase requisition
ME52N: Change purchase requisition
ME53N: Display purchase requisition

Transaction codes to release Purchase Requisitions

ME54: Individual release for purchase requisitions
ME55: Individual release for purchase requisitions
ME5F: Release reminder for purchase requisitions

Transaction codes to process Purchase Orders

ME21N: Create purchase order
ME25: Create purchase order – vendor unknown
ME22N: Change purchase order
ME23N: Display purchase order
ME56: Assign source to purchase requisition
ME57: Assign and process purchase requisitions
ME58: Order for assigned purchase requisitions
ME59: Generate purchase orders from requisitions automatically
ME24: Maintain PO supplement
ME28: Release purchase order

Transaction codes to process a purchasing info record

ME11: Create purchasing info record
ME12: Change purchasing info record
ME13: Display purchasing info record
ME14: Display changes to purchasing info record
ME15: Flag purchasing info record for deletion

Transaction codes to process physical inventory documents.

MI01: Create Physical Inventory Document
MI02: Change Physical Inventory Document
MI03: Display Physical Inventory Document
MI21: Print Physical Inventory Document
MI07: Process List of Differences
MI08: Create List of Differences with Document
MI10: Create List of Differences without Document
MI20: Print List of Differences
MI11: Recount Physical Inventory Document

Transaction cods for Physical Inventory

MI01: Create Physical Inventory Document
MI02: Change Physical Inventory Document
MI03: Display Physical Inventory Document
MI21: Print Physical Inventory Document
MI07: Process List of Differences
MI08: Create List of Differences with Document
MI10: Create List of Differences without Document
MI20: Print List of Differences
MI11: Recount Physical Inventory Document
MI22: Display Physical Inventory Documents for Material.
MI23: Display Physical Inventory Data for Material.
MIDO: Display Changes.
MI24: Physical Inventory List.
MIAL: Read Physical Inventory Document Archive.
MI04: Enter Physical Inventory Count with Document
MI09: Enter Physical Inventory Count without Document
MI05: Change Physical Inventory Count
MI06: Display Physical Inventory Count

Transaction codes to process a purchase contract

ME31K: Create contract
ME32K: Change contract
ME33K: Display contract
ME34K: Maintain contract supplement
ME3P: Recalculate contract prices
MLRP: Periodic invoicing plans

Vendor Evaluation transaction codes

ME61: Maintain vendor evaluation
ME62: Display vendor evaluation
ME63: Re-evaluate automatic sub criteria
ME6A: Display changes to vendor evaluation
ME6F: Print evaluation sheet
ME6G: Vendor evaluation in the background

Transaction codes for Scheduling Agreements

ME31L: Create scheduling agreement
ME37: Create stock transport scheduling agreement
ME32L: Change scheduling agreement
ME33L: Display scheduling agreement
ME34L: Maintain scheduling agreement supplement
ME3R: Recalculate scheduling agreement prices
ME85: Re-number schedule lines
ME86: Aggregate schedule lines
ME87: Aggregate PO history
ME88: Reset agreed cumulative quantity and reconciliation date

SAP Crystal Reports Tutorials

SAP Crystal Reports software enables you to easily design interactive reports and connect them to virtually any data source. Your users can benefit from on-report sorting and filtering – giving them the power to execute decisions instantly.

And with SAP Crystal Reports Dashboard Design package, you can gain even more functionality for compelling reports. This bundled product includes SAP Crystal Reports and SAP Crystal Dashboard Design ( formerly known as Xcelsius Engage), giving you the power to create highly formatted reports with what-if scenario models, interactive charts – and deliver them via the Web, e-mail, Microsoft Office, Adobe PDF, or embedded in enterprise applications. As a result, you can leverage your reports to make better operational and strategic decisions.

With SAP Crystal Reports, you can:

  • Leverage professional reporting – priced for everyone
  • Empower end users to explore reports with on-report sorting and parameters
  • Minimize IT and developer effort with interactive reports
  • Develop powerful data mashups
  • Save valuable report design time
  • Embed professional-looking reports in Java and .NET applications
  • Tailor your solution by adding report management and viewing tools

To Download the Tutorials Please the link below:

—>>>>>>>> Crystal Report toturial


crystal report limit records Query

To make it show 5 records per page do the following

1. Open the report in Design View

2. Right click on the Details section and select Section Expert

3. Make sure the Details section is selected in the Section Expert dialog box. Check the box that says “New Page After”

4. Click the formula editor button to the right of the checkbox.

5. Enter the following formula

if Remainder (RecordNumber, 5) = 0 then true else false

6. Click Save and Close and then click OK.

If you run the report it should break after each 5 rows.


FI/CO Tables

T001: Company Codes
T002: Language Keys
T003: FI Document Types
T004: Chart Of Accounts
T005: Country Keys
T007A: Tax Keys
T012: House Banks
TKA01: Controlling Areas
SKA1, SKB1: G/L Account Master data
SKAT : G/L Accounts Texts
KNBK: Customer Master(Bank Details)
LFBK: Vendor Master (Bank Details)
BKPF: Accounting Doc. Header
BSEG: Accounting Doc. Item(Cluster Table)
BSIS: G/L Open Items
BSAS: G/L Closed Items
BSID: Customer Open Items(Account Receivables)
BSAD: Customer Closed Items)(Account Receivables)
BSIK: Vendor Open Items(Account Payables)
BSAK: Vendor Closed Items(Account Payables)
BKPF and BSEG Tables consists of data from BSIS, BSAS, BSID, BSAD, BSIK, and BSAK tables.
BSET: Tax Information
BSEC: One Time Vendor Records
CSKS: Cost Center Master
CSKT: Cost Center Texts
CSSK: Cost Center/ Cost Element Relations
GLPCA: EC-PCA: Actual Line Items
GLPCT: EC-PCA: Totals Table
COEP: Co-Object Line Items by Period
COST: Co-Object Price Totals
CSSL: Cost Center- Activity Type
CRCO: Work Center- Cost Center Assignment
CSLA: Activity Types Master(LSTAR)
CSKB: Cost Elements(KSTAR, KOKRS)
COBL: Coding Block
CEPC: Profit Center Master Data
BNKA: Master Records of banks
TBSL: Posting Keys
KEKO: Product Costing Header Data
ANLH: Main Asset Number
ANLA, ANLB, ANLC : Segment Assets Masters

PP & PM Tables

AFKO: PP Order Header Data
AFPO: PP Order Item Data
AFVV: Order Operations Data Qty/Date/Values
AFVC: Operations within an Order
AFRU: Order Completion Confirmation
CSLA: Activity Types Master Data
CSLT: Activity Types Texts
KAKO: Capacity Header Segment
CRHD: Work Center Header Data
AUFK: Order Master Data
AFIH: Maintenance Order Header
AUFM: Goods Movement For Order
EQUI: Equipment Master Data
EQKT: Equipment Texts
ILOA: PM Object Location
T024I: Maintenance Planner Groups
T357: Plant Section
IFLO: Functional Location Text
IHSG: Permits in PM
IHGNS: Permit segment in PM
T357G_T: Permit Text
RESB: Reservation / Dependent requirement
V_EQUI: View for Equipment description
VIAUFKS: View for Order and Equipment Data
CAVFVD: Work Center Text.
VIQMEL: Notification Header View
VIQMFEL: PM Notification View
VIQMMA, VIQMSM : Views for Activities and Tasks