+ All Categories
Home > Documents > SM30 Events

SM30 Events

Date post: 13-Oct-2015
Category:
Upload: joanteaj-ta
View: 400 times
Download: 12 times
Share this document with a friend
26
http://help.sap.com/SAPHELP_NW04S/helpdata/en/91/ca9f0ea9 d111d1a5690000e82deaaa/content.htm Extended Table Maintenance Events Events allow you to change the generated table maintenance dialog at predefined positions, which cannot be reached by user modules in the screen flow logic. The user routines are called dynamically at runtime. For this reason, the routines must be in a user include in the table/view maintenance dialog function group. All extended table maintenance global data is available. An interface is only required for events 22 and AF. The events can be additions or replacements. Additional events Event 01 before saving the data in the database  Event 01: Before Saving the Data in the Database Use This event occurs before new, changed or deleted entries are written to the database. Other activities can be performed, for example:  hidden entry processing  fill hidden fields  flag data to be written to hidden tables after the database ch ange. To have the changes saved by the central maintenance dialog routines, SY-SUBRC must be set to 0 at the end of the routine. Realization This event has no standard routine. The following global data is available for the realization of the user routine:  internal table TOTAL  field symbols o field symbols <ACTION> and <ACTION_TEXT> o <STATUS>-UPD_FLAG If internal table data are to be changed before saving, t he changes should be made in both the internal table TOTAL and in the internal table EXTRACT. 
Transcript

http://help.sap.com/SAPHELP_NW04S/helpdata/en/91/ca9f0ea9d111d1a5690000e82deaaa/content.htm

Extended Table Maintenance Events Events allow you to change the generated table maintenance dialog at predefined positions, which cannot be reached by user modules in the screen flow logic.The user routines are called dynamically at runtime. For this reason, the routines must be in a user include in the table/view maintenance dialog function group. All extended table maintenance global data is available. An interface is only required for events 22 and AF.The events can be additions or replacements.Additional eventsEvent 01 before saving the data in the database

Event 01: Before Saving the Data in the Database UseThis event occurs before new, changed or deleted entries are written to the database. Other activities can be performed, for example: hidden entry processing fill hidden fields flag data to be written to hidden tables after the database change.

To have the changes saved by the central maintenance dialog routines, SY-SUBRC must be set to 0 at the end of the routine.RealizationThis event has no standard routine. The following global data is available for the realization of the user routine: internal table TOTAL field symbols field symbols and -UPD_FLAGIf internal table data are to be changed before saving, t he changes should be made in both the internal table TOTAL and in the internal table EXTRACT.

FORM abc.DATA: F_INDEX LIKE SY-TABIX. "Index to note the lines foundLOOP AT TOTAL.IF = desired constant.READ TABLE EXTRACT WITH KEY .IF SY-SUBRC EQ 0.F_INDEX = SY-TABIX.ELSE.CLEAR F_INDX.ENDIF.(make desired changes to the line TOTAL)MODIFY TOTAL.CHECK F_INDX GT 0.EXTRACT = TOTAL.MODIFY EXTRACT INDEX F_INDX.ENDIF.ENDLOOP.SY-SUBRC = 0.ENDFORM.

Event 02 after saving the data in the database

Event 02: After Saving the Data in the Database UseThis event occurs as soon as the data have been written to the database. Other activities can be performed, for example: maintain hidden tables link to application log.RealizationThis event has no standard routine. The internal table TOTAL. is available for the realization of the individual routines:

Event 03 before deleting data in the display

Event 03: Before Deleting the Display Data UseThis event occurs before selected entries are sent to the trash with the 'Delete' function. Other activities can be performed, for example checking whether the entries can be deleted.RealizationThis event has no standard routine. The following global data is available for the realization of the user routine: internal table EXTRACT. field symbols and global variable NEXTLINE

Select additional information

Event 04 after deleting data in the display

Event 04: After Deleting the Display Data UseThis event occurs after selected entries have been sent to the trash with the 'Delete' function. Other activities can be performed, for example: fill hidden fields adjust user internal data send a user message.

If the selection flag has the constant value UEBERGEHEN and no user message is to be output, no user routine is required.RealizationThis event has no standard routine. The following global data is available for the realization of the user routine: internal table EXTRACT. field symbols and global variable NEXTLINE

