on 03-05-2013 6:07 AM
Hello
I have developed a WDA wherein the adobe interactive form is the UI element. The form has diferent kind of fields (free text field, dfrop-down fld, date field, dewcimal field), if user enterd a invalid data then obviously we will get the below exception / error messages (pls. see 3 attachments),
I know the root causes of these issues, but bcz of some reasons i need to capture these exceptions (i put break-points in all methods/actions of my WDA but none was triggered), i mean,
1) From where (class. method, piece of code) these are throwing?
2) Immediately after generation of this message i want to put some piece of my custom code
3) I want to modify these messages descriptions/text is it possible, if so, how?
4) Immediately prior to throwing/generating of these exceptions, i want to place my custom code
Pls. help me
Thank you
Also check if there are custom methods in wdDoModifyView()
even input value validation done in this method as well.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Agreed, yes, we can do input validation, but bcz of some reasons we are not doing. I didn't understood that wht do you mean of checking the custom methods in wdDoModifyView? do you mean, i need to chk the code of wdDoModifyView, if so, there is no custom methods in it, just i put simple 10 lines of ABAP code.
Thank you, pls. see my reply to Abdullah
Hi,
The message details what you have mentioned are standard messages generated based on validation of input fields.
I dont hink you can change these message texts or do any futher processing on that.
Once you do any action in WDA this validations are handled by the WD framework inside the phase handling instance generated during server round trip.
Also this is treated as one of the advantage of WDA as all the ABAP validation checks processed in WDA without any extra efforts.
Still if it u to generate any custom message, you can do something inside 'WDBEFOREACTION' or any hook methods where you can get context value available.
Regards,
Monishankar Chatterjee
Thank you.
Yes, i can do validations on WDDOBEFOREACTION or any hook method, but i hv bunch of fields, hence it bit tedeous and users/testers may enter crazy data in IURT, hence to cover all these scenarios i thought capture the said satndard message is best solution, so, as per your idea its not possible to achieve my requirement that capturing that those messages?
Hi,
Yes it seems to me like the same.
Check the phase model instance generated suring roundtrip. Here API controls the validation & handled by standard handlers.
http://help.sap.com/saphelp_nw04s/helpdata/en/d2/8acd409cc4dd50e10000000a1550b0/content.htm
I think you have put your custom validation inside the hook method.
You can try using 'IF_WD_VALIDATION' to make your rffort easier.
Regards,
Monishankar Chatterjee
Thank you, it worked (i mean, am asking standard SAP to do all validations on all my context, hence i skipped my part of validation,which is tedeous as i hv bunch of fields)
I replicated the below code of WDR_TEST_INPUT into my_WDA's BEFORE_ACTION method,
method supply_messages .
data: context type ref to if_wd_context,
component type ref to if_wd_component,
exception_manager type ref to cl_wdr_message_manager,
context_is_valid type ABAP_BOOL.
data: text1 type if_v1=>element_messages,
texts type table of if_v1=>element_messages,
messages type string_table.
component = wd_comp_controller->wd_get_api( ).
exception_manager ?= component->get_message_manager( ).
context = wd_context->get_context( ).
context_is_valid = exception_manager->if_wd_validation~is_context_valid(
context = context ).
if context_is_valid = ABAP_FALSE.
messages = exception_manager->if_wd_validation~get_messages_for_context(
context = context ).
loop at messages into text1-text.
append text1 to texts.
endloop.
node->bind_elements( texts ).
endif.
endmethod.
Here MESSAGES itab is holding the said the standard SAP messages, hence i can address them as per my req.
Thank you
Hi ,
Open your application in debug mode and create a watch point with message number.Then debugger will get stop at respective method.
Thanks
Naresh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any help pls.?
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you. Yes, i followed your suggestion and WDdoBeforeAction was triggered, then error/excption (as i said above 3 kinds) are creating in CL_WDR_MESSAGE_MANAGER~CHECK_AND_PROC_VALIDATION method, then Component Controller's methods (first WDDOBEFORENAVIGATION, then WDDOPOSTPROCESSING) are triggering.
But, how should i handle this situation, bcz errors are creating in a standard SAP class's method (CL_WDR_MESSAGE_MANAGER~CHECK_AND_PROC_VALIDATION) wherein we don't have Enhancement options to EXPORT a flag to MEMORY ID and when my control reaches the Component Controller's methods (first WDDOBEFORENAVIGATION, then WDDOPOSTPROCESSING) my WDA don't know that exception was created (i checked any Gloabal data in debugger's desktop_1 tab, there is nothing), so in this situation how can capture the raised exception?
Thank you
When the debugger stops in the CL_WDR_Message_Manager method, see the stack of called programs. You will find the exact location in the WDA component where this is called. The Message Manager is just a message manager. It does not know that there is an error. You need to find where that message manager is being called. That piece of code in the WDA component is what causes the error message. Then, you can enhance that WDA compoenet to do whatever you want.
Thank you, yes, i also thought in the same way that by using the CALL STACK i can address my issue, but if i see the sequence is as below,
1) First, BeforeAction is triggering, well then, its jumping to
2) Message Manager CLASS with the below CALL STACK,
Then, coming back to Component Controller's BeforeNavigation as below,
Finally PostProcessing is triggering and then the standard SAP's Error messages is throwing on the view!!
Thank you
Any help pls.?
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you, but this message is coming from standard SAP, its not our custom message. After entering the data on the screen which ever button (say, i pressed my_button and its asscoiated action is my_action) i pressed immediately am getting this exception, i put break-point in all methods/actions of my WDA, but non is triggering!!
Thank you
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.