Você está na página 1de 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 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.
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.

FORM abc.
DATA: F_INDEX LIKE SY-TABIX. "Index to note the lines found
LOOP AT TOTAL.
IF <ACTION> = desired constant.
READ TABLE EXTRACT WITH KEY <vim_xtotal_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
Use
This 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.
Realization
This 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
Use
This 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.
Realization
This event has no standard routine. The following global data is available for the realization of the user routine:
internal table EXTRACT.
field symbols
o <XACT> and <XACT_TEXT>
o <XMARK>
global variable NEXTLINE

Select additional information

Event 04 after deleting data in the display

Event 04: After Deleting the Display Data
Use
This 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.
Realization
This event has no standard routine. The following global data is available for the realization of the user routine:
internal table EXTRACT.
field symbols
o <XACT> and <XACT_TEXT>
o <XMARK>
global variable NEXTLINE

Select additional information

Event 05 when inserting a new entry

Event 05: When Creating a New Entry
Use
This 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.
Realization
This 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
Use
This 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.
Realization
This event has no standard routine. The following global data is available for the realization of the user routine:
internal table EXTRACT.
field symbols
o <XACT> and <XACT_TEXT>
o <XMARK>
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
Use
This 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.
Realization
This 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
o overview screen as marked entries in the internal table EXTRACT
o detail screen in the header line of the internal table EXTRACT or in the field symbol <TABLE1>.
field symbols
o <XACT> and <XACT_TEXT>
o <XMARK>
global variable NEXTLINE
SEL_FIELD_FOR_REPLACE
The 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_L
The 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
Use
This 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.
Realization
This event has no standard routine. The following global data is available for the realization of the user routine:
internal table EXTRACT.
field symbols
o <XACT> and <XACT_TEXT>
o <XMARK>
global variable NEXTLINE

Select additional information

Event 09 after 'Get original' for one entry

Event 09: After 'Get Original' for One Entry
Use
This 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.
Note
Only 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 <TABLE1>.
Realization
This 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)
Use
This 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.
Realization
This 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)
Use
This 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.
Realization
This event has no standard routine. The following global data is available for the realization of the user routine:
internal table EXTRACT.
field symbols
o <XACT> and <XACT_TEXT>
o <XMARK>
variables CORR_ACTION, MASTER_NAME and MASTER_TYPE
The 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)
Use
This 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.
Realization
This event has no standard routine. The following global data is available for the realization of the user routine:
internal table EXTRACT.
field symbols
o <XACT> and <XACT_TEXT>
o <XMARK>
global variable NEXTLINE
The 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)
Use
This 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_<view name> for views or
TABLEFRAME_<function group name>) for tables
Realization
This 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 module
Use
This 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_<view name> for views or
TABLEFRAME_<function group name>) for tables

Event 15 before retrieving deleted entries

Event 15: Before Retrieving Deleted Entries
Use
This 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.
Realization
This event has no standard routine. The following global data is available for the realization of the user routine:
internal table EXTRACT.
field symbols
o <XACT> and <XACT_TEXT>
o <XMARK>
global variable NEXTLINE

Select additional information

Event 16 after retrieving deleted entries

Event 16: After Retrieving Deleted Entries
Use
This 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.
Realization
This event has no standard routine. The following global data is available for the realization of the user routine:
internal table EXTRACT.
field symbols
o <XACT> and <XACT_TEXT>
o <XMARK>
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.
Use
This 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.
Realization
This event has no standard routine. The following global data is available for the realization of the user routine:
internal table EXTRACT.
field symbols
o <XACT> and <XACT_TEXT>
o <XMARK>
global variable NEXTLINE

Select additional information and Print additional information

Event 18 after the data change check

Event 18: After the Data Change Check
Use
This 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 changes
Realization
This event has no standard routine. The variable <STATUS>-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.
Use
This 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_FUNCT
Realization
This event has no standard routine.

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

