Archive for ‘ January, 2012 ’

list of function modules (se37)

ABAP_DOCU_DOWNLOAD Download ABAP documentation in HTML format.
APPL_LOG_DELETE With this function module you delete logs in the database according to specified selection conditions
APPL_LOG_DISPLAY With this function module you can analyze logs in the database.
APPL_LOG_DISPLAY_INTERN With this function module you can analyze logs in local memory, e.g. when you have only collected log records at runtime and do not want to write to the database.
APPL_LOG_INIT This function module checks whether the specified object or sub-object exists and deletes all existing associated data in local memory.
APPL_LOG_READ_DB With this function module you read the log data in the database for an object or sub-object according to specified selection conditions.
APPL_LOG_READ_INTERN With this function module you read all log data whose log class has at least the specified value, from local memory, for the specified object or sub-object.
APPL_LOG_SET_OBJECT With this function module, you create a new object or sub-object for writing in local memory. With a flag you can control whether the APPL_LOG_WRITE_… messages are written in local memory or are output on the screen.
APPL_LOG_WRITE_DB With this function module you write all data for the specified object or sub-object in local memory to the database. If the log for the object or sub-object in question is new, the log number is returned to the calling program.
APPL_LOG_WRITE_HEADER With this function module, you write the log header data in local memory.
APPL_LOG_WRITE_LOG_PARAMETERS With this function module, you write the name of the log parameters and the associated values for the specified object or sub-object in local memory. If this function module is called repeatedly for the same object or sub-object, the existing parameters are updated accordingly. If you do not specify an object or sub-object with the call, the most recently used is assumed.
APPL_LOG_WRITE_MESSAGE_PARAMS With this function module you write a single message, with parameters, in local memory. Otherwise the function module works like APPL_LOG_WRITE_SINGLE_MESSAGE.
APPL_LOG_WRITE_MESSAGES With this function module you write one or more messages, without parameters, in local memory.
APPL_LOG_WRITE_SINGLE_MESSAGE With this function module you write a single message, without parameters, in local memory. If no header entry has yet been written for the object or sub-object, it is created. If you do not specify an object or sub-object with the call, the most recently used is assumed.
ARFC_GET_TID will return the IP address of the terminal in hex.
BAL_CNTL_CREATE Create Control for log display
BAL_CNTL_FREE Release Control
BAL_CNTL_REFRESH Put new data in log display
BAL_DB_DELETE Delete logs from the database
BAL_DB_DEQUEUE Unlock log
BAL_DB_ENQUEUE Lock log
BAL_DB_LOAD Load logs from the database
BAL_DB_LOAD Load log(s)
BAL_DB_SAVE Save logs in the database
BAL_DB_SAVE Save log(s)
BAL_DB_SAVE_PREPARE Prepare save
BAL_DB_SEARCH Find logs in the database
BAL_DSP_LOG_DISPLAY Display messages in memory
BAL_DSP_LOG_DISPLAY Display Log
BAL_DSP_LOG_PARAMETERS Either output extended long text or call a callback routine (based on the data in BAL_S_LOG-PARAMS)
BAL_DSP_LOG_TECHNICAL_DATA Output all log header data
BAL_DSP_MSG_LONGTEXT Display message long text
BAL_DSP_MSG_PARAMETERS Either output extended long text or call a callback routine (based on the data in BAL_S_MSG-PARAMS)
BAL_DSP_MSG_TECHNICAL_DATA Output technical data of a message such as work area, error number, etc.
BAL_DSP_OUTPUT_FREE End output
BAL_DSP_OUTPUT_INIT Initialize output
BAL_DSP_OUTPUT_SET_DATA Set dataset to be displayed
BAL_DSP_PROFILE_DETLEVEL_GET Message hierarchy in DETLEVEL
BAL_DSP_PROFILE_NO_TREE_GET Display without tree (fullscreen)
BAL_DSP_PROFILE_POPUP_GET Display without tree (popup)
BAL_DSP_PROFILE_SINGLE_LOG_GET Standard profile (SLG1) for one log
BAL_DSP_PROFILE_STANDARD_GET Standard profile (SLG1) for a lot of logs
BAL_GLB_AUTHORIZATION_GET Assign authorization
BAL_GLB_AUTHORIZATION_RESET Reset authorization
BAL_GLB_CONFIG_GET Read configuration
BAL_GLB_CONFIG_SET Set configuration
BAL_GLB_MEMORY_EXPORT Put function group memory in ABAP-MEMORY
BAL_GLB_MEMORY_IMPORT Get function group memory from ABAP-MEMORY
BAL_GLB_MEMORY_REFRESH (Partially) reset global memory
BAL_GLB_MEMORY_REFRESH (Partially) initialize memory
BAL_GLB_MSG_CURRENT_HANDLE_GET Get current message handle
BAL_GLB_MSG_DEFAULTS_GET Get message defaults
BAL_GLB_SEARCH_LOG Find logs in memory
BAL_GLB_SEARCH_MSG Find messages in memory
BAL_LOG_CREATE Create log with header data
BAL_LOG_CREATE Create log with header data
BAL_LOG_DELETE Delete log (from database also at Save)
BAL_LOG_EXIST Check existence of a log in memory
BAL_LOG_HDR_CHANGE Change log header
BAL_LOG_HDR_CHECK Check log header data for consistency
BAL_LOG_HDR_READ Read log header and other data
BAL_LOG_MSG_ADD Put message in log
BAL_LOG_MSG_ADD Put message in log
BAL_LOG_MSG_CHANGE Change message
BAL_LOG_MSG_CHANGE Change message
BAL_LOG_MSG_CHECK Check message data for consistency
BAL_LOG_MSG_CUMULATE Add message cumulated
BAL_LOG_MSG_DELETE Delete message
BAL_LOG_MSG_DELETE Delete message
BAL_LOG_MSG_EXIST Check existence of a message in memory
BAL_LOG_MSG_READ Read message and other data
BAL_LOG_MSG_REPLACE Replace last message
BAL_LOG_REFRESH Delete log from memory
BAL_LOG_REFRESH Delete log from memory
BAL_MSG_DISPLAY_ABAP Output message as ABAP-MESSAGE
BAL_OBJECT_SELECT Read Application Log objects table record
BAL_OBJECT_SUBOBJECT Check whether object and subobject exist and the combination is allowed
BAL_SUBOBJECT_SELECT Read subobject table record
BP_EVENT_RAISE Trigger an event from ABAP/4 program
BP_JOBLOG_READ Fetch job log executions
CHANGEDOCUMENT_READ_HEADERS Get the change document header for a sales document, and put the results in an internal table.

