Application Development and Automation 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: 
Read only

Table Maintenance Generator Events

Former Member
0 Likes
1,006

Hi All,

I have an requirement wherein i will be entering the data from a custom transaction into a custom table. I have created a table maintenace generator for that custom table. Now, i have few validations to be performed on the data.

1. I need to validate the multiple entries, entered by the user. If the user is entering 10 entries at a time, if the 3rd entry fails the validation then user should be able to see the create data layout of that table with an error and the user should be forced wither to change that entry or delete that. Only this entry should be in editable mode and rest all should be in non-editable mode.

2. In change mode, the user should be able to change only few entries. For example.... if there are 5 fields in the custom table, and if the user wants to change the data then only last 2 fields should be in editable mode and rest 3 should be in non-editable mode.

How can i achieve this using events????

Thanks in advance for ur replies...

Regards,

Razia Shaheen.

Hi All,

I have an requirement wherein i will be entering the data from a custom transaction into a custom table. I have created a table maintenace generator for that custom table. Now, i have few validations to be performed on the data.

1. I need to validate the multiple entries, entered by the user. If the user is entering 10 entries at a time, if the 3rd entry fails the validation then user should be able to see the create data layout of that table with an error and the user should be forced wither to change that entry or delete that. Only this entry should be in editable mode and rest all should be in non-editable mode.

2. In change mode, the user should be able to change only few entries. For example.... if there are 5 fields in the custom table, and if the user wants to change the data then only last 2 fields should be in editable mode and rest 3 should be in non-editable mode.

How can i achieve this using events????

Thanks in advance for ur replies...

Regards,

Razia Shaheen.

4 REPLIES 4
Read only

Former Member
0 Likes
702

Please check the events that are availbe from the table maintenance generatore Transaction.

Environmenst -> Modifications->Events.

Edited by: Aravind. R on Jul 8, 2009 12:14 PM

Read only

Former Member
0 Likes
702

Hi Razia,

There are a predefined set of events available for table maintainance, you need to write a subroutine for the event you are intrested in via the menu path: Enviornment -> Modification -> Events. One entry might look like:

Event 01

Form: Validate_before_save.

When you save and double click on the form it takes you to an include and here you can write your code.

The set of events, when they are triggred and the available fields are listed here: Link: [SAPHelp|http://help.sap.com/saphelp_nw70/helpdata/EN/91/ca9f0ea9d111d1a5690000e82deaaa/content.htm].

Regards,

Sai

Read only

Former Member
0 Likes
702

Hello Razia,

for the point no1. use the events in the table control, use the internal table TOTAL to get all the entries old as well as newl created. Move the contents to an internal table which has similar structure of the DDIC table along with a new field flag which is of type char1.

Loop at all entries of the internal table where flag = 'N' or 'I' and validate them.

For point no 2.

in the change mode its difficult to handle it using events. the best option is to create a Maintenance view using SE11 and in the view field tab you will have a field "P" in the table control Set the value to "R" for all the fileds that needs to be in a display mode. this would set all the fields to the display only.

Read only

Former Member
0 Likes
702

Hi Razia,

From the TMG screen, go to system-->status and double click on the Program(Screen). It will take you to the module pool program for your TMG. From the program object list (SE80 view), choose the screen and then go to the screen layout. In that you can modify the field display for your table.

And in the PAI of your module pool program, validate all the fields you want. Do not forget to plac alll the fields shich should be in editable mode in the CHAIN...ENDCHAIN statement. and FIELD statement.

Hope this works for you. Let me know in case of issues.

Regards

Sourav