Event 21: Fill Hidden Fields
Use
This event occurs when fields which are flagged in the Data Dictionary as 'hidden', are to be filled.
Realization
This 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
Use
This 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.
Realization
This event has no standard routine. In contrast to other events, the user routine must conform to the following interface
convention:
FORM xxxxxxx USING M_MODE
CHANGING TEXT_WA MODIF.
input parameter M_MODE
The parameter M_MODE is of type CHAR length 1. It specifies whether the long text was called in display or
change mode.
Possible values:
o 'R' = display only
The maintenance dialog was called in display or transport mode, so the long text is only displayed.
o 'U' = change
The maintenance dialog was called in change mode, so the long text can be maintained.
Output parameter TEXT_WA
The 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 MODIF
The parameter is of type CHAR length 1. It copies changes to the parameter TEXT_WA into the internal table
<VIM_TEXTTAB> 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 <VIM_TEXTTAB>.
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
Use
This 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.
Realization
This 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:
o VIM_ADDR_FIELD_SELECTION corresponds to parameter FIELD_SELECTION
o VIM_ADDR_KEYWORDS corresponds to parameter KEYWORDS
o VIM_ADDR_TITLEBAR corresponds to parameter TITLEBAR
o VIM_ADDR_CHNG_DEFLT_COMM_TYPES corresponds to parameter
CHANGE_DEFAULT_COMM_TYPES
o VIM_ADDR_FRAME_TEXT corresponds to parameter FRAME_TEXT
o VIM_ADDR_EXCLUDED_FUNCTIONS corresponds to parameter EXCLUDED_FUNCTIONS
Of 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_HUGO
DATA: 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
Use
This event calls an additional authorization check.
Realization
You can set the following global data in your routine to influence the program behaviour:
VIM_AUTH_RC = 0 if authorization check passed

= 4 go to display mode

= 8 cancel
You can send an I message after the check:
VIM_AUTH_MSGID message class
VIM_AUTH_MSGNO message number
VIM_AUTH_MSGV1
VIM_AUTH_MSGV2
VIM_AUTH_MSGV3
VIM_AUTH_MSGV4
Message variables

Event 26 before displayed data is output in a list

Event 26: Before Displayed Data is Output in a List
Use
The 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.
Realization
This event has no standard routine. The following global data is available for the realization of the user routine:
Name

REUSE_ALV_LIST_DISPLAY
parameter
Purpose Default/Value
ALV_VALUE_TAB Internal
table
T_OUTTAB Contains output
values
filled
VIM ALV_FCAT Internal
table
IT_FIELDCAT Field catalog Dictionary value
for table/view
VIM_ALV_VALUE_LENGT
H
Paramete
r
- For information only:
Value table data
record internal
length
defined
VIM_ALV_CALLED_BY Paramete
r
- Routine which calls
ALV_LIST_DISPLA
Y
VIM_CALL_AL
V
VIM_ALV_EVENTS Internal
table
IT_EVENTS Events to perform in
list output
contains TOP-
OF-PAGE
event definition
VIM_LIST_HEADER Internal
table
IT_LIST_COMMENTARY (function
module
REUSE_ALV_COMMENTARY_WRIT
E)
List header
definition
filled
VIM_ALV_VARIANT Structure IS_VARIANT Variant information empty
VIM_ALV_LAYOUT Structure IS_LAYOUT Layout information empty
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 <name> TABLES
alv_value_tab .
The form routine is as follows:
FORM <name>:
FIELD-SYMBOLS: <fcat> TYPE slis_fieldcat_alv
*1. Modify structure table...
*1.1. check whether already done
READ TABLE vim_alv_fcat WITH KEY field name = <field name>
tabname = <table name> TRANSPORTING NO FIELDS.
*1.2. if not yet done > modify
IF 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 rows
LOOP AT ALV_VALUE_TAB.
.........
ENDLOOP.
ENDFORM.
See also the documentation of the function modules "REUSE_ALV_".
Additional List Output Information
The 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
Use
This 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.
Realization
In 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
* <-- p_new_guid new value in GUID field
* <-- p_wa old current view or table dataset
*---------------------------------------------------*
FORM form name USING p_old_guid TYPE any
CHANGING p_new_guid TYPE any
p_wa TYPE viewname.
The parameter P_OLD_GUID contains the value of the GUID field before the maintenance dialog. This parameter is initial
when you create a data record. When you copy, it takes the value from the template. If the table/view only has one GUID
field, it can take the type of this field. Otherwise, assign the type ANY .
The parameter P_NEW_GUID is provided by a field symbol. This field symbol points to the table or view structure which
was passed in the parameter P_WA and gets the previously determined new value for the GUID field. Changes to this
parameter are automatically copied into the internal tables EXTRACT and TOTAL, which are the global view maintenance
data container.
You can determine the current maintenance dialog processing mode from the flags in the Overview of the possible
changes to GUID fields.

Replacement events
Event AA instead of the standard data read routine

Event AA: Instead of the Standard Data Read Routine
Use
This event occurs when the data to be maintained is read in. A different logic from the standard can run, for example:
to read in additional data
to change the data read in
to read in the data differently from in the standard, possibly with additional checks.

