cancel
Showing results for 
Search instead for 
Did you mean: 

Error due to Auto generated code

Former Member
0 Kudos

Hello Experts,

I'm new to SAP NWDI and have been working on NWDI since last couple of months, without any formal training.

I was working on one View and dunno how some auto-generated code has got added in the Implementation.

Below is that piece of Code:-

/*
   * The following code section can be used for any Java code that is 
   * not to be visible to other controllers/views or that contains constructs
   * currently not supported directly by Web Dynpro (such as inner classes or
   * member variables etc.). </p>
   *
   * Note: The content of this section is in no way managed/controlled
   * by the Web Dynpro Designtime or the Web Dynpro Runtime. 
   */
  //@@begin others
  //@@end
}

I tried deleting this code, but every time i click 'Save Metadata', this code gets inserted again.

During Deployment, System gives following errors:-

*Syntax error on token "}", "interface", "class" expected*

*Unmatched bracket*

The system obviously won't get any opening paranthesis

I tried alot to remove this error but of no help.

I would be very grateful if this gets resolved.

Thanks alot in advance.

Regards,

Ashu R

Accepted Solutions (0)

Answers (5)

Answers (5)

former_member205363
Contributor
0 Kudos

Hi,

After Deleting unwanted code, check //@@ begin, //@@ End messages in the methods.

if you miss the order of begin, end messages, we will get this problem.

Regards,

Lakshmi Prasad.

p330068
Active Contributor
0 Kudos

Hi Ashu,

This "}" bracket related to the your Class <View name>

Like


public class <VIEW NAME>
{

/*
   * The following code section can be used for any Java code that is 
   * not to be visible to other controllers/views or that contains constructs
   * currently not supported directly by Web Dynpro (such as inner classes or
   * member variables etc.). </p>
   *
   * Note: The content of this section is in no way managed/controlled
   * by the Web Dynpro Designtime or the Web Dynpro Runtime. 
   */
  //@@begin others
  //@@end
}

Inside this class you will find methods with opening and closing brakets static and with your custum method if any.

public <VIEW NAME>(IPrivateTesst wdThis)

public void wdDoInit()

public void wdDoExit()

public static void wdDoModifyView

Check and verify the opening and closing brakets and make appropriate changes.

Hope it will helps

Regards

Arun Jaiswal

Former Member
0 Kudos

Hi everyone,

Thank you for the replies.

Trust me, i have compared each and evry pair of brackets in the 2000 lines of code 5 times manually since yesterday.

Every pair is intact.

As you must be aware, when we place the cursor on the opening bracket or closing bracket, its corresponding bracket gets highlighted. I have tested that way as well.

The 1st opening bracket after the public class <classname> highlights the 2nd to last closing bracket in the form.

Also, i would like to add, that when i remove these unnecessary closing brackets, the error goes away. But as soon as i Save All Metadata, the system inserts these brackets again and throws error.

The system is behaving wierdly, if i change anything, it inserts closing brackets anywhere.

Thanks and Regards,

Ashu R

Edited by: Ashu Rupani on Nov 10, 2010 11:10 AM

p330068
Active Contributor
0 Kudos

Hi Ashu,

Please try to do the following things :-

1. One the view implemetation >> Right Click >> Local History >> Do the Compare With.. or any other as apprpriate. and check it.

2. Select the project >> Repair >> Do the 'Project Structure and Classpath' and 'Remove Orphaned and text'

If this not resolved your issue, then copu whole code in the Edit plus and check and verify the opening and closing brackets.

Hope it will helps

Regards

Arun Jaiswal

Former Member
0 Kudos

Hi Arun,

Thanks for the reply.

Nothing seems to be of any help in my case.

I can't compare the code with earlier versions as they are only yesterdays' erroneous versions and i did Repair, it did not remove the error.

Now i would again compare every bracket for the nth time.

Thanks again for taking time.

Regards,

Ashu R

Former Member
0 Kudos

Hi,

It looks like there is some mismatch of brackets in between the code. Don't bother about the opening brace in the start of lines

/*

  • The following code section can be used for any Java code that is

  • not to be visible to other controllers/views or that contains constructs

  • currently not supported directly by Web Dynpro (such as inner classes or

  • member variables etc.). </p>

*

  • Note: The content of this section is in no way managed/controlled

  • by the Web Dynpro Designtime or the Web Dynpro Runtime.

*/

//begin others

//end

}

as the opening brace corresponding to this last closing brace is in the start of the code just after the Documentation header

//begin documentation

//end

public class <View/Comp name>

{

So, check for the mis-match of brackets in the middle of the code...

Thanks

RV

Former Member
0 Kudos

Hi Rohit,

I have again checked each and every paranthesis in the code but there is no mis-match.

There is a closing bracket for the Public Class just before these lines of code.

Also, i would like to add here that this commented code and closing bracket is present twice at the end of this form, while other forms have it only once.

It is wierd how it has appeared of nowhere.

Please help.

Thanks and Regards,

Ashu R

Edited by: Ashu Rupani on Nov 9, 2010 8:02 AM

former_member185879
Active Contributor
0 Kudos

Hi Ashu,

This error is because of the unmatched brackets only. Please check again, also check this open bracket and close bracket always comes before //@@Begin and after //@@end, may be somewhere it is missing.

public void Hello()

{

//@@begin

//@@end

}

Check once and reply

Regards

Nizamudeen SM

former_member214651
Active Contributor
0 Kudos

Hi,

Whenever you create a WD component or a WD View, some of the is auto-generated, which will not be removed after deletion. Right click on the WD project and rebuild the project.

This should help you.

Regards,

Poojith MV

Former Member
0 Kudos

Hi Poojith,

Thanks for the reply.

I did "Rebuild the Project", but that piece of code is still there in the Implementation.

The error continues to exist.

Please help.

Thanks and Regards,

Ashu R

former_member214651
Active Contributor
0 Kudos

Hi,

The error is because of the missing bracket "}". First check the number of open brackets and closed brackets. there could be a difference in the numbers.

The code which u have given in the post is a section where u can use plain Java coding and your own classes and other methods which will be treated as global attributes.

Regards,

Poojith MV

ErvinSzolke
Product and Topic Expert
Product and Topic Expert
0 Kudos

fyi: moved to webdynpro as I think this is not related to NWDI.