cancel
Showing results for 
Search instead for 
Did you mean: 

easy check and error message for different transactions

astrid_burghart
Participant
0 Kudos

Hello everybody,

I have the requirement to implement the same check on different transactions (like Lead and Opportunity).

I want to be a good programmer that's why I thought I can create  my reuse library, implement an action and call this action from onSave event of my extended Lead and Opportunity.

My problem is, that I have to throw an error message if the check isn't successful.

(Something like: "Please enter XXX")

It is not possible to raise this error message from the reuse function, isn't it?

Does someone has another Idea how to solve this problem without writing the same code 3 or 4 times in different xbos?

Thanks for your help.

Best regards,

Astrid

Accepted Solutions (1)

Accepted Solutions (1)

d_weinberg
Participant
0 Kudos

Hi Astrid,


You can still use a ReuseLibrary. The respective check method returns a collections of Text in wich you write all errors occuring during the check. In the calling action you can then loop over the result of the library method and simply raise a generic message to which you pass the according text.

If you also need to distibguish between info, warning and error you can create a Dummy BO that contains an element for the message ype (Info, Warning, ...), the text, and whatever else you need. The result of your check message would then be a collection of elments of the Dummy BO.In your reuse library method you then simply create elements of the Dummy BO fill it with the respective info and add it to the result collection. Again in the calling action you can loop over the result and raise the message you want.

Cheers,

Daniel

Former Member
0 Kudos

Yes that is a good solution, and yes, you can't raise a message inside a reuse function as for now

astrid_burghart
Participant
0 Kudos

Hi Daniel,

thanks for your Answer. It was really Helpful,

I have now implement it with a Text Collection as return Parameter.

I fill the Collection with all Texts I need as Error Message.

In the XBO I loop over this collection and raise an error Message every Time.

I created the message like:

    message MsgSomething text "&1":LANGUAGEINDEPENDENT_LONG_Text;

I'm not sure if the Data Type is the best one.

Do you have any better suggestions?

However it woks for me now.

Best regards,

Astrid

d_weinberg
Participant
0 Kudos

Hi,

LANGUAGEINDEPENDENT_LONG_Text is absolutly sufficient, as messages are also length restricted and will be chopped off at the end.


Best Regards,

Daniel

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Alessandro,

This restriction should be overcome with the next HF.

Bye,

   Horst

d_weinberg
Participant
0 Kudos

Hey Horst,

That is actually great news, We are waiting quite a while for that feature. Do you know if also the following issue will be fixed:

Calling a reuse library that in turn calls a SAP standard BO, which raises a message, results in dump.

Best Regards,

Daniel

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Daniel,

This was a topic just this week in our development team.

So I expect that it will be solved with the next HF.  

Bye,

   Horst

d_weinberg
Participant
0 Kudos

Hi Horst,

That is awesome. Thanks for the info.

Cheers,

Daniel

d_weinberg
Participant
0 Kudos

Hi Horst,

Since I did not read anything on the lates studio documentation on the topic of raising messages from reuse libraries I wonder if this is possible by now. Do you have any update on this?

Cheers,

Daniel

Answers (0)