Example:
CALL FUNCTION ‘CHANGEDOCUMENT_READ_HEADERS’

EXPORTING

objectclass = ‘EINKBELEG’

objectid = l_objectid

username = space

TABLES

i_cdhdr = lt_cdhdr.

LOOP AT lt_cdhdr WHERE udate IN s_aedat.

CALL FUNCTION ‘CHANGEDOCUMENT_READ_POSITIONS’

EXPORTING

changenumber = lt_cdhdr-changenr

TABLES

editpos = lt_editpos.

LOOP AT lt_editpos WHERE fname = ‘LOEKZ’

AND f_new = ‘L’.

p_desc = text-r01. ” Cancel Contract

ENDLOOP.

ENDLOOP. |

CHANGEDOCUMENT_READ_POSITIONS
Get the details of a change document, and store them in an internal table. This will tell you whether a field was changed, deleted, or updated.

Example:
CALL FUNCTION ‘CHANGEDOCUMENT_READ_HEADERS’

EXPORTING

objectclass = ‘EINKBELEG’

objectid = l_objectid

username = space

TABLES

i_cdhdr = lt_cdhdr.

LOOP AT lt_cdhdr WHERE udate IN s_aedat.

CALL FUNCTION ‘CHANGEDOCUMENT_READ_POSITIONS’

EXPORTING

changenumber = lt_cdhdr-changenr

TABLES

editpos = lt_editpos.

LOOP AT lt_editpos WHERE fname = ‘LOEKZ’

AND f_new = ‘L’.

p_desc = text-r01. ” Cancel Contract

ENDLOOP.

ENDLOOP. |

 

CLAF_CLASSIFICATION_OF_OBJECTS Return all of the characteristics for a material
CLOI_PUT_SIGN_IN_FRONT Move the negative sign from the left hand side of a number, to the right hand side of the number. Note that The result will be left justified (like all character fields), not right justifed as numbers normally are.
CLPB_EXPORT Export a text table to the clipboard (on presentation server)
CLPB_IMPORT Import a Text Table from the Clipboard (on presentation server)
COMMIT_TEXT To load long text into SAP
CONVERSION_EXIT_ALPHA_INPUT converts any number into a string fill with zeroes, with the number at the extreme right
Example:
input = 123