Select additional information

Event 05 when inserting a new entry

Event 05: When Creating a New Entry UseThis event occurs when a new entry is made with the function 'New entry' or 'Copy'. Other activities can be performed, for example: plausibility checks hidden field handling (see event 21 Filling hidden fields) update user internal tables.RealizationThis event has no standard routine. The table/view fields can be used for the realization of the user routine.

Event 06 after completely performing the function 'Get original'

Event 06: After the 'Get Original' Function UseThis event occurs after the function 'Get original' for all selected entries. Other activities can be performed, for example: fill hidden fields initialize hidden fields update user internal tables.RealizationThis event has no standard routine. The following global data is available for the realization of the user routine: internal table EXTRACT. field symbols and global variable NEXTLINE

Select additional information

Event 07 before correcting the contents of a selected field

Event 07: Before Correcting the Contents of a Selected Field UseThis event occurs when the 'Change field contents' function is called. Other activities can be performed for the selected entries, for example: check whether the entries field can be changed fill hidden fields update user internal tables.RealizationThis event has no standard routine. The following global data is available for the realization of the user routine: internal table EXTRACT.The entries to be handled are in overview screen as marked entries in the internal table EXTRACT detail screen in the header line of the internal table EXTRACT or in the field symbol . field symbols and global variable NEXTLINE SEL_FIELD_FOR_REPLACEThe variable contains the technical name of the field which was selected for the change.

In view V_T001 the field 'LAND1' is selected in the function 'Change field contents...' SEL_FIELD_FOR_REPLACE is then 'LAND1'. SEL_FIELD_FOR_REPLACE_LThe variable contains the technical name of the table/view field which was selected for the change.

In view V_T001 the field 'LAND1' is selected in the function 'Change field contents...' SEL_FIELD_FOR_REPLACE_L is then 'V_T001-LAND1'.

Select additional information

Event 08 after correcting the contents of a selected field

Event 08: After Correcting the Contents of a Selected Field UseThis event occurs after the 'Change field contents' function. Other activities can be performed, for example: fill hidden fields update user internal tables.

You cannot tell which entries were handled. If you want to know this, the entries must be noted at event 07 (before correcting the contents of a selected field) in a user internal table, for them to be available at event 08.RealizationThis event has no standard routine. The following global data is available for the realization of the user routine: internal table EXTRACT. field symbols and global variable NEXTLINE

Select additional information

Event 09 after 'Get original' for one entry

Event 09: After 'Get Original' for One Entry UseThis event occurs after the function 'Get original' for each selected entry. Other activities can be performed, for example: fill hidden fields initialize hidden fields update user internal tables.NoteOnly one entry is handled at a time. The entry returned is in the header line of the internal tables TOTAL and EXTRACT., and in the field symbol .RealizationThis event has no standard routine. The following global data is available for the realization of the user routine: table/view fields

Select additional information

Event 10 after creating the change request header entry

Event 10: After Creating the Change Req. Hdr Entries (E071) Execution : After creating the change request header entries (E071)UseThis event occurs after the standard change request header entry has been created. Other activities can be performed, for example: enter the header entries of other tables which are not in the view structure definition and are not assigned text tables, in the change request.These tables are not in the maintenance object description object list put other objects, for example hidden lockable objects, in the change request.RealizationThis event has no standard routine. The internal table VIM_CORR_OBJTAB must be enhanced in the user routine, see Additional transport information.

Event 11 after changing a key entry in the change request

Event 11: After Changing a Key Entry in the Change Req. (E071K) UseThis event occurs after an entry was made in the change request key list by choosing 'Save'. Other activities can be performed, for example: enter tables which were maintained in the background, and are not in the view structure definition and are not assigned text tables, in the key list.RealizationThis event has no standard routine. The following global data is available for the realization of the user routine: internal table EXTRACT. field symbols and variables CORR_ACTION, MASTER_NAME and MASTER_TYPEThe internal CORR_KEYTAB must be enhanced in the user routine, see Additional transport information.

Event 12 after changing the key entries in the change request

