cancel
Showing results for 
Search instead for 
Did you mean: 

Goto Stement

Former Member
0 Kudos
85

Hi All,

Can I use GOTO statement in Webdynpro...? if so, what is the syntax...

I have written a a block of code in WddomodifyView(), which I want to access from another method... as other methods do not support VIEW class....

Pls suggest...

Regards/Guru

Accepted Solutions (0)

Answers (1)

Answers (1)

Greg_Austin
Product and Topic Expert
Product and Topic Expert
0 Kudos

Java doesn't use GOTO statements. You could write a custom method at the end of the Web DynPro code and have the wdDoModifyView and whatever other method you are using both call it.

Former Member
0 Kudos

Hi,

I my custom method I can't use VIEW.....

I have written a custom method as follows:

public void tablecount()

{

IPrivateAuditRepCompView.ICatlistElement ctEl;

for(int i=0;i<wdContext.nodeCatlist().size();i++)

{

ctEl=wdContext.nodeCatlist().getCatlistElementAt(i);

String catName=ctEl.getCatname();

String subCat=ctEl.getSubcatnames();

StringTokenizer st1=new StringTokenizer(subCat,",");

int numTable=st1.countTokens();

for(int j=0;j<numTable;j++)

{

IWDTable table=(IWDTable)view.getElement("Table"+j);

table.setVisible(WDVisibility.VISIBLE);

}

}

}

Now, I want to call this method in Wdmodify....

Greg_Austin
Product and Topic Expert
Product and Topic Expert
0 Kudos

I'm not sure you are using the view parameter correctly. Can you post what your context hierarchy looks like and what the goal of you code is?

sid_sunny
Contributor
0 Kudos

Hi kumara

write this between

<b> //@@begin others

//@@end</b>

present at the end of your view.java

public static void abcd(com.sap.tc.webdynpro.progmodel.api.IWDView view){

}

and just call it in wdDoModify by writing <b>abcd(view);</b>

Do reward points if it helps

Regards

Sid

Former Member
0 Kudos

Hi Siddharth,

I am not able to use "wdcontext" in the method, which was created as static as per your advice...

I am completely new to webdynpro.... so, suggest me.. how can I loop the UI elements according to their ID...

Regards/Guru

sid_sunny
Contributor
0 Kudos

Hi kumara,

As per your code you just need to know the value of numTable I dont know whether this is the perfect method or not but I will suggest you as soon as you execute the BAPI which will return you these values store it in a global STATIC variable say "a" and then use this value in your static method for looping

<b>Do reward points if it works</b>

Regards

Sid