cancel
Showing results for 
Search instead for 
Did you mean: 

Throwing SAP E-sourcing Exceptions

0 Kudos

HI

I have a script that throws Application exception using the IBeanIfc createApplicationException, please refer to the following code:

throw doc.createApplicationException(AssociatedAttribute, MessageId);

I would like to show text from the localised resource list when my exception gets thrown.

I have created a Localized Resource Text item and I have tried using its Resource ID in the createApplicationException method but all I get is the Resource ID printed not the actual text.

Your help will be greatly appreciated.

Kind regards,

Thabiso Kamanga

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Krishna

Thank you very much for your response.

I am using the doc.createApplicationException("<attribute to be associated>" ,"<Localized Resource ID>") method, it works fine but the problem is that it does not print the value of the localised resource but it prints the resource ID.

script:

throw doc.createApplicationException("SOURCING_MANAGER","CExSOURCING_MANAGER");

result on screen:

ID: CExSOURCING_MANAGER

the resource ID gets printed.

kind regards,

Thabiso Kamanga

Former Member
0 Kudos

Hi Thabiso,

Please put the localized resource under 'exception' bundle and make sure that while specifiying the ResourceId in the function call, you do NOT mention the bundle name. Specify the resource id only.

I think this should make it work.

Thanks

Devesh

0 Kudos

Hi All

thank you very much for your responses it worked

placing the resource in the exception bundle worked!

thank you very much for all your help

kind regards,

Thabiso Kamanga

Answers (1)

Answers (1)

Former Member
0 Kudos

HI Thabiso Kamanga,

Try this method.

createApplicationException(java.lang.String sAssociatedAttribute,java.lang.String sMessageId)

sAssociatedAttribute - The attribute to be associated with this exception, or null

sMessageId - Localized Resource ID

Example: doc.createApplicationException("<attribute to be associated>" ,"<Localized Resource ID>")

Parameters:

Hope this will help you.

Thanks

Sai Krishna Reddy