on 04-15-2015 9:00 AM
Hi,
i would suggest:
- read your column in the action of the save button, if it is inital
- if initial enable the field.
you can do this by binding the attribute enable to a boolean in the context and change value of this boolean in the context or change it direct in the attributes of the UI element.
regards
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Karthik,
when you click the save Button, the action assigned to this button is executed. In this coding you have to check if your column is filled.
If the column is not filled change attributes of the ui filed to enable it.
Sorry, maybe you cann specify the problem? Is it the coding in the action to check if column is initial or is it changing of the attributes?
Please check the document provided by Rama, it gives you a goof example on what to do.
regards
Alex
Hi Alex,
Thanks for your reply .
I have used the below sort of code inside the loop Statement of SAVE method ..Still, I could able to see the field in disable mode but not in Enable mode ...
IF lv_attr_name = 'DAY1' OR lv_attr_name = 'DAY2' OR lv_attr_name = 'DAY3' OR lv_attr_name = 'DAY4' OR
lv_attr_name = 'DAY5' OR lv_attr_name = 'DAY6' OR lv_attr_name = 'DAY7' .
lo_el_timesheet->set_attribute_property(
EXPORTING
attribute_name = lv_attr_name
property = if_wd_context_element=>e_property-enabled
value = abap_true ).
ELSE.
lo_el_timesheet->set_attribute_property(
EXPORTING
attribute_name = lv_attr_name
property = if_wd_context_element=>e_property-read_only
value = abap_false ).
ENDIF.
Can u suggest an idea on it .
Regards,
Karthik s
Hi Karthik,
Create one new attribute to control the read only(with type wdy_boolean) and bind it with the required field's read only property , post save action you can call one more method there check the initiality of the required fields , if those are initial make the fields are editable.
- Gowtham.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Karthik,
i have created a table and a button in the screen , inside the table's node have created one more attribute called 'R1(type wdy_boolean)' to control the read only property and binded the same R1 with all table fields read only property.
and in the submit button click i am calling this code to enable the fields:
DATA lo_nd_vbap TYPE REF TO if_wd_context_node.
DATA lo_el_vbap TYPE REF TO if_wd_context_element.
DATA ls_vbap TYPE wd_this->element_vbap.
DATA lt_vbap TYPE wd_this->elements_vbap.
lo_nd_vbap = wd_context->get_child_node( name = wd_this->wdctx_vbap ).
lo_el_vbap = lo_nd_vbap->get_element( ).
lo_nd_vbap->get_static_attributes_table(
IMPORTING
table = lt_vbap ).
CLEAR ls_vbap.
LOOP AT lt_vbap INTO ls_vbap.
MOVE ' ' TO ls_vbap-r1.
MODIFY lt_vbap
FROM ls_vbap
TRANSPORTING r1.
ENDLOOP.
lo_nd_vbap->bind_table( lt_vbap ).\
and this will enable the read only input fields into editable fields.
- Gowtham
Hi Gautham,
I have tried the same but i could not able to see the fields of a table as Enabled one .
Can u suggest idea on the same ..
I have listed the screen shot for reference ...
Code :
CLEAR ls_timesheet_1 .
LOOP AT lt_timesheet_1 INTO ls_timesheet_1 .
if ls_timesheet_1-day1 is initial or ls_timesheet_1-day2 is initial or ls_timesheet_1-day3 is initial or
ls_timesheet_1-day4 is initial or ls_timesheet_1-day5 is initial or ls_timesheet_1-day6 is initial or
ls_timesheet_1-day7 is initial .
MOVE space TO ls_timesheet_1-read_day1 .
endif .
MODIFY lt_timesheet_1 FROM ls_timesheet_1 TRANSPORTING read_day1 .
ENDLOOP.
lo_nd_timesheet_1->bind_table( lt_timesheet_1 ).
layout :
Regards,
Karthik S
Hi Karthik,
You need to use the READ ONLY property of context attributes in your case.
If there is empty value, set the value read_only to FALSE.
Please refer my document below , Hope it suits your requirement
In the above document, i used lock and unlock buttons, you can use logic of unlock for SAVE action as your requirement.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.