cancel
Showing results for 
Search instead for 
Did you mean: 

Telephone field gets erased when implemeting method DO_VALIDATE_INPUT

guipaulino
Active Participant
0 Kudos

Hello experts!

I'm trying to develop a validation (mask) for the fields Telephone, Fax and Mobile using component BP_ADDR for independent phones: BP_ADDR/IndependentCommNumbersList

I'm implementing method DO_VALIDATE_INPUT to achieve this development.

My problem is: when adding the error message (global_message) the Telephone field gets erased!!! Everything is working properly, except for the fact that the field gets deleted. I do not know what is causing this behavior.

Any ideas on how to solve this?!

Thanks a lot,

Luis.

Accepted Solutions (0)

Answers (3)

Answers (3)

arnoterhorst
Explorer
0 Kudos

This is an old post, but in case anybody is wondering.

The Phone number disappearing should only occur if it fails the validation immediately. If it is first valid, you press enter and then you will edit the Phone number making it invalid, then it will not get erased.

This happens because new telephone numbers are value nodes, existing Phone numbers are
entity nodes. When pressing enter, all value nodes are converted to entity nodes in the DO_FINISH_INPUT.

If you call convert_value_to_model_node() in DO_VALIDATE_INPUT then all value nodes are converted to entity nodes.

Please only call this method when both in edit mode and the validation fails.

This to prevent as much as possible to interfere with standard SAP logic.

Still it will be annoying to implement, but I got it to work

faisal_pc
Active Contributor
0 Kudos

Hi Luis,

Which version of IE you are using?.

Thanks,

Faisal

former_member182421
Active Contributor
0 Kudos

hmmmm did you considered to use the BADI BUPA_ADDR_CHECK  instead of coding the checks on the WebUI directly? I always try to use BADIs as long as I can, central maintenance (remember if you code in the UI directly, the check only will be performed in the UI, no idocs, no bapis, etc.)  plus validate things in the WebUI is always a pain

If for your requirement is mandatory to perform the checks in the UI, you should move you post to the WebUI subspace so more people can help you.

Cheers!

Luis