cancel
Showing results for 
Search instead for 
Did you mean: 

How to declare global variable

Former Member
0 Kudos

Hi All,

Pls anyone provide me the solution how to declare global variable(string type).

Regards

Ravi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ravi,

Do you want to maintain global variable in a View / controller ?

If it is so, you can declare a variable in your view / component controller between the below.

//@@begin others

//@@end

If you want to maintain for your complete application, you can declare a context attribute in the component controller and map it to required views/controllers.

Regards,

Jaya.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

If you want to crate a global variable for a Component Controller or View Controller (Only specific to that file).

in "//begin others" of the corresponding file you can create any global variables or global methods.

For this purpose you can create a context atrribute also.

And if you want to create a variable in Component Cotroller and you want to use that in all the other (Additionaly/ View Controllers) then create a context attribute and you can map this context attribute to all the remaining controller.

Regards,

Charan

Former Member
0 Kudos

Hi,

In webdynpro java, simple way is to create a context value attribute of string type in the component controller and then map it to the view controller.

Regards.

Rajat