output = 0000000000000…000000000000123 |

CONVERSION_EXIT_ALPHA_OUTPUT
converts any number with zeroes right into a simple integer

Example:
input = 00000000000123

 

CONVERT_ABAPSPOOLJOB_2_PDF convert abap spool output to PDF
CONVERT_OTF Convert SAP documents (SAPScript) to other types.

Example:
CALL FUNCTION “CONVERT_OTF”

EXPORTING FORMAT = “PDF”

IMPORTING BIN_FILESIZE = FILE_LEN

TABLES OTF = OTFDATA

LINES = PDFDATA

EXCEPTIONS ERR_MAX_LINEWIDTH = 1

ERR_FORMAT = 2

ERR_CONV_NOT_POSSIBLE = 3

OTHERS = 4. |

CONVERT_OTFSPOOLJOB_2_PDF converts a OTF spool to PDF (i.e. Sapscript document)
CONVERT_TO_FOREIGN_CURRENCY Convert local currency to foreign currency.
CONVERT_TO_LOCAL_CURRENCY Convert from foreign currency to local currency
DATE_CHECK_PLAUSIBILITY Check to see if a date is in a valid format for SAP. Works well when validating dates being passed in from other systems.
DATE_COMPUTE_DAY Returns a number indicating what day of the week the date falls on. Monday is returned as a 1, Tuesday as 2, etc.
DATE_GET_WEEK will return the week that a date is in.
DATE_IN_FUTURE Calculate a date N days in the future.
DAY_ATTRIBUTES_GET Return useful information about a day. Will tell you the day of the week as a word (Tuesday), the day of the week (2 would be Tuedsay), whether the day is a holiday, and more.(provided by Francois Henrotte)
DOWNLOAD download a file to the presentation server (PC)
DYNP_VALUES_READ Read the values from a dynpro. This function can be used to read the values from a report’s selection screen too (Another example).
DYNP_VALUES_UPDATE Similar to DYNP_VALUES_READ, this function will allow the updating of fields on a dynpro. Very useful when you want to change a field based on the value entered for another field.
ENQUE_SLEEP Wait a specified period of time before continuing processing.
ENQUEUE_ESFUNCTION Lock an abap program so that it cannot be executed.

List of ABAP-transaction codes related to SAP security

S. No. Transaction Code Purpose
1 SU01 To create and maintain the users.
2 SU01D To Display Users
3 SU10 For mass maintenance.
4 SU02 For Manual creation of profiles.
5 SU03 For Manual creation of authorization.
6 SU3 For setting Address and default parameters.
7 PFCG For maintaining role using profile generator.
8 PFUD For Comparing User master in Dialog.
9 SUPC For generation of Mass profile.
10 SU24 For Maintaining Check Indicators and for Maintaining templates.
11 SU25 For initial Customer table fill.
12 SU20 Lists down the authorization fields.
13 SU21 Lists the Object classes and authorization objects.
14 SM01 For locking the transaction from execution.
15 SM19 Security audit – configuration.
16 SM20 Security audit – reporting.
17 SM30 For creation of table authorization groups and for maintaining assignments to tables
18 SCCL For Local Client Copy on same system between different clients.
19 SCC9 For data exchange over the network and remote client copy between clients in different systems.
20 SCC8 Data exhange happens at operating system level, it supports Client transport.
21 STMS Transport Management System
22 RZ10 Profile configuration
23 RZ11 Maintain profile parameters
24 SU53 To display last authority check that failed
25 SU56 Display User buffer
26 SE84 Information System for SAP R/3 Authorizations
27 SECR Audit Information System
28 SE43 Maintain and display Area Menus
29 ST01 System Trace
30 SUGR Maintain User groups
31 SUIM User Information System
32 SU05 Maintain Internet Users
33 SMLG Maintain Logon Group
34 ST02 Setups/Tune Buffers
35 SM02 System Messages
36 SM04 User Overview
37 SM12 Display and Delete Locks
38 SM13 Display Update Records
39 SM21 System Log
40 SM50 Work Process Overview
41 SM51 List of SAP Servers
42 SM59 Display/Maintain RFC Destinations
43 ST11 Display Developer Traces and error log files
44 ST22 ABAP/4 Runtime Error Analysis
45 SM35 Batch Input Monitoring
46 ST05 Performance trace

 

List of slis_fieldcat_alv

