cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a dynpro property on the WAS and get it in code?

Former Member
0 Kudos

Hello,

I remember that once I've read at the NWDS help that I can create dynpro properties which can be configured on the WAS's Configuration Adapter serviceand can be retreived when the dynpro application loads. I need to use it now but can't find the explanation and code example. Can someone please show me how to do it?

Roy

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Roy,

Are you asking about reading a configuration/properties file from WD?

If so, read further otherwise kindly ignore this post and can you exaplain in more detail?

If you had installed NWDS, in the help docs you can find the following content. It will be in your localhost.

http://127.0.0.1:1772/help/index.jsp?topic=/com.sap.devmanual.doc.user/b8/aa343e32ff1033e10000000a11...

Thanks and regards

RK

Former Member
0 Kudos

Dear Radha,

Thank you for the response.

Let me elaborate this a little bit: I have a certain value that I would like DynPro to read when the component inisializes. This value changes from My development environment and the production one (suppose a certain link inside the portal). Now, if I'll use properties file I'll have to modify the file with the relevant value when I work on development and production. If I will have this value on the WAS, I will only need to configure it once on the development WAS and the production WAS. Assuming the value has the same name no modification what so ever needs to be done when moving the application fron development to production. Now, I remember I saw such an option for DynPro apps but I can't remember where... If you or someonwe else could please guide me through this feature he/she will be more than welcome...

Roy

Former Member
0 Kudos

Hi Roy,

1. create a .properties file with the key value pair.

2. Put it in src/configurations/application/<app name>

3.

WDDeployableObjectPart App = wdThis.wdGetAPI().getComponent().getApplication().getDeployableObjectPart(); 
IWDConfiguration Configprop = WDConfiguration.getConfigurationByName (App,property file name ); 

// get the string value of the property. 

String value = Configprop.getStringEntry ("<key of the property sheet>");

To chaneg the property value outside the application,

Goto configuration adapter -> WEbdynpro -> the app name. Under that you will find the property file

You can edit the file and restart the server.

Regards

Bharathwaj

Former Member
0 Kudos

Hello Bharathwaj,

Thank you for the response, I think that this is what I've looked for. I will be next to my portal only at the begining of next week and I'll let you know the results. One more question though: are you sure that changing the value requires me to restart the whole server?

Roy

Former Member
0 Kudos

Hi Roy,

Never given it a thought before..

Logically speaking , Visual Admin is a online editing tool.. You should not need a server restart .

Rgds

Bharath

Former Member
0 Kudos

Hey Bharathwaj,

I am having problem implementing this: I do see the properties file on the WAS but when I try to get a property I receive null. I don't know if it matters but I have two Apps at this project...

Former Member
0 Kudos

Hello again,

I apologize, it's working, my mistake.

The only problem is that a value change does require a restart. Another solution is simply delete the node from the configuration adapter and redeploy the application. In any case thank you for the help.

By the way, this solution is presented at the Quiz tutorial, now I remember...

Answers (0)