on 09-06-2007 12:05 PM
Hi,
I have a dropdown by index. First value of it is blank. Now i have to validate that user must select one value from it. I have written this code but it is not working , also not marking the field with red.
Node_Exit_Type = Node_Z_Eth_Update_Separat->get_Child_Node( Name = wd_This->wdctx_Exit_Type ).
get element via lead selection
Elem_Exit_Type = Node_Exit_Type->get_Element( ).
IF Stru_Exit_Type-EXIT_TYP IS INITIAL.
LV_TEXT = WD_ASSIST->IF_WD_COMPONENT_ASSISTANCE~GET_TEXT( KEY = '001') .
report message
CALL METHOD L_MESSAGE_MANAGER->REPORT_ATTRIBUTE_ERROR_MESSAGE
EXPORTING
MESSAGE_TEXT = LV_TEXT
ELEMENT = Elem_Exit_Type
ATTRIBUTE_NAME = 'EXIT_TYP'.
LS_PARAM-NAME = '1'.
LS_PARAM-VALUE = Stru_Exit_Type-EXIT_TYP.
APPEND LS_PARAM TO LT_PARAMS.
iserror = iserror + 1 .
ENDIF.
can any one help?
Hi, Prosun, thank you for your response.....
I prepare to delete the first null value and set the first non-null value as default lead selection and avoid validation check ......
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Prosun,
Have you resolved this problem?
Right now I encountered the same problem in DropdownByIndex.If you have solved the problem, could you please give the answer to me in this forum or mail it to shaomingpeng@yahoo.com.cn?
I appreciate for your any advice...
Best Regards,
Eddy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you can simply make the field required and then check on mandatory fields,
using the method cl_wd_dynamic_tool=>check_mandatory_attr_on_view
grtz,
Koen
Message was edited by:
Koen Labie
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Whats Stru_Exit_Type? it should be different right?
Thanks
Anzy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
these is the complete code.
data:
Node_Exit_Type type ref to If_Wd_Context_Node,
Elem_Exit_Type type ref to If_Wd_Context_Element,
Stru_Exit_Type type Wd_This->Element_Exit_Type .
navigate from <Z_ETH_UPDATE_SEPARAT> to <EXIT_TYPE> via lead selection
Node_Exit_Type = Node_Z_Eth_Update_Separat->get_Child_Node( Name = wd_This->wdctx_Exit_Type ).
get element via lead selection
Elem_Exit_Type = Node_Exit_Type->get_Element( ).
IF Stru_Exit_Type-EXIT_TYP IS INITIAL.
LV_TEXT = WD_ASSIST->IF_WD_COMPONENT_ASSISTANCE~GET_TEXT( KEY = '001') .
report message
CALL METHOD L_MESSAGE_MANAGER->REPORT_ATTRIBUTE_ERROR_MESSAGE
EXPORTING
MESSAGE_TEXT = LV_TEXT
ELEMENT = Elem_Exit_Type
ATTRIBUTE_NAME = 'EXIT_TYP'.
LS_PARAM-NAME = '1'.
LS_PARAM-VALUE = Stru_Exit_Type-EXIT_TYP.
APPEND LS_PARAM TO LT_PARAMS.
iserror = iserror + 1 .
ENDIF.
Hi,
try this instead:
types:
begin of t_check_result_message,
t100_message type symsg,
context_element type ref to if_wd_context_element,
attribute_name type string,
end of t_check_result_message .
types:
t_check_result_message_tab type standard table of t_check_result_message .
data: lt_messages type t_check_result_message_tab,
lv_message type string,
ls_ieinfo type einfo.
field-symbols: <fs_attribute> type line of wdr_context_attr_info_map,
<fs_case_attributes> type bapiproptb,
<fs_message> type t_check_result_message.
not_complete = abap_false.
call method cl_wd_dynamic_tool=>check_mandatory_attr_on_view
exporting
view_controller = wd_this->m_view
display_messages = ABAP_TRUE
importing
messages = lt_messages.
if lt_messages is not initial.
loop at lt_messages assigning <fs_message>.
move-corresponding <fs_message>-t100_message to ls_ieinfo.
call function 'MESSAGE_GET_TEXT'
exporting
ieinfo = ls_ieinfo
ilangu = sy-langu
importing
etext = lv_message
exceptions
no_t100_found = 1
others = 2.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
else.
report message
call method wd_this->m_messages->report_attribute_error_message
exporting
message_text = lv_message
element = <fs_message>-context_element
attribute_name = <fs_message>-attribute_name.
endif.
endloop.
not_complete = abap_true.
exit.
endif.
grtz,
Koen
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.