Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

ALV comp. - make field mandatory

Hi,

I have WD where I use ALV for entering data. However, the first fiekd PERNR must be entered.

In WDDOINIT I have done the following:

This only produces a red star beside the field name. I can still leave the field blank. ??

Is WDDOINIT the right place to place the code ?

  loop at lt_columns into ls_columns.
    case ls_columns-id.

      when 'PERNR'.
        create object lo_pernr
          exporting
            value_fieldname = ls_columns-id.
        ls_columns-r_column->set_cell_editor( lo_pernr ).
        lo_pernr->set_state(  01 ).   and so on.....

Tags:
replied

making mandatory doesn't help in case of alv.

1. get all record of alv .

2. put loop  records if any record have pernr blank  raise error

3. if you want to highlight row in which error occur  first set node lead_selection_index equal to sy-index

get selected element

then use method REPORT_ATTRIBUTE_ERROR_MESSAGE  for raising error

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question