cancel
Showing results for 
Search instead for 
Did you mean: 

How to Handle ALV Triggered Error Messages?

satyajit_mohapatra
Active Contributor
0 Kudos

Hello Experts,

I've a couple of editable ALVs embedded inside tabstrip areas. The user should not be allowed to navigate to another tab, until all the input value errors in ALV, in current tab are resolved.

I'm handling all the validation in ON_DATA_CHECK method of respective ALVs and displaying the error messages using WD message manager. I'm changing the colour of the errored cells using cell design property. The data check is being called through DATA_CHECK method of the ALV interface, when tabs are being switched. I'm checking the r_param->t_error_cells[] also inside ON_DATA_CHECK, to check if there are any error cells.

It works fine for some cells. But, if a cell has an attribute value set bound in the context property or has some automatically determined search help like Date, the ALV handles them automatically without triggering the ON_DATA_CHECK method. The cells are marked with some colour and the message is being displayed automatically in the ALV. I'm not able to figure out how to capture these messages. I need to restrict the navigation to other tabs based on these standard ALV triggered errors as well.

I'm looking for something like method 'Add_Protocol_Entry' in OOPS ALV. Please let me know, if something like that is available in WD as well. If not, please let me know how to handle the errors triggered by the ALV automatically.

Thanks a lot in advance...........

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

you wanted to know the standard messages arised for some of the attributes like DATE (for ex: Invalid date format) which is thrown by the framework right..

Can you get the message manager reference IF_WD_MESSAGE_MANAGER and check for the methods GET_MESSAGES,

HAS_VALIDATION_ERRORS, IS_EMPTY if they return any thing for these standard ones.

Hope my understanding is correct.

Regards,

Lekha.

satyajit_mohapatra
Active Contributor
0 Kudos

I tried it...but the problem is none of the events get triggered when the error message is thrown by the Framework, while swithcing the tabs. So, my code to read the messages never gets triggered.

former_member199125
Active Contributor
0 Kudos

hi Satya,

I think we need to catch the exceptions( alv triggered messages), i am not sure about that how to do, its just idea.

Regards

Srinivas

satyajit_mohapatra
Active Contributor
0 Kudos

I'm trying to figure out the same. But, I've not got any methods available for it, yet.

Please let me know, if there is any SAP Demo WD component to demonstrate editable ALV functionality inside tabstrips.

Former Member
0 Kudos

wehn a standard error is throw there is no event to catch those things...You need to check on the TAB select event only.

In the ONTAB SELECT, try to get the message manager instance and check for any errors usign the methods pointed....

if any one of these returns the error flag then reset the tab to previous one by not changing .

I have done my developments with editable ALVs inside the tab strip. If you go through the model class of ALV, this standard class will have its own message manager instance...

Edited by: Lekha on Dec 23, 2011 2:35 PM

satyajit_mohapatra
Active Contributor
0 Kudos

missed to mention one thing earlier....I'm using two WD components. The first component contains the tabstrip and the second component has the ALVs. I'm embedding these ALVs in the first component. My Bad...:-(

I was doing exactly the same thing, you have mentioned. But I was using GET_MESSAGES, which was not returning any ALV messages.

Now, I'm using HAS_VALIDATION_ERRORS which is working fine. Also, the event on select tab was not getting triggered in the main component in case of ALV errors messages. I'm not sure why. So, I'm using WDDOBEFOREACTION of the main view of main component. It's working now.

Thanks a lot for your help.....

satyajit_mohapatra
Active Contributor
0 Kudos

Also, the event on select tab was not getting triggered in the main component in case of ALV errors messages. I'm not sure why.

The event created was type 'Standard'. It should be 'Validation Independent'.

I need to pay more attention to all the options available in the WD framework in future...:-)

Answers (0)