on 10-16-2015 9:50 AM
Hello all
My program save data in table , when i have error. I upload excel file , then press Upload button ,it check the date in rows and if it incorrect print message. And if it found error, the save button must be disabled.How can i make this?
I create WDY_BOOLEAN in CONTEXT and bind it in button in enabled row. Pls help ,where i must write code, in WDINIT and how this code look like, maybe i need add something more in CONTEXT or write code with abap_true, abap_false ?
Hi,
Follow the below steps which will help to resolve your issue.
1)As you are doing validation on click of Upload button and checking of the date in rows are valid or not.
2)
IF ( LV_DATE is not valid).
"show the error message & set the attribute which you have binded to the visiblity property
of button to ABAP_FALSE(here button will be disabled)
data : lo_element type ref to if_wd_context_element.
lo_element = wd_context->get_element( ).
CHECK lo_element is not initial.
lo_element->set_attribute(
exporting
value = 'ABAP_FALSE'
name = '<ATTRIBUTE_NAME>'.
RETURN.
ELSE.
lo_element->set_attribute(
exporting
value = 'ABAP_TRUE'
name = '<ATTRIBUTE_NAME>'.
"Proceed further as per your requirement.
ENDIF.
Below is the code for your reference only.
Hope this helps you.
Thanks
KH
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Pls close the thread if your issue is resolved.If not revert back .
Thanks
KH
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thx , it's very helpful information !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Do the below logic.
1. Bind the visibility property of your Save button to a context of type WDUI_VISIBILITY and make the default value as '01'.
2. So when ever your application starts, user can't see the 'Save' button at any time.
3. Now when the data is uploaded and found that there is no error, make the 'Save' button to visible by make the context value as '02'
lref_context->set_attribute(
name = `FIELDS_VISIBLE`
value = '02' ).
Hope you got it:)
BR,
RAM.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.