Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Writing events through table maintenance generator

Former Member
0 Kudos

Hi,

We have a Z table which contains Sales org(VKORG) as one of the fields. When the entries in this table are maintained through table maintenance SM30, sales org which is for example 0800 is getting saved as 800 which means the leading zero is not appearing in the table.  So, I am planning to write an event " “Before saving the data in the database” through table maintenance generator to add leading zeroes while saving.

But, the z table also gets updated from some programs. I am not sure how sales org is updated this way (with leading zero or without leading zero).

If I write an event using table maintenance generator as above, will it only apply to  sales orgs which are maintained through SM30 or  will the event also apply to the programs which update the Z table? I am ok if it applies to Z table as well. Please advise.

Thanks,

Pavan

1 ACCEPTED SOLUTION

paul_bakker2
Active Contributor
0 Kudos

Hi,

The event is in the table maintenance dialog, so it will (of course) only affect items entered using that table maintenance dialog.

Any Z table updates done by other programs will not be affected.

cheers

Paul

3 REPLIES 3

paul_bakker2
Active Contributor
0 Kudos

Hi,

The event is in the table maintenance dialog, so it will (of course) only affect items entered using that table maintenance dialog.

Any Z table updates done by other programs will not be affected.

cheers

Paul

Former Member
0 Kudos

Hi Pavan,

Do you refer to data element VKORG? I check the standard table TVKO. The sales org can be saved as leading zero.

You can check it.

Maybe the data saved in table has the leading zero. But displayed as ALV. In ALV layout will hide the leading zero.

Thanks,

Yawa

rajkumarnarasimman
Active Contributor
0 Kudos

Hi Pavan,

Please find the below steps.

Steps:

  1. In Table Maintenance Generator.  Click Environment ->Modification -> Events
  2. In List of Event, Select 1(Before saving data in Database).
  3. Give the Subroutine name as 'APPEND_ZERO' and write the code as shown below.

FORM APPEND_ZERO.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input         = ztab-vkorg

IMPORTING

OUTPUT        ztab-vkorg.

ENDFORM.


Please find the following link for detailed screenshots to create the event in Table Maintenance Generator.

EVENTS IN TABLE MAINTENANCE - ABAP 开发 (ABAP Development) - SCN Wiki

Regards

Rajkumar Narasimman.