cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Code being wiped out.

Former Member
0 Kudos

Hi All,

I am pretty new to WD. I am trying out writing examples and tutorials. I am facing a problem that is pretty annoying.

This is the gist of the problem.

I am writing a custom controller.

I have populated the init method with some code.

I have another custom method in the controller which I populate with some logic.

I am writing code within the begin and end tags (as suggested by the doco)

When I save the metadata, sometimes nwds wipes out my custom code. For example..If I have this in my custom method..

 /@@begin javadoc:executeBapi_Flight_Getlist_Input()
  /** Declared method. */
  //@@end
  public void executeBapi_Flight_Getlist_Input( )
  {
    //@@begin executeBapi_Flight_Getlist_Input()
	try
		{
			wdContext.currentBapi_Flight_Getlist_InputElement().modelObject().execute();
			wdContext.nodeOutput().invalidate();
		}
		catch (Exception e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    //@@end
  } 

After I save the metadata this is what is left!


 //@@begin javadoc:executeBapi_Flight_Getlist_Input()
  /** Declared method. */
  //@@end
  public void executeBapi_Flight_Getlist_Input( )
  {
    //@@begin executeBapi_Flight_Getlist_Input()
    //@@end
  }

Has anyone encountered this before??

Thanks in advance!

Santy

PS : My Env is JDK 1.5.0_14 + NWDS 7.0.12..

Edited by: Santosh Raghavan on Feb 22, 2008 12:41 AM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Try to reload your project by right clicking on the project and select reload.

Once this is done. try to add the code . Some times this works

Regards

Ayyapparaj

Former Member
0 Kudos

Ayyapparaj,

Thanks for that. I tried reloading the project. (I did this before as well). I did it after your post just to be sure. I am still facing the same problem.

Santy

ThatSAPGuy
Advisor
Advisor
0 Kudos

Santosh-

Looks like some of the metadata of your controller has gotten corrupted . Since you are new to Web Dynpro and are trying out examples I would suggest just deleting this project/dc and starting afresh with a new one. Do make sure that you do not edit/remove/insert any of the @@ tags.

Good Luck-

Atul

Former Member
0 Kudos

Hi Atul,

I already did that. I also created a completely new project and applied what was in the example. The new project also exhibited signs of the same problem. This problem is across all WD projects that I am working on. This leads me to believe that there might be a problem with the NWDS installation.

If I don't get any more pointers, I might reinstall NWDS and see if the problem goes away.

Thanks

santy

Former Member
0 Kudos

Hi All,

I upgraded to SP14 (NWDS 7.0.14) and the problem went away. Thanks all for your input.

Santy

Edited by: Santosh Raghavan on Feb 22, 2008 10:21 PM

former_member197348
Active Contributor
0 Kudos

Welcome to SDN Santosh!

You code must be in between //@@begin

and //@@end

check whether if you are missing anything like this for this method or for any other methods.

regards

Siva

Former Member
0 Kudos

Siva,

Thanks for the welcome!

I am adding code between the begin and end tags. Thats why I posted the code snippet to illustrate the problem.

Thanks

Santy

former_member197348
Active Contributor
0 Kudos

Santosh,

Create one more method to execute BAPI. Write the code carefully in it, if same thing happens the problem may be it your NWDS. If not, you are missing some in the first method or may in any other method near to this (up/down)

regards,

Siva

Former Member
0 Kudos

Siva,

Thanks for taking time to answer the question. I followed your suggestion and created another method. Problem remains.

I might add here that I am not making any other modifications to the code other than init and the above method. (I am not messing up the tags)

and I am faithfully () following an example from one of the tutorials on sdn.

Thanks

Santy