The views or table/text table data must are read in to the internal table TOTAL.
Realization
The generated read routines can be used or be a template for the realization of the individual routine:
Maintenance dialog based on a view FORM GET_DATA_<view name>
Maintenance dialog based on a table FORM TABLE_GET_DATA
To read in additional data for example, you can first call the standard routine and then read the additional data into your
own internal tables.

Event AB instead of the standard database change routine

Event AB: Instead of the Standard Database Changes Routine

Use
This event occurs at the 'Save' function. A different logic from the standard can run, for example to also change hidden
tables in the database.
Realization
The following standard routines can be used or be a template for the realization of the user routine:
Maintenance dialog based on a view:
routine FORM DB_UPD_<view name>
Maintenance dialog based on a table:
routine FORM TABLE_DB_UPD.
If entries are deleted, they must also be deleted in the internal table EXTRACT, and the flags be reset. (See the standard
routine logic).
The following global data is available:
internal table TOTAL
field symbols <ACTION> and <ACTION_TEXT>

Event AC instead of the standard 'Get original' routine

Event AC: Instead of the Standard Cancel Changes Routine
Use
This event occurs at the 'Cancel Changes function. A different logic from the standard can run, for example to also
process fields which are not in the view/table, but are displayed in the overview or detail screens.
Realization
The following standard routines can be used or be a template for this event:
Maintenance dialog based on a view: routine PERFORM READ_SINGLE_ENTRY_<view name>
Maintenance dialog based on a table: routine PERFORM TABLE_READ_SINGLE_ENTRY
The user routine must change the table/view data in the internal tables TOTAL and EXTRACT and reset the processing
flag. The following global data is available for the realization of the user routine:
internal tables
o TOTAL
o EXTRACT
table/view fields
field symbols
o <ACTION> and <ACTION_TEXT>
o <XACT> and <XACT_TEXT>
o <MARK>
o <XMARK>

Select additional information

Event AD instead of the standard RO field read routine

Event AD: Instead of the Standard RO field read Routine
Use
This event is only relevant for views, and only if the view contains fields from referred tables. It occurs when the
contents of the referred fields must be changed. A different logic from the standard can run, for example to read display
values from another table than the assigned one.

The read-only field in the view must come from a referred table
Realization
The standard routine COMPL_<viewname> can be a template for this event. The view structure is available for the
realization of the user routine.

Event AE instead of the standard positioning code

Event AE: Instead of the standard positioning code
Use
This event occurs at the 'Position' function. A different logic from the standard can run, for example if the internal table
EXTRACT key is not sorted in ascending order.
Realization
This event has no standard routine. The following global data is available for the realization of the user routine:
internal table EXTRACT.
Field symbol <F1_X>
The field symbol <F1_X >, which contains the position key, is used to search for entries in the internal table
EXTRACT. When an entry is found, the table index in the global variable NEXTLINE must be set. The standard
performs the output.
If the key is not found, you must assign a variable to the variable NEXTLINE.

Event AF instead of reading texts in other languages

Event AF: Instead of Reading Texts in Other Languages
Use
This event occurs at the 'Translation' function. Texts are read in and made available for translation according to the
selected languages. A different logic from the standard can run, for example:
to change the data read in
to read in the data differently from in the standard (performance, dependencies) possibly with additional checks.

This event also occurs if time-dependent entries are restricted by time-dependent texts. In this case, the
language-dependent texts must be read in in all languages.
Realization
The standard routine VIM_READ_TEXTTAB_FOR_LANGUS can be a template for the realization of the user routine. The
user routine does not need a parameter like the standard routine.
In contrast to other events, the user routine must conform to the following interface convention:
FORM xxxxxxx TABLES SEL_LANGUS STRUCTURE H_T002.
The language-dependent texts must be read in to the internal table <VIM_TEXTTAB>. Each language can only be read in
once during the maintenance dialog.
The entity read selection conditions must be applied (internal table DBA_SELLIST). The texts can be read in in various
ways:
analogously to standard logic
Only the texts for the languages which are not yet in the internal table <VIM_TEXTTAB> are read in in the
standard. The languages in the transfer table SEL_LANGUS are read in if they have not already been read in.
This is checked in the internal table <VIM_READ_LANGUS>. Only the texts for languages are read in which are
in SEL_LANGUS but not in <VIM_READ_LANGUS>. As soon as a language is read in, it is entered in the internal
table <VIM_READ_LANGUS> to ensure correct reading in future.
user logic
All texts can be read in at once. Rereading must be avoided.
Only the texts in the languages in the transfer table SEL_LANGUS are displayed.

