cancel
Showing results for 
Search instead for 
Did you mean: 

How do I edit the file created by code generator?

Former Member
0 Kudos

hi all,

I want to modify a java file that is generated when you create the webdynpro, but I can not change.

// -


// This file has been generated partially by the Web Dynpro Code Generator.

// MODIFY CODE ONLY IN SECTIONS ENCLOSED BY @@begin AND @@end.

// ALL OTHER CHANGES WILL BE LOST IF THE FILE IS REGENERATED.

// -


how can I disable the file to modify

thanks!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Pablo.

There's no way to modify it, NW2004s and its IDE has a code compilation based in some internal scripts based on eclipse plugin architecture.

In your code you must consider this.

1 - Try to find in your declared methods, importing directives, packages declarations some like this:

// -


// This file has been generated partially by the Web Dynpro Code Generator.

// MODIFY CODE ONLY IN SECTIONS ENCLOSED BY @@begin AND @@end.

// ALL OTHER CHANGES WILL BE LOST IF THE FILE IS REGENERATED.

// -


package com.sap.teste;

//

// IMPORTANT NOTE:

// ALL IMPORT STATEMENTS MUST BE PLACED IN THE FOLLOWING SECTION ENCLOSED

// BY @@begin imports AND @@end. FURTHERMORE, THIS SECTION MUST ALWAYS CONTAIN

// AT LEAST ONE IMPORT STATEMENT (E.G. THAT FOR IPrivateTesteApp).

// OTHERWISE, USING THE ECLIPSE FUNCTION "Organize Imports" FOLLOWED BY

// A WEB DYNPRO CODE GENERATION (E.G. PROJECT BUILD) WILL RESULT IN THE LOSS

// OF IMPORT STATEMENTS.

//

//@@begin imports

import com.sap.teste.wdp.IPrivateTesteApp;

import com.sap.myimport.MyClass;

//@@end

//@@begin

//@@end

it means that between begin and end...you can add what you want..and the code will not be removed after class compilation....

//@@begin javadoc:wdDoExit()

/** Hook method called to clean up controller. */

//@@end

public void wdDoExit()

{

//@@begin wdDoExit()

//@@end

}

int this case too....if you implement something between //@@begin and //@@end in the method scope...all part of your code will be surely safe.

Answers (0)