Event 12: After Changing a Key Entry in the Change Req. (E071K) UseThis event occurs after entries have been made in the change request key list by choosing 'Save'. Other activities can be performed, for example: enter tables which were maintained in the background, and are not in the view structure definition and are not assigned text tables, in the key list.The entries are not uniquely assigned to view records.RealizationThis event has no standard routine. The following global data is available for the realization of the user routine: internal table EXTRACT. field symbols and global variable NEXTLINEThe internal CORR_KEYTAB must be enhanced in the user routine, see Additional transport information.

Event 13 end processing (leave main function module)

Event 13: End Processing Execution : End of processing (leaving the main function module)UseThis event occurs when the maintenance dialog is left. Other activities can be performed, for example: reset user flags, initialize user fields, internal tables, initialize the function group local memory following activities determined by user settings

The main function module is VIEW_MAINTENANCE. The event only occurs when the table maintenance dialog is called as follows: parameterized transaction (call SM30) function module VIEW_MAINTENANCE_CALL function module VIEW_MAINTENANCE or VIEWFRAME_ for views or TABLEFRAME_) for tablesRealizationThis event has no standard routine.

Event 14 after lock/unlock in main function module

Event 14: After locking/unlocking in the main function module Execution : After locking/unlocking in the main function moduleUseThis event occurs when the processing mode changes (Display -> Change or Change -> Display) and after the maintenance dialog tables have been locked according to Data Dictionary information. Other activities can be performed, for example locking/unlocking other hidden tables.

The main function module is VIEW_MAINTENANCE. The event only occurs when the table maintenance dialog is called as follows: parameterized transaction (call SM30) function module VIEW_MAINTENANCE_CALL function module VIEW_MAINTENANCE or VIEWFRAME_ for views or TABLEFRAME_) for tables

Event 15 before retrieving deleted entries

Event 15: Before Retrieving Deleted Entries UseThis event occurs before entries are retrieved from the trash with the function 'Retrieve'. Other activities can be performed, for example checking whether the entries are prevented from being retrieved by other dependencies.RealizationThis event has no standard routine. The following global data is available for the realization of the user routine: internal table EXTRACT. field symbols and global variable NEXTLINE

Select additional information

Event 16 after retrieving deleted entries

Event 16: After Retrieving Deleted Entries UseThis event occurs after entries have been retrieved from the trash with the 'Retrieve' function. Other activities can be performed, for example: fill hidden fields update user internal tables. send a user message

If the selection flag has the constant value UEBERGEHEN and no user message is to be output, no user routine is required.RealizationThis event has no standard routine. The following global data is available for the realization of the user routine: internal table EXTRACT. field symbols and global variable NEXTLINE

Select additional information

Event 17 before printing entries

Event 17: Before Printing Entries

Do not use this event. Use Event 26 instead.UseThis event occurs before the 'Print' function. Other activities can be performed, for example: change the format of table/view fields for printing, include hidden fields for printing, Do not print fields which are not flagged as hidden in the Data Dictionary.RealizationThis event has no standard routine. The following global data is available for the realization of the user routine: internal table EXTRACT. field symbols and global variable NEXTLINE

Select additional information and Print additional information

Event 18 after the data change check

Event 18: After the Data Change Check UseThis event occurs after security-relevant changes have been made in the internal table TOTAL. Other activities can be performed, for example: check user internal tables for security-relevant changesRealizationThis event has no standard routine. The variable -UPD_FLAG is available for the realization of the user routine.

Event 19 after initializing global variables, field symbols, etc.

Event 19: After Init. Global Variables, Field Symbols, etc. UseThis event occurs when a table maintenance dialog is called. The function group local memory is initialized at each entry. Other activities can be performed, for example: to initialize user global data or internal tables, to change the maintenance screen title bar deactivate interface functions in the internal table EXCL_CUA_FUNCTRealizationThis event has no standard routine.

Event 20 after input in date subscreen (time-dep.tables/views) sapurl_link_0001_0020_0034Event 21 fill hidden fields

Event 21: Fill Hidden Fields UseThis event occurs when fields which are flagged in the Data Dictionary as 'hidden', are to be filled.RealizationThis event has no standard routine. The table/view fields are available for the realization of the user routine.

Event 22 go to long text maintenance for other languages

