2011 May 09 6:09 AM
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
2011 May 09 6:31 AM
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
2011 May 09 7:17 AM
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.
2011 May 09 8:08 AM
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
2011 May 09 8:09 AM
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.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |