on 01-31-2011 5:19 PM
Suppose there are some mandatory input fields in the view, and If user doesnt enter particular one or more fields then it should display some message for user to enter that field otherwise validation should not proceed for first view.
Yes. There is a helper class to perform the required check and issue the appropriate messages.
CL_WD_DYNAMIC_TOOL=>CHECK_MANDATORY_ATTRIBUTES or CL_WD_DYNAMIC_TOOL=>CHECK_MANDATORY_ATTR_ON_VIEW
You can read about it here:
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/d7/ef8841e3af1609e10000000a155106/frameset.htm
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi JohnRight,
Pleace below code inside wddomodifyview.
DATA : l_view_controller TYPE REF TO if_wd_view_controller,
lv_messages TYPE cl_wd_dynamic_tool=>t_check_result_message_tab.
l_view_controller = wd_this->wd_get_api( ) .
CALL METHOD cl_wd_dynamic_tool=>check_mandatory_attr_on_view
EXPORTING
view_controller = l_view_controller
display_messages = abap_true
IMPORTING
messages = lv_messages.
Local varibale lv_messages will contains all the attribute names which are mandatory but not filled by user. Yo can loop all the records in lv_messages.
Loop at lv_messages.
Print errors using WD message manager and Report T100 messages -
LV_MESSAGES[<LoopIndex>]-ATTRIBUTE_NAME
endloop.
Thanks,
Prashant
Hi,
u can write logic like this.
LOOP AT it_message_tab INTO wa_message_tab.
CASE wa_message_tab-attribute_name .
WHEN 'CARRID'.
l_message-context_element = wa_message_tab-context_element.
l_message-attribute_name = wa_message_tab-attribute_name.
l_message-t100_message-msgty = 'E'.
l_message-t100_message-msgid = ''.
l_message-t100_message-msgno = '046'.
IF l_message_manager IS BOUND.
l_message_manager->report_attribute_t100_message(
msg = l_message-t100_message
element = wa_message_tab-context_element
attribute_name = wa_message_tab-attribute_name ).
endloop.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
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.