row_pos        like sy-curow, ” output in row
col_pos        like sy-cucol, ” position of the column
fieldname      type slis_fieldname,
tabname        type slis_tabname,
currency(5)    type c,
cfieldname     type slis_fieldname, ” field with currency unit
ctabname       type slis_tabname,   ” and table
ifieldname     type slis_fieldname, ” initial column
quantity(3)    type c,
qfieldname     type slis_fieldname, ” field with quantity unit
qtabname       type slis_tabname,   ” and table
round          type i,        ” round in write statement
exponent(3)       type c,     ” exponent for floats
key(1)         type c,        ” column with key-color
icon(1)        type c,        ” as icon
symbol(1)      type c,        ” as symbol
checkbox(1)    type c,        ” as checkbox
just(1)        type c,        ” (R)ight (L)eft (C)ent.
lzero(1)       type c,        ” leading zero
no_sign(1)     type c,        ” write no-sign
no_zero(1)     type c,        ” write no-zero
no_convext(1)  type c,
edit_mask      type slis_edit_mask,                ”
emphasize(4)   type c,        ” emphasize
fix_column(1)   type c,       ” Spalte fixieren
do_sum(1)      type c,        ” sum up
no_out(1)      type c,        ” (O)blig.(X)no out
tech(1)        type c,        ” technical field
outputlen      like dd03p-outputlen,
offset         type dd03p-outputlen,     ” offset
seltext_l      like dd03p-scrtext_l, ” long key word
seltext_m      like dd03p-scrtext_m, ” middle key word
seltext_s      like dd03p-scrtext_s, ” short key word
ddictxt(1)     type c,        ” (S)hort (M)iddle (L)ong
rollname       like dd03p-rollname,
datatype       like dd03p-datatype,
inttype        like dd03p-inttype,
intlen         like dd03p-intlen,
lowercase      like dd03p-lowercase,

ABAP List Viewer

ABAP List Viewer

This is an escort for creating ABAP List Viewer (ALV) report. In creating ALV, first you must do are :

  1. Add line“type-pools : slis” in your program.
  2. Create functional ALV procedures which is :
    1. Category Fields

This functions for registry which fields will be display on the report.

  1. Layout

Configuring layout properties of ALV reports.

  1. Color

Configuring color layout in ALV report.

  1. Event

before call procedure Comment, call this function first.

  1. Sort and Subtotal

Configuring ALV Sort and Subtotal Function

  1. Group
  1. Comment

Configuring header and Footer ALV report.

  1. Filter

Configuring ALV filter.

  1. Print

Configuring for ALV Report Printing

  1. Call function “REUSE_ALV_LIST_DISPLAY” in background mode (outside of Start-Of-Selection), this function for execute the ALV report program.  Fill the parameter :
    1. I_CALLBACK_PROGRAM with Program ID (Sy-REPID)
    2. I_STRUCTURE_NAME with internal table name or structure table name
    3. IS_LAYOUT with data which has been set in procedure Layout
    4. IT_FIELDCAT with table which has been set in procedure Category Fields.
    5. IT_FILTER with Filter Data
    6. IT_SPECIAL_GROUPS with Groups data
    7. IT_EVENTS with Event data
    8. IT_SORT with Sort Data
    9. IS_PRINT with Print Data
    10. Tables T_OUTTAB with your

C a t e g o r y  F i e l d s

Category Fields are fields which will be display on ALV Report. You must create variable with type slis_t_fieldcat_alv. Then make procedure which set property of that variable.

Here is the structure of Structure slis_t_fieldcat_alv.

TYPES: BEGIN OF SLIS_FIELDCAT_MAIN,

ROW_POS        LIKE SY-CUROW, ” output in row

COL_POS        LIKE SY-CUCOL, ” position of the column

FIELDNAME      TYPE SLIS_FIELDNAME,

TABNAME        TYPE SLIS_TABNAME,

REF_FIELDNAME  LIKE DD03P-FIELDNAME,

REF_TABNAME    LIKE DD03P-TABNAME,

CFIELDNAME     TYPE SLIS_FIELDNAME, ” field with currency unit

CTABNAME       TYPE SLIS_TABNAME,   ” and table

QFIELDNAME     TYPE SLIS_FIELDNAME, ” field with quantity unit

QTABNAME       TYPE SLIS_TABNAME,   ” and table

ROUNDFIELDNAME TYPE SLIS_FIELDNAME,

ROUNDTABNAME   TYPE SLIS_TABNAME,

ROUND          TYPE I,        ” round in write statement

