Skip to Content
avatar image
Former Member

Alpha numeric characters in Data element

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

9 Answers

  • Mar 08, 2011 at 03:49 AM

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

    You can do validations at selection-screen.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 08, 2011 at 06:07 AM

    Hi,

    Try using LRAW as Data Type for your data element.

    Regards,

    Gopal

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 08, 2011 at 07: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 .

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 08, 2011 at 07: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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 08, 2011 at 10:34 AM

    Hi Ratna,

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

    Thanks

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 08, 2011 at 12:23 PM

    HI,

    Check this [link.|fm-for-removing-special-character] This should help you.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 14, 2011 at 06: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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 16, 2011 at 02:10 PM

    Hi,

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

    Regards,

    Uday.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 17, 2011 at 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

    Add comment
    10|10000 characters needed characters exceeded