cancel
Showing results for 
Search instead for 
Did you mean: 

Sharing Message Pool between DCs

Former Member
0 Kudos

Hi,

I have multiple DCs in my project. Most of the user messages raised by these DCs are similar. So I want to create messages in one of the DC's message pool and use this message pool from other DCs.

I created messages in one of the DC, created public parts for the component and referenced them in another DC.. I am able to access the component but not able to access the message pool directly (using IMessagexxxxx). I can write methods in interface controller and access them from other DCs but I want to have one single method which can take message key as argument and return the message text. I am able to achieve this if I use resourcebundle (properties file) but I want to use message pool (.xlf file).

Is it possible to share message pool between DCs? If yes, could you please give some hints on how to achieve this?

Thanks

Ram

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member201361
Active Contributor
0 Kudos

hi Ram ,

have a look at this article ..

this article fulfills ur requirement .

[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f4d79e59-0601-0010-0689-89670315bc6b]

Thanks and Regards

Former Member
0 Kudos

Hi Fazal/Manoj,

Thanks for the response. According to the article, we have to pass a string message key to the method and with in the method we have to write several if and elses to get to our message. If I have lot of messages (more than 50), then I have to write that many if and else conditions.

Is it possible to pass the message key directly instead of the string as argument? For ex., I want to pass IMessageMessageClassComp.FIELD_NOT_MATCHING instead of "NotMatching". Why the interface IMessageMessageClassComp is not visible from other DCs even after exposing the whole component as public part?

Thanks

Ram

Former Member
0 Kudos

Hi,

Create a method like this:

public com.sap.tc.webdynpro.progmodel.api.WDMessage getMessageByKeyAndType( java.lang.String messageKey, com.sap.tc.webdynpro.services.message.WDMessageType messageType )

{

//@@begin getMessageByKeyAndType()

return new WDMessage("<package>.IMessage<componentname>",messageKey,messageType);

//@@end

}

Now, you can call this method and just pass the key as string to get the message.

Regards,

Murtuza

Former Member
0 Kudos

Hi,

What you can do is that you can have an interface for the common DC. In the Component interface you can have a method which will accept the message key and return the message text. The DC where you want to use the messages, declare the usage of the common DC as Used webdynpro components.

Now you can call the method that you defined in the interface controller to get the message text.

Hope this helps.

thanks & regards,

Manoj