DECIMALSFIELDNAME TYPE SLIS_FIELDNAME,

DECIMALSTABNAME   TYPE SLIS_TABNAME,

DECIMALS_OUT(6)   TYPE C,   ” decimals in write statement

EXPONENT(3)       TYPE C,   ” exponent for floats

KEY(1)         TYPE C,        ” column with key-color

ICON(1)        TYPE C,        ” as icon

SYMBOL(1)      TYPE C,        ” as symbol

CHECKBOX(1)    TYPE C,        ” as checkbox

JUST(1)        TYPE C,        ” (R)ight (L)eft (C)ent.

LZERO(1)       TYPE C,        ” leading zero

NO_SIGN(1)     TYPE C,        ” write no-sign

NO_ZERO(1)     TYPE C,        ” write no-zero

EDIT_MASK      TYPE SLIS_EDIT_MASK, ”

EMPHASIZE(4)   TYPE C,        ” emphasize

FIX_COLUMN(1)   TYPE C,       ” Spalte fixieren

DO_SUM(1)      TYPE C,        ” sum up

NO_OUT(1)      TYPE C,        ” (O)blig.(X)no out

TECH(1)        TYPE C,        ” technical field

OUTPUTLEN      LIKE DD03P-OUTPUTLEN,

SELTEXT_L      LIKE DD03P-SCRTEXT_L, ” long key word

SELTEXT_M      LIKE DD03P-SCRTEXT_M, ” middle key word

SELTEXT_S      LIKE DD03P-SCRTEXT_S, ” short key word

REPTEXT_DDIC   LIKE DD03P-REPTEXT,   ” heading (ddic)

DDICTXT(1)     TYPE C,        ” (S)hort (M)iddle (L)ong

ROLLNAME       LIKE DD03P-ROLLNAME,

*        domname        like dd03p-domname,     “Domname für Checkbox

DATATYPE       LIKE DD03P-DATATYPE,

DDIC_OUTPUTLEN LIKE DD03P-OUTPUTLEN,

INTLEN         LIKE DD03P-INTLEN,

END OF SLIS_FIELDCAT_MAIN.

 

TYPES: BEGIN OF SLIS_FIELDCAT_ALV_SPEC,

KEY_SEL(1)     TYPE C,        ” field not obligatory

NO_SUM(1)      TYPE C,        ” do not sum up

SP_GROUP(1)    TYPE C,        ” group specification

REPREP(1)      TYPE C,        ” selection for rep/rep

INPUT(1)       TYPE C,        ” input

HOTSPOT(1)     TYPE C,        ” hotspot

END OF SLIS_FIELDCAT_ALV_SPEC.

 

TYPES: BEGIN OF SLIS_FIELDCAT_ALV.

INCLUDE TYPE SLIS_FIELDCAT_MAIN.

INCLUDE TYPE SLIS_FIELDCAT_ALV_SPEC.

TYPES: END OF SLIS_FIELDCAT_ALV.

TYPES: SLIS_T_FIELDCAT_ALV TYPE SLIS_FIELDCAT_ALV OCCURS 1.

After you set the properties, it will be use in executing ALV reports.

Take a look at this example :

 

FORM FIELDCAT_INIT.

DATA: FIELDCAT_IN TYPE SLIS_FIELDCAT_ALV.

CLEAR FIELDCAT_IN.

*– add matnr –

CLEAR FIELDCAT_IN.

FIELDCAT_IN-FIELDNAME = ‘MATNR’.

FIELDCAT_IN-REF_FIELDNAME = ‘MATNR’.

FIELDCAT_IN-REF_TABNAME = ‘MARA’.

FIELDCAT_IN-OUTPUTLEN = 20.

APPEND FIELDCAT_IN TO GT_FIELDCAT.

*– add matkl –

CLEAR FIELDCAT_IN.

FIELDCAT_IN-FIELDNAME = ‘MATKL’.

FIELDCAT_IN-REF_FIELDNAME = ‘MATKL’.

FIELDCAT_IN-REF_TABNAME = ‘MARA’.

FIELDCAT_IN-OUTPUTLEN = 20.

FIELDCAT_IN-HOTSPOT = ‘X’.

FIELDCAT_IN-SELTEXT_L = ‘Material Type (MATKL)’.

FIELDCAT_IN-EMPHASIZE = ‘C700′.

APPEND FIELDCAT_IN TO GT_FIELDCAT.

*– add mtart –

