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: 

Alpha numeric characters in Data element

Former Member
0 Kudos

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.

11 REPLIES 11

Sandeep_Kumar
Advisor
Advisor
0 Kudos

The Special characters are also char type so it will allow these values .

You can do validations at selection-screen.

0 Kudos

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.

0 Kudos

If you have maintenance generator for this table , you can do the validation on save under events.

Former Member
0 Kudos

Hi,

Try using LRAW as Data Type for your data element.

Regards,

Gopal

anjaneya_bhardwaj2
Contributor
0 Kudos

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 .

raymond_giuseppi
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

Hi Ratna,

Write a coversion routine( used to vakidate the field ) and assign it at data element level.

Thanks

Former Member
0 Kudos

HI,

Check this [link.|] This should help you.

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

Try using NUMC as data type. It may restrict those special characters.

Regards,

Uday.

Former Member
0 Kudos

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