on 08-17-2010 1:04 PM
Hi there,
i know that in ALV an error-message appears and the cell is marked if an user puts a not allowed value in the cell.
Now i want to achieve the same in my non-alv-table. If a user enters a value in a specific cell, i want to output a message and mark the specific cell as "wrong". Can anyone provide me with a code-example?
Best regards
David
HI,
Even in table cell if a value is entered that is not permitted ,system issues an error message and highlights the cell after some action is performed.
Case1: Suppose you enter a character value in date field and perform some action system performs the checks, issues an error message an higlights the cell.
Case 2: If validation of the entered value needs to be done programatically after an action is performed the use the below logici in the WDOBEFOREACTION method.
a) Get the node binded to the table( lo_node = wd_context->get_child_node('Node Name").
b) Using the node reference get alll the elements using the method GET_ELEMENTS of IF_WD_CONTEXT_NODE i.e lo_node.
c) Now loop at list of elements and for each element use the method GET_STATIC_ATTRIBUTES to get the attribute values
d) Do the required validation if some error is found use REPORT_ATTRIBUTE_ERROR_MESSAGE using the attribute name and element refernece.
Hope this helps.
Regards,
Madhu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
As mentioned the methods of the message manager that mention "attribute" do allow you to highlight a given field.
There are multiple of these:
REPORT_ATTRIBUTE_ERROR_MESSAGE
REPORT_ATTRIBUTE_EXCEPTION
REPORT_ATTRIBUTE_T100_MESSAGE
REPORT_ATTRIBUTE_MESSAGE
NB that you can even report multiple attributes of the same element using the
REPORT_ELEMENT_EXCEPTION
REPORT_ELEMENT_T100_MESSAGE
REPORT_ELEMENT_ERROR_MESSAGE
Do be aware however that you will have issues highlighting drop-down by index UI elements using any of these methods. (it certainly hasn't worked for me in the past) the problem being that these UI elements are not really bound to any element or attribute, but a node... I'm keeping my fingers crossed for some sort of solution in NW7.02 when it finally gets to us.
Chris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
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.