CLEAR FIELDCAT_IN.

FIELDCAT_IN-FIELDNAME = ‘MTART’.

FIELDCAT_IN-REF_FIELDNAME = ‘MTART’.

FIELDCAT_IN-REF_TABNAME = ‘MARA’.

FIELDCAT_IN-NO_OUT = ”.

FIELDCAT_IN-OUTPUTLEN = 20.

APPEND FIELDCAT_IN TO GT_FIELDCAT.

ENDFORM.

 

Of course we can see that if you want to show more than one field Use it like you use internal table.

L a y o u t

This properties gives you, you can configure what you want about the layout of ALV report. Here is the structure of Layout properties plus brief explanation.

 

TYPES: BEGIN OF SLIS_LAYOUT_MAIN,

DUMMY,

END OF SLIS_LAYOUT_MAIN.

 

TYPES: BEGIN OF SLIS_LAYOUT_ALV_SPEC,

*        Display options

COLWIDTH_OPTIMIZE(1) TYPE C,

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_MIN_LINESIZE(1) TYPE C,    ” line size = width of the list

MIN_LINESIZE LIKE SY-LINSZ,   ” if initial min_linesize = 80

MAX_LINESIZE LIKE SY-LINSZ,   ” Default 250

WINDOW_TITLEBAR LIKE RSMPE-TITTEXT,

*      Exceptions

LIGHTS_FIELDNAME TYPE SLIS_FIELDNAME,” fieldname for exception

LIGHTS_TABNAME TYPE SLIS_TABNAME, ” fieldname for exception

LIGHTS_ROLLNAME LIKE DFIES-ROLLNAME,” rollname f. exceptiondocu

LIGHTS_CONDENSE(1) TYPE C,    ” fieldname for exception

*        Sums

NO_SUMCHOICE(1) TYPE C,       ” no choice for summing up

NO_TOTALLINE(1) TYPE C,       ” no total line

NO_SUBCHOICE(1) TYPE C,       ” no choice for subtotals

NO_SUBTOTALS(1) TYPE C,       ” no subtotals possible

NUMC_SUM(1)     TYPE C,       ” totals for NUMC-Fields possib.

TOTALS_ONLY(1) TYPE C,        ” show only totals

TOTALS_TEXT(60) TYPE C,       ” text for 1st col. in total line

SUBTOTALS_TEXT(60) TYPE C,    ” text for 1st col. in subtotals

*      Interaction

BOX_FIELDNAME TYPE SLIS_FIELDNAME, ” fieldname for checkbox

BOX_TABNAME TYPE SLIS_TABNAME,” tabname for checkbox

EXPAND_FIELDNAME TYPE SLIS_FIELDNAME, ” fieldname flag ‘expand’

HOTSPOT_FIELDNAME TYPE SLIS_FIELDNAME, ” fieldname flag hotspot

NO_INPUT(1) TYPE C,           ” only display fields

F2CODE LIKE SY-UCOMM,       ”

CONFIRMATION_PROMPT,          ” confirm. prompt when leaving

KEY_HOTSPOT(1) TYPE C,        ” keys as hotspot ” K_KEYHOT

REPREP(1) TYPE C,             ” report report interface active

GROUP_BUTTONS(1) TYPE C,      ” buttons for COL1 – COL5

NO_KEYFIX(1) TYPE C,          ” do not fix keycolumns

GET_SELINFOS(1) TYPE C,       ” read selection screen

GROUP_CHANGE_EDIT(1) TYPE C,  ” Settings by user for new group

NO_SCROLLING(1) TYPE C,        ” no scrolling

*        Detailed screen

DETAIL_POPUP(1) TYPE C,       ” show detail in popup

DETAIL_INITIAL_LINES(1) TYPE C, ” show also initial lines

DETAIL_TITLEBAR(30) TYPE C,   ” Titlebar for detail

*        Display variants

HEADER_TEXT(20) TYPE C,       ” Text for header button

ITEM_TEXT(20) TYPE C,         ” Text for item button

DEFAULT_ITEM(1) TYPE C,       ” Items as default

*       colour

INFO_FIELDNAME TYPE SLIS_FIELDNAME, ” infofield for listoutput

COLTAB_FIELDNAME TYPE SLIS_FIELDNAME, ” colors

*        others

LIST_APPEND(1) TYPE C,        ” no call screen

END OF SLIS_LAYOUT_ALV_SPEC.

 

TYPES: BEGIN OF SLIS_LAYOUT_ALV.

