cancel
Showing results for 
Search instead for 
Did you mean: 

Losing Data Validation Messages when writing back to context

mike_mcinerney
Participant
0 Kudos

( The base for this question is the ALV grid in section 2 of this [TimeSheetMockUp|http://www.duke.edu/~michaelm/TimeCard/AnnotatedTimeSheet.jpg] )

Users enter values in the white cells which represent the hours recorded on a given day for a certain type of time.

Lets say we have a z-object that supplies us with the overall grid structure, including the headers and (the shaded) summarization cells. The web dynpro ALV had been set to allow input only on the raw data cells. They are set to 4 places with one decimal.

As the app was being developed, when we entered invalid data in a cell, such as 123456, or 1.2345 or u2018qu2019, a nice message was displayed that told the us about the issue. This was free u2013 I guess the phase model does that for us, and we liked it.

Well, down the road a pieceu2026 we needed to add a method to recalc all the summary values from the raw inputs.


METHOD wddoafteraction .
* wizard: navigate to and get the rows data                         *
  DATA lo_nd_nd_rows TYPE REF TO if_wd_context_node.
  DATA lt_nd_rows TYPE wd_this->elements_nd_rows.
* navigate from <CONTEXT> to <ND_ROWS> via lead selection
  lo_nd_nd_rows = wd_context->get_child_node( name = wd_this->wdctx_nd_rows ).
  lo_nd_nd_rows->get_static_attributes_table( IMPORTING table = lt_nd_rows ).

* do the math                                                       *
  DATA lt_updated_rows TYPE wd_this->elements_nd_rows.
  CALL METHOD wd_assist->o_wc->recalc_update_and_return_wrows
    EXPORTING
      im_rows = lt_nd_rows
    IMPORTING
      ex_rows = lt_updated_rows.

* repopulate the rows                                      *
  lo_nd_nd_rows->bind_table( new_items = lt_updated_rows set_initial_elements = abap_true ).

Now, weu2019re losing all the nice data validation messages u2013 they do not display (the offending entries are just cleared) !!!

After some investigation, it seems that the bind_table call is where they get lost (without that call, they appear) .

Iu2019ve tried placing this code in a number of hook methods, but the same thing occurs. It is currently in the viewu2019s afteraction hook.

So, u2026 I have two questions.

u2022 How do I get my nice messages back. ?

u2022 Where is the right place to update my context from

( Btw, downstream, our recalc outines will also want to throw messages that we will want processed after we get through the initial validation )

Thanksu2026

u2026Mike

Accepted Solutions (0)

Answers (1)

Answers (1)

mike_mcinerney
Participant
0 Kudos

Fixed with SAP Note 1410122 - WD ABAP ALV: Messages are not displayed