cancel
Showing results for 
Search instead for 
Did you mean: 

Error in Print statemnt in myMethod() in "Others"

Former Member
0 Kudos

Hi,

Im trying to write a method of my own - myMethod() in "Others", and i want to call this method in wdDoModifyView().I want to display a message in myMethod().So iam doing like this:

........................

public static BigDecimal myMethod(String name, int age, String designation){

IPrivate<View> wdThis;

IPrivate<View>.IContextNode wdContext;

com.sap.tc.webdynpro.progmodel.api.IWDView view;

IWDMessageManager msgMgr = wdThis.wdGetAPI.getComponent.getMessageManager();

msgMgr.reportSuccess("Success");

..........

}

as suggested by Armin.But i m getting the error in the below line as "wdThis may not have been initialized"

IWDMessageManager msgMgr = wdThis.wdGetAPI.getComponent.getMessageManager();

Please suggest me how to write print statement in myMethod in "Others".

Regards,

Padmalatha.K

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Add the wdThis as part of the signature of your custom method


public static BigDecimal myMethod(String name, int age, String designation, IPrivate<YourCompView> wdThis){

}

Regards

Ayyapparaj

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Padma,

You can use the following statements to print the message.

IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();

msgMgr.reportSuccess("Success");

or

wdComponentAPI.getMessageManager().reportSuccess("Success");

Thanks n Regards,

Jhansi Miryala