Event 22: Go to Long Text Maintenance for Other Languages UseThis event allows long text maintenance from the translation. In contrast to other events, this event affects the maintenance screen. When the event is assigned to the maintenance dialog, a pushbutton with the 'Display/change others' icon appears after each entry in the "Texts in other languages" maintenance screen.The event occurs when the user presses the pushbutton to go to the long text of the current entry.

The long text is processed (display, database accesses, etc.) by the user routine.RealizationThis event has no standard routine. In contrast to other events, the user routine must conform to the following interface convention:FORM xxxxxxx USING M_MODECHANGING TEXT_WA MODIF. input parameter M_MODEThe parameter M_MODE is of type CHAR length 1. It specifies whether the long text was called in display or change mode.Possible values: 'R' = display onlyThe maintenance dialog was called in display or transport mode, so the long text is only displayed. 'U' = changeThe maintenance dialog was called in change mode, so the long text can be maintained. Output parameter TEXT_WAThe parameter is a structure and represents the text table work area. It contains the text table entry selected by the user. Only the fields which appear on the maintenance screen are filled in TEXT_WA. Fields which do not appear on the maintenance screen are not filled in TEXT_WA. This allows you to set a flag for the existence of a long text which is to be put in the text table. Output parameter MODIFThe parameter is of type CHAR length 1. It copies changes to the parameter TEXT_WA into the internal table when the user returns from the long text maintenance. You must set the parameter to 'X' in the routine to ensure that parameter TEXT_WA changes are copied.

If the parameter TEXT_WA is changed without setting the parameter MODIF to 'X', the changes are not copied into the internal table .If the parameter TEXT_WA was modified although the long text maintenance was called in display mode ('R'), the change is not copied even if the parameter MODIF is set to 'X'.

Event 23 before calling address maintenance screen

Event 23: Before the Address Maintenance Screen Call UseThis event occurs before the address maintenance screen is displayed, i.e. before the ADDR_DIALOG_PREPARE function module call. The module is usually only used to set the address maintenance screen title. If the standard address maintenance screen does not satisfy your specific requirements, the maintenance screen can be configured context-dependently.RealizationThis event has no standard routine. The following global data is available for the realization of the user routine: the work area of the table or view. This contains the current entry for which the address is to be processed, from which the current context can be determined. global variables, which correspond to the interface parameter of the function module ADDR_DIALOG_PREPARE in the function group SZA1. These are: VIM_ADDR_FIELD_SELECTION corresponds to parameter FIELD_SELECTION VIM_ADDR_KEYWORDS corresponds to parameter KEYWORDS VIM_ADDR_TITLEBAR corresponds to parameter TITLEBAR VIM_ADDR_CHNG_DEFLT_COMM_TYPES corresponds to parameter CHANGE_DEFAULT_COMM_TYPES VIM_ADDR_FRAME_TEXT corresponds to parameter FRAME_TEXT VIM_ADDR_EXCLUDED_FUNCTIONS corresponds to parameter EXCLUDED_FUNCTIONSOf these variables only VIM_ADDR_TITLEBAR has as default value the standard maintenance screen title. All the other variables have the initial value, so that the address maintenance default applies. Actions to be performed at this event are: get the context from the table or view work area and assign function module interface parameters. set the relevant global variables (VIM_ADDR_..., see above). Irrelevant variables need not be handled because they get the address maintenance default.

FORM name. * FORM for event 23 for view V_HUGODATA: ADDR_KONTEXT TYPE C. * 1. get context:IF V_HUGO-F1 = 'OTTO'ADDR_KONTEXT = '1'. ELSEIF V_HUGO-F1 = 'ERWIN' AND V_HUGO-F2 = 'WALDEMAR'. ADDR_KONTEXT = '2'. ENDIF. * 2. set global variables:CASE ADDR_KONTEXT. WHEN '1'. * the first sort field in this context should be a required field. VIM_ADDR_FIELD_SELECTION+2(1) = '+'. WHEN '2'. * the first sort field in this context should be a required field, and the second* should be hidden. VIM_ADDR_FIELD_SELECTION+2(1) = '+'. VIM_ADDR_FIELD_SELECTION+4(1) = '-'. WHEN OTHERS. * the 'Transport zone' field should be a required field in this context.* (it is normally hidden)VIM_ADDR_FIELD_SELECTION+32(1) = '.'. ENDCASE. ENDFORM.

