on 04-24-2013 4:06 PM
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.....
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Peter,
Whenever we work on validation on normally write the code on WDDOBEFOREACTION method.
Now you have make the particular column as mandatory .
Generally we use standard class method
"cl_wd_dynamic_tool=>check_mandatory_attr_on_view " to validate the mandatory field .on WDDOBEFOREACTION method. But this is use for current view only .
I assume u have used view container element for ALV . so this method will not use .
Try with "cl_wd_dynamic_tool=>CHECK_MANDATORY_ATTRIBUTES" on WDDOBEFOREACTION method .
thanks and regards,
Anup Banerjee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Peter,
When you want to check this validation, that you have to decide first and place your code accordingly.
lo_pernr->set_state( 01 ). is works for you.
Or you can highlight perticular column using REPORT_ATTRIBUTE_ERROR_MESSAGE as suggested yadav.
Cheers,
Kris.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Peter,
Please throw an error message by checking the pernr value is initial or not.
Thanks,
Sudheer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.