Vous êtes sur la page 1sur 6

11/19/2018 Implementing Additional Checks in Table Maintenance Dialogs - SAP Developer Workbench

Warning: Parameter 2 to qtranxf_postsFilter() expected to be a reference, value given in /www/htdocs/w01362c7/dev-workbench.com/wp-includes/class-


wp-hook.php on line 298

Admin (https://www.dev-workbench.com/sap-modules/administration/)

CA-DMS (https://www.dev-workbench.com/sap-modules/ca-dms/)

CA-TS (https://www.dev-workbench.com/sap-modules/ca-ts/) CO (https://www.dev-workbench.com/sap-modules/co/)

CS (https://www.dev-workbench.com/sap-modules/cs/) FI (https://www.dev-workbench.com/sap-modules/fi/)

LE (https://www.dev-workbench.com/sap-modules/le/)

MM-IM (https://www.dev-workbench.com/sap-modules/mm-im/)

MM-PUR (https://www.dev-workbench.com/sap-modules/mm-pur/)

PM (https://www.dev-workbench.com/sap-modules/pm/) PP (https://www.dev-workbench.com/sap-modules/pp/)

PS (https://www.dev-workbench.com/sap-modules/ps/) QM (https://www.dev-workbench.com/sap-modules/qm/)

SD (https://www.dev-workbench.com/sap-modules/sd/) WM (https://www.dev-workbench.com/sap-modules/wm/)

(https://www.dev- (https://www.dev- (https://www.dev-


workbench.com/en/blog/implementing- workbench.com/de/blog/implementing- workbench.com/es/blog/implementing-
additional-checks-in-table- additional-checks-in-table- additional-checks-in-table-
maintenance-dialogs/) maintenance-dialogs/) maintenance-dialogs/)

Search for: Search … Search

SAP Developer Workbench


The best resource for SAP and ABAP Knowhow

https://www.dev-workbench.com/blog/implementing-additional-checks-in-table-maintenance-dialogs/ 1/6
11/19/2018 Implementing Additional Checks in Table Maintenance Dialogs - SAP Developer Workbench

dev .wb

(https://www.dev-workbench.com/)

SAP Data Objects

Warning: Parameter 2 to
qtranxf_postsFilter() expected to be a
reference, value given in
/www/htdocs/w01362c7/dev-
workbench.com/wp-includes/class-
Blog SAP Modules SAP Dictionary
wp-hook.php on line 298

Warning: Parameter 2 to
qtranxf_postsFilter() expected to be a
reference, value given in
/www/htdocs/w01362c7/dev-
workbench.com/wp-includes/class-
wp-hook.php on line 298

Implementing Additional Tags


Checks in Table ABAP (https://www.dev-
workbench.com/blog/tag/a
Maintenance Dialogs ALV (https://www.dev-workbench.com/blog/tag/alv/)
Authorization (https://www.dev-
workbench.com/blog/tag/authorization/) Business Function
 DevWorkbench     Monday August 18th, 2014    (https://www.dev-workbench.com/blog/tag/business-function/)
Classes (https://www.dev-workbench.com/blog/tag/classes/)
Classification (https://www.dev-
https://www.dev-workbench.com/blog/implementing-additional-checks-in-table-maintenance-dialogs/ 2/6
In11/19/2018
yesterday’s post about table maintenance dialogs, I discussed
Implementing how to in
Additional Checks create
TableaMaintenance Dialogs - SAP Developer Workbench
workbench.com/blog/tag/classification/) Control
simple table maintenance dialog in SAP ERP. Today, I will explain how this dialog can Framework (https://www.dev-

be enhanced with additional logic, for example to implement custom checks on data workbench.com/blog/tag/control-framework/) CPM
(https://www.dev-workbench.com/blog/tag/cpm/) Email
entered.
(https://www.dev-

Use case workbench.com/blog/tag/email/) Field Symbols


(https://www.dev-workbench.com/blog/tag/field-symbols/) File
A typical business case for the use of additional checks is the implementation of Management (https://www.dev-
additional checking logic for data which the user entered. In my case, I’ll use the workbench.com/blog/tag/file-management/)
same table as last time, which has the company code as a key field. I will implement a HANA (https://www.dev-
check to verify that the company code that is entered actually exists. workbench.com/blog/tag/hana/) HANA Cloud
Platform (https://www.dev-

Using table maintenance dialog events workbench.com/blog/tag/hana-cloud-platform/)


Learn SAP (https://www.dev-
The implementation of custom logic in table maintenance dialogs is done using so- workbench.com/blog/tag/learn-sap/)
called events. To get access to these, select Environment > Modification > Events from Netweaver (https://www.dev-workbench.com/blog/tag/netweaver/)
Patterns (https://www.dev-
the menu while in the table maintenance generator screen.
workbench.com/blog/tag/patterns/) PDF
(https://www.dev-workbench.com/blog/tag/pdf/) River RDE

(https://www.dev-workbench.com/blog/tag/river-
rde/) SAP Demo (https://www.dev-workbench.com/blog/tag/sap-
demo/) SAP ERP (https://www.dev-workbench.com/blog/tag/sap-

erp/) SAP IMG (https://www.dev-

workbench.com/blog/tag/sap-img/) SAPUI5

(https://www.dev-workbench.com/blog/tag/sapui5/) Tables
(https://www.dev-
workbench.com/blog/tag/tables/)
Transport System (https://www.dev-
workbench.com/blog/tag/transport-system/) User Exit
(https://www.dev-workbench.com/blog/tag/user-exit/) User
Parameters (https://www.dev-workbench.com/blog/tag/user-
parameters/) User Status (https://www.dev-
workbench.com/blog/tag/user-status/)

(http://www.dev-workbench.com/blog/implementing-additional-checks-in-table-
maintenance-dialogs/how-to-call-the-events-screen/)
SAP ERP
How to call the events screen
Dictionary
You will get a popup informing you that you’re changing SAP data, which you can Authorization Objects (/sap-
safely ignore. In the list that is opened, you have to select which event you want to dictionary/authorization-object/)
use. Each event is tied to a certain point in the data maintenance process – if you’re Customer Exits (/sap-dictionary/customer-
exit/)
familiar with the hooks programming pattern, that’s exactly what it is.
Function Groups (/sap-dictionary/function-
Your next task will be to pick the correct event for the job you want to do. Since there group/)
are close to 40 different events available, it’s best to use the SAP documentation for Function Modules (/sap-
dictionary/function-module/)
extended table maintenance events
Message Classes (/sap-dictionary/message-
(https://help.sap.com/saphelp_nw04s/helpdata/en/91/ca9f0ea9d111d1a5690000e82deaaa/frameset.htm),
class/)
which you can also access via the information button ( ). For my example, I want to Packages (/sap-dictionary/package/)
perform a check after data was entered. The correct event for this is 05. You also need
Programs (/sap-dictionary/program/)
to enter a form routine name. Click Save after you’ve entered your data (important!)
Transactions (/sap-dictionary/transaction/)
and click on the button in the Editor column afterwards.

Master Data
https://www.dev-workbench.com/blog/implementing-additional-checks-in-table-maintenance-dialogs/ 3/6
11/19/2018 Access
Implementing Additional Checks in Table Maintenance Dialogs - SAP ControlWorkbench
Developer List (https://www.dev-
workbench.com/sap-data/access-control-
list/)
Catalog (https://www.dev-
workbench.com/sap-data/catalog/)
Characteristic (https://www.dev-
workbench.com/sap-data/characteristic/)
Class (https://www.dev-
workbench.com/sap-data/class/)
Delivery (https://www.dev-
workbench.com/sap-data/delivery/)
Material Document (https://www.dev-
workbench.com/sap-data/material-
document/)
Notification (https://www.dev-
workbench.com/sap-data/notification/)
Purchasing Document (https://www.dev-
workbench.com/sap-data/purchasing-
document/)
(http://www.dev-workbench.com/blog/implementing-additional-checks-in-table- Sales Order (https://www.dev-
workbench.com/sap-data/sales-order/)
maintenance-dialogs/adding-a-new-event-implementation/)
Adding a new event implementation Selected Set (https://www.dev-
workbench.com/sap-data/selected-set/)
After you have added your include, you’re taken to the ABAP Editor. This is the place WBS Element (https://www.dev-
workbench.com/sap-data/wbs-element/)
where you can implement your custom check logic. Before I’m going into the details
SAP Modules (https://www.dev-
of the programming itself, let me explain which variables are available to work with workbench.com/sap-modules/)
the data in the table. SAP Data Objects (https://www.dev-
workbench.com/sap-data-objects/)
Interface variables to work with used data SAP Dictionary (https://www.dev-
workbench.com/sap-dictionary/)
The interface for these hooks is always the same. There’s a set of variables and
internal tables that let you work with the data in the table control. It’s documented
Warning: Parameter 2 to qtranxf_postsFilter()
for each event induvidually (such as for event 01
expected to be a reference, value given in
(https://help.sap.com/saphelp_nw04s/helpdata/en/91/ca9f0ea9d111d1a5690000e82deaaa/frameset.htm)),
/www/htdocs/w01362c7/dev-
but the generally available variables are the following.
workbench.com/wp-includes/class-wp-
Internal table TOTAL hook.php on line 298

The internal table TOTAL contains the complete dataset that is held in the table you
are working with. Its structure is a combination of the base table structure and the
structure VIMTBFLAGS (http://www.dev-workbench.com/sap-
Recent Posts
dictionary/structure/vimtbflags/). This structure contains fields that indicate the How To Activate a Business Function in SAP
processing status of the table row. ERP (https://www.dev-
workbench.com/blog/activate-business-
Field symbols <ACTION> and <ACTION_TEXT> function-sap-erp/)
How To Become an SAP Consultant
Via these field symbols, you can access the processing status of the current table row
(https://www.dev-
of table TOTAL, which means they mark if the record was created, updated, or
workbench.com/blog/how-to-become-sap-
deleted. These field symbols should only be used for events that are called once for
consultant/)
each table entry, meaning that they are executed in a loop.
SAP: How to Find User Exits for
If you want to read the processing status of table rows manually, it’s better to use the Transactions (https://www.dev-
field VIM_ACT from the structure VIMTBFLAGS (http://www.dev- workbench.com/blog/sap-find-user-exits-
workbench.com/sap-dictionary/structure/vimtbflags/). <ACTION> indicates the transactions/)
processing status of the table itself. <ACTION_TEXT> is used if your underlying data How to Get a Free SAP Demo System
table has a text table attached, and indicates the processing status of the text table. (https://www.dev-
workbench.com/blog/get-free-sap-demo-
The following constants are available to check the processing status. system/)

NEUER (value “N”) – new entry


https://www.dev-workbench.com/blog/implementing-additional-checks-in-table-maintenance-dialogs/ 4/6
AENDERN (value “U”) – updated entry Implementing Additional Checks in Table Maintenance Dialogs - SAP Find
11/19/2018 the Transport
Developer Request for an Object in
Workbench
GELOESCHT (value “D”) – deleted entry SAP (https://www.dev-
ORIGINAL (value “”) – unchanged entry workbench.com/blog/sap-find-transport-
NEUER_GELOESCHT (value “X”) – new entry, deleted again request-for-object/)
UPDATE_GELOESCHT (value “Y”) – updated entry, deleted again

Internal table EXTRACT
Archives
While the table TOTAL contains all of the data that is in the data table, EXTRACT is
July 2017 (https://www.dev-
the data subset that the user is currently working with. The exact contents of this
workbench.com/blog/2017/07/)
table depend on the function the user is currently executing within the SM30
February 2017 (https://www.dev-
(http://www.dev-workbench.com/sap-dictionary/transaction/sm30/) transaction. If
workbench.com/blog/2017/02/)
he is adding new lines, the table EXTRACT will contain only the newly entered lines,
April 2015 (https://www.dev-
while the table TOTAL will contain all old lines plus the new lines. The table
workbench.com/blog/2015/04/)
EXTRACT has exactly the same structure as the table TOTAL. More information on
August 2014 (https://www.dev-
table extracts can be found here: SAP documentation for table extracts
workbench.com/blog/2014/08/)
(http://help.sap.com/saphelp_scm700_ehp02/helpdata/en/4d/def73332846524e10000000a42189b/content.htm?
July 2014 (https://www.dev-
frameset=/en/4d/def9a132846524e10000000a42189b/frameset.htm&current_toc=/en/f3/73672be560404587eeb9a63c086d0d/plain.htm&node_id=260).
workbench.com/blog/2014/07/)
Field symbols <XACT> and <XACT_TEXT> May 2014 (https://www.dev-
workbench.com/blog/2014/05/)
These field symbols work exactly in the same way as the <ACTION> and March 2014 (https://www.dev-
<ACTION_TEXT> ones, but for the EXTRACT table. They, too, should only be used workbench.com/blog/2014/03/)
with events that are called in a loop. February 2014 (https://www.dev-
workbench.com/blog/2014/02/)
Field symbol <STATUS>
June 2013 (https://www.dev-
This field symbol provides access to some general information. Especially important workbench.com/blog/2013/06/)
is the field <STATUS>-UPD_FLAG, which indicates if any data was changed in the April 2013 (https://www.dev-

table control. workbench.com/blog/2013/04/)


March 2013 (https://www.dev-
Structure with the name of your table workbench.com/blog/2013/03/)
February 2013 (https://www.dev-
Especially important for the event 05 (after adding new entries), this structure will
workbench.com/blog/2013/02/)
hold the newly-entered data before it is moved to the main table. It can be accessed
January 2013 (https://www.dev-
via the name of your custom table (in my case, the name is ZMYTABLE) and can be
workbench.com/blog/2013/01/)
used for data checks.

(http://www.dev-workbench.com/blog/implementing-additional-checks-in-table-
maintenance-dialogs/variable-interface-for-extended-table-maintenance/)
Some of the available variables for extended table maintenance

https://www.dev-workbench.com/blog/implementing-additional-checks-in-table-maintenance-dialogs/ 5/6
These are the most important variables that
11/19/2018 are available
Implementing in the extended
Additional Checks in table
Table Maintenance Dialogs - SAP Developer Workbench
maintenance interface. There are a few more, but they are used only in special cases
or only in a few events. On the next page, I will show you how to use these variables
to implement a simple check on entered data.

Pages: 1 2 (https://www.dev- 3 (https://www.dev-


workbench.com/blog/implementing- workbench.com/blog/implementing-
additional-checks-in-table- additional-checks-in-table-
maintenance-dialogs/2/) maintenance-dialogs/3/)

 ABAP (https://www.dev-workbench.com/blog/tag/abap/)
Tables (https://www.dev-workbench.com/blog/tag/tables/)

SAP Developer Workbench


Warning: Parameter 2 to qtranxf_postsFilter() expected to be a
reference, value given in /www/htdocs/w01362c7/dev-
workbench.com/wp-includes/class-wp-hook.php on line 298
About (https://www.dev-workbench.com/about/)

Copyright Information (https://www.dev-


workbench.com/about/copyright/)

Legal Notice (https://www.dev-workbench.com/about/legal-


notice/)

Privacy Statement (https://www.dev-


workbench.com/about/privacy-statement/)

SAP Modules (https://www.dev-workbench.com/sap-modules/)

SAP Data Objects (https://www.dev-workbench.com/sap-data-


objects/)

SAP Dictionary (https://www.dev-workbench.com/sap-dictionary/)

https://www.dev-workbench.com/blog/implementing-additional-checks-in-table-maintenance-dialogs/ 6/6

Vous aimerez peut-être aussi