on 01-23-2013 2:12 PM
Hi,
You can specify an inputField cell editor for an ALV column. Doing so would add the little red star in the column header.
But, how to check whether the input field has been filled by the user or not??
In custom dynpro, when you put some required inputFields, you can check with this code:
{code:ABAP}CALL METHOD cl_wd_dynamic_tool=>check_mandatory_attr_on_view EXPORTING view_controller = lo_api_controller. "Export current view API{code}
What about in ALV?
Do I have to do it "manually"??
Thanks in advance.
Best regards,
Guillaume
red star on cloumn is not possible but you can use icon on column header or instead of method CALL l_wd_dynamic_tool=>check_mandatory_attr_on_view
you can use
msg-msgno = '007'.
CALL METHOD lo_message_manager->report_attribute_t100_message
EXPORTING
msg = msg
element = <if_wd_context_element>
attribute_name = 'attribute name' .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
On my system, the code :
lo_input_field->set_state( value = cl_wd_abstract_input_field=>e_state-required )
does set the red star on column header.
I really would like to use cl_wd_dynamic_tool=>check_mandatory_attr_on_view !!
But this takes a IF_WD_VIEW_CONTROLLER as input parameter and I have none to pass because it has to be the view of the embedded ALV.
Giving the current view (taken from WDDOMODIFYVIEW for instance) is unsuccessful.
Thanks for your insights.
Best regards,
Guillaume
Hi Guillaume,
CL_WD_DYNAMIC_TOOL has another method, CHECK_MANDATORY_ATTRIBUTES, which you can also use to check mandatory fields. With this method however, you pass in an explicit list of fields that are considered required.
data lv_error type wdy_boolean.
data ls_attribute type cl_wd_dynamic_tool=>t_check_mandattr_struct.
data lt_attribute_list type cl_wd_dynamic_tool=>t_check_mandattr_tab.
ls_attribute-attribute_name = 'ATTRIBUTE_1'.
ls_attribute-element_index = index.
append ls_attribute to lt_attribute_list.
ls_attribute-attribute_name = 'ATTRIBUTE_2'.
ls_attribute-element_index = index.
append ls_attribute to lt_attribute_list.
lv_error = cl_wd_dynamic_tool=>check_mandatory_attributes(
attribute_list = lt_attribute_list
display_messages = abap_false
context_root = wd_context
).
Cheers,
Amy
Hi,
It works OK!
Did you set the display message to abap_false on purpose?
Indeed, when I click on the link (javascript:sapUrMapi_triggerFocus("WD0202", true)) provided in the Message Area, I get a Javascript error.
Thanks in advance.
Best regards,
Guillaume
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.