Event 25 at start of maintenance dialog

Event 25: At the Start of the Maintenance Dialog UseThis event calls an additional authorization check.RealizationYou can set the following global data in your routine to influence the program behaviour:VIM_AUTH_RC= 0if authorization check passed

= 4go to display mode

= 8cancel

You can send an I message after the check:VIM_AUTH_MSGIDmessage class

VIM_AUTH_MSGNOmessage number

VIM_AUTH_MSGV1VIM_AUTH_MSGV2VIM_AUTH_MSGV3VIM_AUTH_MSGV4Message variables

Event 26 before displayed data is output in a list

Event 26: Before Displayed Data is Output in a List UseThe function module REUSE_ALV_LIST_DISPLAY outputs the list. Other activities can be performed, for example: Change table/view field display format Print hidden fields Do not print fields which are not flagged as hidden in the Data Dictionary.RealizationThis event has no standard routine. The following global data is available for the realization of the user routine:NameREUSE_ALV_LIST_DISPLAY parameterPurposeDefault/Value

ALV_VALUE_TABInternal tableT_OUTTABContains output valuesfilled

VIM ALV_FCATInternal tableIT_FIELDCATField catalogDictionary value for table/view

VIM_ALV_VALUE_LENGTHParameter-For information only: Value table data record internal lengthdefined

VIM_ALV_CALLED_BYParameter-Routine which calls ALV_LIST_DISPLAYVIM_CALL_ALV

VIM_ALV_EVENTSInternal tableIT_EVENTSEvents to perform in list output contains TOP-OF-PAGE event definition

VIM_LIST_HEADERInternal tableIT_LIST_COMMENTARY (function module REUSE_ALV_COMMENTARY_WRITE)List header definitionfilled

VIM_ALV_VARIANTStructureIS_VARIANTVariant informationempty

VIM_ALV_LAYOUTStructureIS_LAYOUTLayout informationempty

If the internal table ALV_VALUE_TAB is empty immediately after the event, processing is cancelled. You can change the above parameters in your form routine to change the list structure.If these formatting options are insufficient, you can specify another form routine, with which you call the ABAP List Viewer, in the VIM_ALV_CALLED_BY field. The definition of this second form routine must have the form FORM TABLES alv_value_tab .The form routine is as follows:FORM :FIELD-SYMBOLS: TYPE slis_fieldcat_alv *1. Modify structure table... *1.1. check whether already doneREAD TABLE vim_alv_fcat WITH KEY field name = tabname = TRANSPORTING NO FIELDS.*1.2. if not yet done > modifyIF SY-SUBRC ...* Get field information for fields to be inserted* modify VIM_ALV_FCAT, e.g. APPEND or DELETE* 2. Modify value table, e.g. insert or remove fields in rowsLOOP AT ALV_VALUE_TAB. .........ENDLOOP. ENDFORM.See also the documentation of the function modules "REUSE_ALV_".Additional List Output InformationThe following internal tables must be modified to print or exclude additional fields: VIM_ALV_FCAT describes the structure of the data to be printed ALV_VALUE_TAB contains the data to be printed, according to the field catalog VIM_ALV_FCAT.

Event 27 after filling a GUID field

Event 27: After Filling a GUID Field UseThis event occurs if the current table/view has a GUID and the GUID field has a new value.A value can be entered by the New entry or Copy functions. Even if a maintenance dialog is processed in the background, e.g. when importing a BC Set or comparing tables, GUID fields are given new values.

If a table field is a GUID field, it is not visible on the frontend.The following activities are possible at event 27 after filling a GUID field: Fill other tables in the background Link the new GUID to other objects Check whether the field is to have a new or an existing GUID

An existing GUID could e.g. come from a comparison table or an imported BC Set.RealizationIn contrast to all other events, event 27 has interfaces. The form routine interface in event 27 is:*&--------------------------------------------------**& Form form name*&--------------------------------------------------** text*---------------------------------------------------** --> p_old_guid old value in GUID field*


Recommended