Skip to Content
0
Former Member
May 18, 2010 at 05:48 PM

Validate Input-Field for Phone-Number

2332 Views

Hello Everybody,

i stuck in a little issue: My webdynpro has a field to allow users to input phone-numbers.

Finally (bevore writing the input into my db-table) i like to validate if the made input contains only numbers.

regarding to i trief the following.

        DATA lv_tst_string(15) TYPE c.
*      Check if the entered value is numeric
        lv_tst_string = '0123456789'.
        IF ls_customer_mod-telefone CO lv_tst_string.
          " Then raise a message
*         get message manager
          DATA lo_message_manager    TYPE REF TO if_wd_message_manager.
          lo_api_controller ?= wd_this->wd_get_api( ).
          CALL METHOD lo_api_controller->get_message_manager
            RECEIVING
              message_manager = lo_message_manager.
*         report message
          CALL METHOD lo_message_manager->report_error_message
            EXPORTING
              message_text = 'möp'.
        ENDIF.

But, no matter what i enter as phone number, the message is never thrown and the insert ever performed.

What did i miss?

Best regards

Philipp