Add events in the table to meet custom requirements

Table Maintenance Generator
Share on Facebook9Share on LinkedIn0Tweet about this on TwitterShare on Google+0
Please Share!!

Table maintenance events are useful tool to do the validations, checks or some other custom requirements as per the business need.

Event – What is it?
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.

[adToAppearHere]

 

Steps to create Event

1. Create and activate the table in SE11/SE80.
2. Generate the table maintenance generator and save it.
3. In the Generate Table Maintenance screen go to Menu Environment –> Modification –> Events.

4. You will see the following screen.

5. Click the New Entries button and select the event you want to use and the Routine name.
There are many events to suit your business need. Here for demo, I have used the event 05 i.e. Creating a new entry.

6. Click the Editor and create your routine in the Include program and write the code in the routine to meet your requirement.

For example, below I have written a code to pull the material description automatically when material number is entered.

FORM Z_AUTO_POPULATE.

* Convert the input data
CALL FUNCTION ‘CONVERSION_EXIT_MATN1_INPUT’
EXPORTING
INPUT = ztest_rs-zmatnr
IMPORTING
OUTPUT = ztest_rs-zmatnr
EXCEPTIONS
LENGTH_ERROR = 1
OTHERS = 2.

* Get the description of the material automatically
Select maktx from makt
into ztest_rs-maktx
WHERE matnr = ztest_rs-zmatnr
and spras = sy-langu.
ENDSELECT.

ENDFORM.

Sample Result

Go to transaction SM30. Give the table name and press new entry button

Provide material 38 and plant 1000.

After providing the material and plant, press ENTER.

Material Description is automatically populated.

Also Read : How to enable table entries maintenance in SE16N (Alternative for &SAP_EDIT and UASE16N)

If you want to get more practical issues and resolutions straight to your inbox, please SUBSCRIBE. We respect your privacy and take protecting it seriously.

Thank you very much for your time!!

If you liked it, please share it.

 

 

Image source : cliparts.co

Share on Facebook9Share on LinkedIn0Tweet about this on TwitterShare on Google+0
Please Share!!

1 Comment on "Add events in the table to meet custom requirements"

  1. We can also meet the above requirement by modifying the TMG code generated for the table.

    More detail in another post of ours:
    http://help-sap.blogspot.in/2008/10/automatic-population-of-values-during.html

Comments are closed.