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 : Editable Entry after validation fails

Former Member
0 Likes
2,872

Hi,

I have created a Z table and a table maintenance generator to maintain the data.

I have to carry out certain validations when user enters data on Key and Non- key fields.

This is working fine, but the issue is with the key fields.

If validation fails, the table maintenance screen is displayed the date-field is grayed out (non-editable) as it is the key field of the table.

Now the user cannot change the data unlike the non-key fields were the user can modify the non-valid data and save again.

How can make the date field (Key Field) editable after entry in case the validation fail, so that the user can make the changes.

Please suggest the approach to handle the above scenario in events.

Thanks,

Keyur

Hi,

I have created a Z table and a table maintenance generator to maintain the data.

I have to carry out certain validations when user enters data on Key and Non- key fields.

This is working fine, but the issue is with the key fields.

If validation fails, the table maintenance screen is displayed the date-field is grayed out (non-editable) as it is the key field of the table.

Now the user cannot change the data unlike the non-key fields were the user can modify the non-valid data and save again.

How can make the date field (Key Field) editable after entry in case the validation fail, so that the user can make the changes.

Please suggest the approach to handle the above scenario in events.

Thanks,

Keyur

4 REPLIES 4
Read only

Kiran_Valluru
Active Contributor
0 Likes
1,482

Hi.,

Check this article., [Dynamically Enable/Disable fields in TMG|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/80b077d7-5317-2e10-8db8-aaf6921ced4a?quicklink=index&overridelayout=true]

hope this helps u.,

Thanks & Regards

Kiran

Read only

0 Likes
1,482

Thanks Kiran for your inputs.

I have done the same thing what you have explained.

I have used a Form Routine as CIP_SAVE with Event Number as 01, since on event SAVE i need to validate whether dates are

overlapping the inputs dates or not.

Fields are :

Group ID (Key)

Start Date (Key)

End Date (Key)

Value (Non -Key)

Initial value in Table:

Group ID = 12345

Start Date = 01/01/2011

End Date = 01/31/2011

Value = 11.11

Now if i try to enter value:

Group ID = 12345

Start Date = 01/02/2011

End Date = 01/25/2011

Value = 99.99

& SAVE it... validation will fails because Start & End dates overlaps.

Hence, on Table Maintainance Screen all key fields will be in non-editable display mode, whereas non-key field will be in editable mode.

My requirement is that Start Date & End Date key fields must be Editable field.

Thanks.

Read only

0 Likes
1,482

Hi.,

Initial value in Table:

Group ID = 12345

Start Date = 01/01/2011

End Date = 01/31/2011

Value = 11.11

Now if u try to enter value:

Group ID = 12345

Start Date = 01/02/2011

End Date = 01/25/2011

Value = 99.99

validation fails and group id, start date and end date will be in edit mode (with red color) and value in display mode. may be you changed your table fields., delete TMG(go to se11- > utilities -> table maintenance generator and press delete icon) and create it again.

hope this helps u.,

Thanks & Regards

Kiran

Read only

0 Likes
1,482

Hi,

Try to write the coding in event 05 . Iam able to get the key fields as editable after the validation.

Ex: coding in form ZTEST event 05.

select * from ZPA0001 into table

it_data

where ZPERNR = ZPA0001-ZPernr

and ZDATE1 LE ZPA0001-ZDATE1

and ZDATE2 GE ZPA0001-ZDATE1.

if sy-subrc = 0.

message e208(00) with 'Check dates'.

endif.

Iam able to save after changing the Overlapping dates ..

Regards,

Srini.