INCLUDE TYPE SLIS_LAYOUT_MAIN.

INCLUDE TYPE SLIS_LAYOUT_ALV_SPEC.

TYPES: END OF SLIS_LAYOUT_ALV.

 

C o l o r

Below is structure for Color in ALV Report.

 

TYPES: BEGIN OF SLIS_COLOR,

COL TYPE I,

INT TYPE I,

INV TYPE I,

END OF SLIS_COLOR.

 

TYPES: BEGIN OF SLIS_COLTYPES,

HEACOLFIR      TYPE SLIS_COLOR, ” heading_cols_first

HEACOLNEX      TYPE SLIS_COLOR, ” heading_cols_nex

HEAROWFIR      TYPE SLIS_COLOR, ” heading_rows_first

HEAROWNEX      TYPE SLIS_COLOR, ” heading_rows_next

LISBODFIR      TYPE SLIS_COLOR, ” list_body_first

LISBODNEX      TYPE SLIS_COLOR, ” list_body_next

LISBOD         TYPE SLIS_COLOR, ” list_body

HIGCOLKEY      TYPE SLIS_COLOR, ” highlight_col_key

HIGCOL         TYPE SLIS_COLOR, ” highlight_col

HIGROW         TYPE SLIS_COLOR, ” highlight_row

HIGSUM         TYPE SLIS_COLOR, ” highlight_sum

HIGSUMHIG      TYPE SLIS_COLOR, ” highlight_sum_high

HIGSUMLOW      TYPE SLIS_COLOR, ” highlight_sum_low

HIGINS         TYPE SLIS_COLOR, ” highlight_inserted

HIGPOS         TYPE SLIS_COLOR, ” highlight_positive

HIGNEG         TYPE SLIS_COLOR, ” highlight_negative

HIG            TYPE SLIS_COLOR, ” highlight

HEAHIE         TYPE SLIS_COLOR, ” heading_hier

LISBODHIE      TYPE SLIS_COLOR, ” list_body_hierinfo

END OF SLIS_COLTYPES.

You can give touch of color for your report by setting this properties.

Examples of using.

E v e n t

With this function we can handle event. The way to handle is

first you must call function “REUSE_ALV_EVENTS_GET” with input parameter  of I_LIST_TYPE with value :

  1. 0 : Simple List (default)
  2. 1 : Hierarchy – sequential List
  3. 2 : Simple Block List
  4. 3 : Hierarchy – sequential block list

NB: I still don’t know what the differences for each type

and Output parameter of ET_EVENTS with table which has type SLIS_T_EVENT.

Here is the constants for Event Constants.

CONSTANTS:

* Events

SLIS_EV_ITEM_DATA_EXPAND   TYPE SLIS_FORMNAME VALUE ‘ITEM_DATA_EXPAND’,

SLIS_EV_CALLER_EXIT_AT_START TYPE SLIS_FORMNAME VALUE ‘CALLER_EXIT’,

SLIS_EV_USER_COMMAND       TYPE SLIS_FORMNAME VALUE ‘USER_COMMAND’,

SLIS_EV_TOP_OF_PAGE        TYPE SLIS_FORMNAME VALUE ‘TOP_OF_PAGE’,

SLIS_EV_TOP_OF_COVERPAGE   TYPE SLIS_FORMNAME VALUE ‘TOP_OF_COVERPAGE’,

SLIS_EV_END_OF_COVERPAGE   TYPE SLIS_FORMNAME VALUE ‘END_OF_COVERPAGE’,

SLIS_EV_FOREIGN_TOP_OF_PAGE TYPE SLIS_FORMNAME

VALUE ‘FOREIGN_TOP_OF_PAGE’,

SLIS_EV_FOREIGN_END_OF_PAGE TYPE SLIS_FORMNAME

VALUE ‘FOREIGN_END_OF_PAGE’,

SLIS_EV_PF_STATUS_SET      TYPE SLIS_FORMNAME VALUE ‘PF_STATUS_SET’,

SLIS_EV_LIST_MODIFY        TYPE SLIS_FORMNAME VALUE ‘LIST_MODIFY’,

SLIS_EV_TOP_OF_LIST        TYPE SLIS_FORMNAME VALUE ‘TOP_OF_LIST’,

SLIS_EV_END_OF_PAGE        TYPE SLIS_FORMNAME VALUE ‘END_OF_PAGE’,

SLIS_EV_END_OF_LIST        TYPE SLIS_FORMNAME VALUE ‘END_OF_LIST’,

