03-08-2011 3:26 AM
Hello abap gurus:
I created a table in which i declared a data element is of type character length 9, so that it will allow both numeric and alpha characters,
but now in testing it is also allowing special characters like @#_&*) etc.
So please let me know how to remove this speical characters and it should allow both numeric and alphabets.
Waiting for the response.
Thanks,
Ratnakar.
03-08-2011 3:49 AM
The Special characters are also char type so it will allow these values .
You can do validations at selection-screen.
03-08-2011 5:19 AM
Thanks for reply Sandeep.
It is for a data element in custom table.
So do you want me to validate the field in maintenance screen source code??
Thanks,
Ratnakar.
03-08-2011 5:53 AM
If you have maintenance generator for this table , you can do the validation on save under events.
03-08-2011 6:07 AM
Hi,
Try using LRAW as Data Type for your data element.
Regards,
Gopal
03-08-2011 7:34 AM
Hi If you are updating the table using the table maintenace generator then you need to put the code in the events 01 of table maintenance . in this define event you will get an option of creating include where you can put your validation code .
03-08-2011 7:55 AM
You could assign a customer [conversion exit|http://help.sap.com/saphelp_nw70/helpdata/en/cf/21ee19446011d189700000e8322d00/frameset.htm] to the [domain|http://help.sap.com/saphelp_nw70/helpdata/en/cf/21edf2446011d189700000e8322d00/frameset.htm] of the data element.
Suppose you name it ZALPHA
- Create a Function group
- Create a FM CONVERSION_EXIT_ZALPHA_INPUT (*) - there code work area = INPUT, remove not allowed characters, condense and then OUTPUT = work area.
- Create a FM CONVERSION_EXIT_ZALPHA_OUPUT (*) - there just code OUTPUT = INPUT.
Now affect the conversion exit to the domain.
Regards,
Raymond
(*) Use any SAP conversion exit as a template.
03-08-2011 10:34 AM
Hi Ratna,
Write a coversion routine( used to vakidate the field ) and assign it at data element level.
Thanks
03-08-2011 12:23 PM
03-14-2011 6:47 AM
Hi Ratna,
If you want to Remove the special character during the save operation in your Z-table, if you have TMG you can do validate in the TMG Coding by including the validation in Event, and remove the Special character using the function Module.
If you want to remove the Sepcial character in your report you can use this function module - SF_SPECIALCHAR_DELETE
Regards,
Ragunathan.R
03-16-2011 2:10 PM
Hi,
Try using NUMC as data type. It may restrict those special characters.
Regards,
Uday.
03-17-2011 12:52 PM
Hi,
You can try LRAW data type for data element else you can write constraint at time of save data through Table maintance Generator.
In Event01(check before save), write Function module SF_SPECIALCHAR_DELETE.
Both the way you can delete special character from your data.
Regards,
Kunjan