cancel
Showing results for 
Search instead for 
Did you mean: 

changing properties file value without redploying code

asif_hirani
Active Participant
0 Kudos

Hi,

If I use properties file colors.properties in my web dynpro application for storing key-value pairs as

color1=RED

color2=BLUE

color3=GREEN

is it possible to change colors.properties in future to show new colors

color1=ORANGE

color2=YELLOW

color3=PURPLE

without redeploying code ? through Visual Admin / Config tool ?

If not, what is the other way to avoid hard coded values in Web Dynpro Java ?

Thanks !!

Accepted Solutions (1)

Accepted Solutions (1)

siarhei_pisarenka3
Active Contributor
0 Kudos

Hi asif

Yes it's possible with WebDynpro configuration API. See the javadocs here: [Package com.sap.tc.webdynpro.services.sal.config.api|http://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/services/sal/config/api/package-summary.html]

If you put your property file inside WebDynpro component it'll be deployed to J2EE Configuration Adapter repository. Later on you can edit the properties in Config Tool. However, restart of the WebDynpro application is required after you modified the properties in Config Tool.

BR, Siarhei

asif_hirani
Active Participant
0 Kudos

Hi Siarhei,

I do not have access to config tool right now, will you be able to tell me how exactly I can reach this (eg colors.properties) file through config tool. ?

Thanks !

siarhei_pisarenka3
Active Contributor
0 Kudos

Hi Asif

Check the docu: [Configuration Service|http://help.sap.com/saphelp_nw70/helpdata/en/b8/aa343e32ff1033e10000000a114084/content.htm]

1. Put property file in _comp\src\configuration\default.properties

2. Read the properties with help of the API I posted before.

3. Modify the properties in ConfigTool->appcfg-><app_name>->propertysheet

It's possible to use named property files instead of default.properties. You have to put the colors.properties under the Webdynpro component in \_comp\src\configuration\Components\<comp name>\colors.properties. In the case a path in ConfigTool's tree will be a little bit deeper then for default.properties.

BR, Siarhei

Former Member
0 Kudos

Hi,

Its can be achieved using the WDConfiguration API of Java Webdynpro.

The details are given in the blog below;

/people/daniel.wirbser/blog/2005/09/28/properties-files-in-web-dynpro-applications-how-to-use-the-wdconfiguration-api

Also for changing this properties all we need to do is from Visual Administrator/Config tool(changing from config tool will need a re-start)

Proceed as follows to start the Visual Administrator:

1. Start the Visual Administrator by double-clicking on file go.bat in the file directory C:\usr\sap\<System ID>\<System Number>\j2ee\admin, in which the J2EE Engine is installed. For example, the background file can be stored in directory C:\usr\sap\J2E\JC00\j2ee\admin.

You can find a description of the Visual Administrator in the SAP Library under SAP NetWeaver u00AE Application Platform (SAP Web Application Server) u00AE J2EE Technology in the SAPWeb Application Server u00AE Administration Guide u00AE Server Administration u00AE SAP J2EE Engine Administration Tools u00AE Visual Administrator.

2. Navigate to directory Server 0/Services/ Configuration Adapter / webdynpro/ <sap.com/Your namespace>/ <Your Web dynpro application>

3. Select the property file

4. The Visual Administrator opens so that you can edit the values. You can change or redefine the parameters and check the option "Use Custom " to take the new value.

Thats all.

One more URL is

http://help.sap.com/saphelp_nw04/helpdata/en/09/a4d6a674bc1d4a9e74abf81bed3ef6/frameset.htm

Regards

Priya

Answers (2)

Answers (2)

Former Member
0 Kudos

Dear Asif,

You could create a custom database table in R3 for for stroring the key/description, thenusing RFC you can import the data to your WDJ application.

Hope it helps!

Upendra Agrawal

p330068
Active Contributor
0 Kudos

Hi Asif,

If you use store colors.properties file in the Knowledge managenent (KM) and use this file in web dynpro for Java...then you can modify colors.properties file without modifying/deploying web dynpro for Java code

Check this [thread |;

Hope this will help you.

thanks

Arun Jaiswal

Edited by: Arun Jaiswal on Feb 26, 2010 2:29 PM