cancel
Showing results for 
Search instead for 
Did you mean: 

Phone number mandatory in ESS Adress .. code does not work

Former Member
0 Kudos

Hi Guys,

I put this code in component controller - Event -- onEvent of WD component vcPerAddressUSDetail. But this code fails to execute. If I remobe the subtype check in the code it works fine for all the sub types. My requirement is to limit the mandatory check only for emergency sibtype which is 4.

Any help

String areacode = null;

String phonenumber = null;

String subtype = null;

subtype = wdContext.currentSubtypesElement().getSubtype();

if (subtype == "4" )

{

areacode = wdContext.currentSelectedInfotypeElement().getAreac();

phonenumber = wdContext.currentSelectedInfotypeElement().getTelnr();

if (phonenumber == null || phonenumber.trim().length() == 0)

{

wdComponentAPI.getMessageManager().raiseException("Please enter Telephone Number",true);

}

}

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Alka,

This works. thank you. I realise how hard it is for ABAPers to code web dynpro

On the other hand i have an issue. The error message is been dispaled now after i put your code. After the error message is diaplyed i enter the correct values but the navigation is not moving forward. The control is staying in the same screen and not moving forward to review and save screen. I have coded this logic in onEvent of Component controller of the VAC.

Any ideas of FPM and how to get rid of this

regards

Sam

Former Member
0 Kudos

Hi Sameer,

You are using

wdComponentAPI.getMessageManager().raiseException("Please enter Telephone Number",true);

The boolean value means "cancelNavigation", so navigation is canceled when errors occur.

If you use

wdComponentAPI.getMessageManager().raiseException("Please enter Telephone Number",false);

The error messages will be displayed also, but navigation will continue.

Johan

Former Member
0 Kudos

Hi Sameer,

Instead of using the condition:

if (subtype == "4")

u should use the string function equalsIgnoreCase or equals ,i.e;

if(subtype.equalsIgnoreCase("4")

{

...

}

Regards,

Alka.

Message was edited by:

Alka Panday