If the internal tables <VIM_TEXTTAB> or <VIM_READ_LANGUS> have been modified, the following
statement must be at the end of the routine:
MODIFY VIM_TEXTTAB_CONTAINER INDEX VIM_TEXTTAB_CONTAINER_INDEX .
The following internal tables are available for the realization of the user routine:
internal table <VIM_TEXTTAB>
internal table <VIM_READ_LANGUS>

Event AG instead of 'Get original' for texts in other languages

Event AG: Instead of 'Get original' for Texts in Other
Languages
Use
This event occurs at the 'Get original' function which gets the language-dependent texts as well as the original from the
database. A different logic from the standard can run, for example to also process text fields which are not in the
table/view, but are displayed on the maintenance screen.
Realization
The standard routine VIM_READ_TEXTTAB_ENTRY can be a template for the realization of the user routine.
The following global data is available:
internal table <VIM_TEXTTAB>
The text data for the current entry in the internal table <VIM_TEXTTAB> must be updated in the user routine, depending
on the value of the processing flag:
ORIGINAL
no action required
NEUER_EINTRAG
new entry. The entry must be deleted from the internal table.
UPDATE
The text data are fetched from the database and the value ORIGINAL is assigned to the processing flag.
The key of the current entity is in the field symbol <VIM_EXTRACT_KEY>. The field symbol
<VIM_EXT_MKEY_BEFORE> must be used instead of <VIM_EXTRACT_KEY> for time-dependent entities with time-
independent texts.
The check for texts for the entity key need only be made in one language. If no entry is found in the internal table
HyperLink: TX.SM30_EXIT_TEXTTAB <VIM_TEXTTAB> v> , there will be no entries in other languages either.

Certain program statements must be inserted at the end of the routine, depending on the processing of
internal table <VIM_TEXTTAB>:
internal table changed:
MODIFY VIM_TEXTTAB_CONTAINER INDEX VIM_TEXTTAB_CONTAINER_INDEX .
CLEAR SY-SUBRC.
internal table not changed:
SY-SUBRC = 4.

Event AH instead of database changes for texts in other languages

Event AH: Instead of Database Changes for Texts in Other
Langs
Execution : Instead of database changes for texts in other languages
Use
This event occurs at the 'Save' function. A different logic from the standard can run, for example to also change hidden
tables in the database.
Realization
The standard routine VIM_TEXTTAB_DB_UPDATE can be a template for the realization of the user routine.
The following global data is available:
Internal table <VIM_TEXTTAB>: The text data handling in the user routine depends on the value of the
processing flag
ORIGINAL: no action required
NEUER_EINTRAG: new entry. The entry must be put in the database and the processing flag set to ORIGINAL.
NEUER_GELOESCHT: deleted. The entry must be deleted from the internal table. No database operation is
required because the new entry does not yet exist there.
GELOESCHT: deleted. The entry must be deleted from the internal table. The database deletion is in the entity
save routine, so no database operation is required.
AENDERN: change. The entry must be changed in the database. The processing flag is set to ORIGINAL.
UPDATE_GELOESCHT: deleted. The entry must be deleted from the internal table. The database deletion is in
the entity save routine, so no database operation is required.

If the internal table <VIM_TEXTTAB> has been changed, the following statement must be at the end of
the routine:
MODIFY VIM_TEXTTAB_CONTAINER INDEX VIM_TEXTTAB_CONTAINER_INDEX .

Event ST GUI menu main program name

Event ST: GUI Menu Main Program Name
Use
This event occurs at every PROCESS BEFORE OUTPUT. The function group interface can now be set for the table/view
maintenance dialog at runtime instead of the standard interface.
Note
The program name of the function group SAPL<fugr> is entered here, not a form routine name as in all other events.
Realization
This event is created automatically when you create and modify a function group interface and/or create control
information in the Generate table maintenance dialog transaction Interface function.
The function group interface must be a copy of the standard interface SAPLSVIM, which can then be modified.
The first character of a user status name should be numeric, to avoid overlaps.
in SAP namespace the 1st character of the status is 0 - 8
in customer namespace the 1st character of the status is 9
The first character of user function codes should also be numeric, to avoid overlaps.
in SAP namespace the 1st character of the function code is 0 - 8
in customer namespace the 1st character of the function code is 9
The following global information is available for the use of the function code in user module coding:
Maintenance screen numbers
o the variable LIST
contains the overview screen number
o the variable DETAIL
contains the number of the individual screen
structure STATUS
the variable STATUS contains the current GUI-STATUS ( Standard interface status)
function information fields

Você também pode gostar