SLIS_EV_AFTER_LINE_OUTPUT  TYPE SLIS_FORMNAME VALUE ‘AFTER_LINE_OUTPUT’,

SLIS_EV_BEFORE_LINE_OUTPUT TYPE SLIS_FORMNAME VALUE                                                 ‘BEFORE_LINE_OUTPUT’.

 

Below is Structure of SLIS_T_EVENT.

 

*— Structure for event handling

TYPES: BEGIN OF SLIS_ALV_EVENT,

NAME(30),

FORM(30),

END OF SLIS_ALV_EVENT.

TYPES: SLIS_T_EVENT TYPE SLIS_ALV_EVENT OCCURS 0.

 

Then you can check what events has occured. by Check the SLIS_ALV_EVENT-NAME with event – constants. Check the code below.

 

FORM EVENTTAB_BUILD.

DATA: LS_EVENT TYPE SLIS_ALV_EVENT.

CALL FUNCTION ‘REUSE_ALV_EVENTS_GET’

EXPORTING

I_LIST_TYPE     = 0

IMPORTING

ET_EVENTS       = GT_EVENTS

EXCEPTIONS

LIST_TYPE_WRONG = 1

OTHERS          = 2.

 

*  check what event has occured.

READ TABLE GT_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE

INTO LS_EVENT.

*  if event occured.

IF SY-SUBRC = 0.

MOVE GC_FORMNAME_TOP_OF_PAGE TO LS_EVENT-FORM.

APPEND LS_EVENT TO GT_EVENTS.

ENDIF.

ENDFORM.

Note: You must call this function before creating call function COMMENT.

 

S o r t   a n d    S u b t o t a l

Below is Structure Sort (SLIS_T_SORTINFO_ALV).

* information for sort and subtotals

TYPES: BEGIN OF SLIS_SORTINFO_ALV,

SPOS LIKE ALVDYNP-SORTPOS,

FIELDNAME TYPE SLIS_FIELDNAME,

TABNAME TYPE SLIS_FIELDNAME,

UP LIKE ALVDYNP-SORTUP,                 “Ascending

DOWN LIKE ALVDYNP-SORTDOWN,       “Descending

GROUP LIKE ALVDYNP-GROUPLEVEL,   “Grouping

SUBTOT LIKE ALVDYNP-SUBTOTALS,    “Field Subtotal

COMP(1) TYPE C,

EXPA(1) TYPE C,

END OF SLIS_SORTINFO_ALV.

TYPES: SLIS_T_SORTINFO_ALV TYPE SLIS_SORTINFO_ALV OCCURS 1.

Every field to be configured is added to SLIS_T_SORTINFO_ALV. This table will be use as input parameter of function “REUSE_ALV_LIST_DISPLAY”.
G r o u p

not yet studied.

C o m m e n t

This function use for creating header and footer ALV report. This is the structure for use Comment.

 

* Header table for top of page

TYPES: BEGIN OF SLIS_LISTHEADER,

TYP(1) TYPE C,   ” H = Header, S = Selection, A = Action

KEY(20) TYPE C,

INFO TYPE SLIS_ENTRY,

END OF SLIS_LISTHEADER.

TYPES: SLIS_T_LISTHEADER TYPE SLIS_LISTHEADER OCCURS 1.

Take a look code below.

Data GT_LIST_TOP_PAGE type slis_t_listheader.

FORM COMMENT_BUILD.

DATA: GS_LINE TYPE SLIS_LISTHEADER, TEXT(60) TYPE C.

GS_LINE-TYP = ‘H’.

GS_LINE-INFO = ‘Hello Header’.

APPEND GS_LINE TO GT_LIST_TOP_PAGE.

ENDFORM.

 

It will pring ‘Hello Header’ in top-of-page ALV report.
F i l t e r

 

P r i n t

This standard Type in SLIS type-groups.

 

TYPES: SLIS_LIST_TYPE(1) TYPE N,

SLIS_CHAR_1(1) TYPE C,

SLIS_TEXT40(40) TYPE C.

TYPES: SLIS_TABNAME(30) TYPE C,

SLIS_FIELDNAME(30) TYPE C,

SLIS_FORMNAME(30) TYPE C,

SLIS_ENTRY(60) TYPE C,

SLIS_EDIT_MASK(60) TYPE C,

SLIS_COLDESC(4) TYPE C.

author by Sandi Wijaya

INFORMATION