Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Validation Problem in WDJ

Hi Friends,

I have one doubt in Validation. When Click on u201CActionSearchViewDemandForeCastu201D

This Button I want some error Message in FV.

So I have to develop Some code but it is not working. Pls give any help.

This is Validation Method

public void Validation( )

{

//@@begin Validation()

IWDMessageManager manager = wdComponentAPI.getMessageManager();

String Bucket = wdContext.currentYmm_Sc_Bapi_Dmndstk_Getlist_InputElement().getP_Bucket();

manager.reportSuccess(" Bucket = " +Bucket);

if( Bucket == null && Bucket.equals(""))

{

// manager.reportSuccess(" Please Enter id ");

//manager.reportException(" Please enter id ",true);

manager.reportMessage(IMessageCom_ViewDemandForeCast.BUCKET,null,true);

}

This Validation Method I was called to Search Method

i.e

public void onActionSearchViewDemandForeCast(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionSearchViewDemandForeCast(ServerEvent)

//$$begin ActionButton(-1313177891)

wdThis.Validation();

wdThis.wdGetCom_ViewDemandForeCastController().executeYmm_Sc_Bapi_Dmndstk_Getlist_Input();

//$$end

//@@end

}

But I m not getting error message when click on Search Button

Req: I want to display error message when click on Search button

Reagards

Vijay Kalluri

replied

Hi Vijay,

Check this line in your code:

if( Bucket == null && Bucket.equals(""))

The Bucket string can never be null and equal to an empty string. I think you want an OR here instead of the AND.

-Greg

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question