on 11-14-2014 3:34 PM
Hi Experts,
I have made the Custom Pop-up with label,text field and OK button.
If I place the new value in text field of Pop-up Window, I need to pass that value to the Main screen of specific field
I have attached the screen shot for reference .
1.
2. New Value is 8.00 ..which i need to place in column Sat ...Can i get an idea for the same..
On Press of OK button...I need to place 8.00 in column Sat
Regards,
Karthik S
Hi Karthik,
How are you calling popup window? i.e. using a button outside table / a button withing a table cell
To get required row number of table, either you need to select row and then trigger popup window or you should have button in each row ( Change_Value ), on click of button, you would get the row number and you can use that row to set value to required column.
Regards,
Rama
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 click on OK Action inside the OK Action method get the table data in to temporary internal table and index of the row selected and modify the table entries using the index
validate the table entries(Refresh the table data) and bind the internal table data to table.
Regards,
Rajesh K
Hi Karthik,
Inside the event handler of LINK TO ACTION, you need to read the context_element on which the action happened.
You can try either of the below option
Approach 1:
Option1:
Add a parameter CONTEXT_ELEMENT of type ref to IF_WD_CONTEXT_ELEMENT
Now, write the below logic
data lv_row_index type i.
lo_row_index = context_element->get_index( )
Option 2: You can get context element from WDEVENT parameter as well
data lo_element type ref to if_wd_context_element.
data lo_row_index type i.
wdevent->get_data(
EXPORTING id = 'CONTEXT_ELEMENT'
IMPORTING value = lo_element ).
lo_row_index = lo_element->get_index( ).
The row index, you can save in view's attribute
- Create an attribute gv_current_row_index of type I
wd_this->gv_current_row_index = lv_row_index.
Now, use the index in YES action, to set data to table row.
Approach 2:
you can also do by storing the reference of CONTEXT_ELEMENT in view attribute
Create an attribute GO_CURR_ELEMENT of type ref IF_WD_CONTEXT_ELEMENT in VIEW ,
on_link_to_action.
wdevent->get_data(
EXPORTING id = 'CONTEXT_ELEMENT'
IMPORTING value = wd_this->go_curr_element ).
ON_YES_BUTTON_ACTION
" Read the changed value from popup window
lv_changed_value = ......... ?
WD_THIS->GO_CURR_ELEMENT->set_attribute(
exporting
name = 'DAY3'
value = lv_changed_value )
Hope this helps you.
Regards,
Rama
Hi Rama,
Thanks a lot for your ideas...
I have tried yr' first approach ...i can able to get the index of it.
But, my problem is ...Based on index value, iam building an tempory table of specific view...which i need to use it SAVE button of component controller .
Can u suggest me an ...of how to use the temporary table values of specific view to the Component Controller of SAVE button ....
I have attached the screen for yr reference ...
Regards,
Karthik S
Hi Karthik,
If your requirement is to use the temporary table on SAVE action.
Proceed as below
You access the temp table as : wd_comp_controller->gt_temp_timesheet.
You access the temp table as: wd_this->gt_temp_timesheet.
you need to write the logic in assistance class method for saving data into data base table
Let us say you have a class method SAVE_DATA in class zcl_assist_wd, pass the temporary internal table values on SAVE action
on_save_action...........
Create a parameter IT_DATA of similar kind to temp table.
WD_ASSIST->SAVE_DATA(
EXPORTING IT_DATA = WD_THIS->GT_TEMP_TIMESHEET ).
Inside SAVE_DATA method of assistance class write the save logic
modify ztable from table it_data.
Hope this helps you.
Regards,
Rama
Hi Rama,
Thanks for your reply...
Is it necessary for me create the asistant class to store the data ..??.
In the above screen, I made linktoAction from Sat to Fri Columns...I will be having multiple line items too ...
If the user changes the value, i have planned to capture it in some internal table with the below fields..
1. row index
2. column index.
3. Change value
I will be modifing the internal table on click of field using Linktoaction via Popup window ...
On SAVE button, i have plan to manipulate the same ...
Can u just confirm that your logic will be feeded in my requirement ...
Regards,
KArthik S
Hi Karthik,
To store data temporarily, you can still save in attributes of component controller / view controller.
My point was, if you have any requirement to save your data into data base table, this particular logic should be written in model ( assistance class/function module ).
On your approach:
Yes, you can collect all changes done into an internal table and on_save action, you can manipulate the data and save into data base.
Regards,
Rama
Hi Rama,
I am using the below code in One View...how can i make this entries available of table (lt_change) to Component controller SAVE button...
data : lt_change type standard table of ZDB_TIMESHEET,
ls_change like line of lt_change .
"temp_table
ls_change-ROW_INDEX = lv_chang_index .
ls_change-col_index = 'DAY3'.
ls_change-value = lv_changed_value .
append ls_change to lt_change .
Regards,
Karthik S
Hi Karthik,
Hope your pop up window's input field is bound to an attribute in the context of component controller. On OK button action, read the attribute of popup window and set to the table.
Here, While calling pop up window, you might have to save the row id from which the pop up is triggered, so that you can read that row and set the value to SAT column.
Hope this helps you.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rama,
DATA lo_el_popup TYPE REF TO if_wd_context_element.
DATA ls_popup TYPE wd_this->Element_popup.
DATA lv_changed_value TYPE wd_this->Element_popup-changed_value.
* navigate from <CONTEXT> to <POPUP> via lead selection
lo_nd_popup = wd_context->get_child_node( name = wd_this->wdctx_popup ).
* get element via lead selection
lo_el_popup = lo_nd_popup->get_element( ).
* @TODO handle not set lead selection
IF lo_el_popup IS NOT INITIAL.
* get single attribute
lo_el_popup->get_attribute(
EXPORTING
name = `CHANGED_VALUE`
IMPORTING
value = lv_changed_value ).
ENDIF.
::In "lv_changed_value" , I am getting the new value from the choesn from Popup Window...
I tried setting it to specific field of SAT column,,but it was not setting it ..
Can u tell me how to set it to the Table Entries....
Regards,
KArthik S
Hi Karthik,
You can't set the value of the column directly.
Use the below method to get the values from the structure
* get all declared attributes
lo_el_selection->get_static_attributes(
IMPORTING
static_attributes = ls_selection ).
Now make the ls_selection-SAT = lv_changed_value .
Now set this using SET_STATIC_ATTRIBUTES method.
BR,
RAM.
Hi Ram,
I have tried the below code but its not setting to it ...
can u suggest me an idea on it .
* get single attribute
lo_el_popup->get_attribute(
EXPORTING
name = `CHANGED_VALUE`
IMPORTING
value = lv_changed_value ).
ENDIF.
DATA lo_nd_timesheet TYPE REF TO if_wd_context_node.
DATA : lt_timesheet TYPE wd_this->elements_timesheet,
ls_timesheet_1 like line of lt_timesheet .
data: ld_element type ref to if_wd_context_element.
* navigate from <CONTEXT> to <TIMESHEET> via lead selection
lo_nd_timesheet = wd_context->get_child_node( name = wd_this->wdctx_timesheet ).
* @TODO handle non existant child
* IF lo_nd_timesheet IS INITIAL.
* ENDIF.
ld_element = lo_nd_timesheet->get_lead_selection( ).
if not ld_element is INITIAL.
ld_element->get_static_attributes( IMPORTING
static_attributes = ls_timesheet_1 ).
endif.
ls_timesheet_1-day3 = lv_changed_value .
* set all declared attributes
ld_element->set_static_attributes(
EXPORTING
static_attributes = ls_timesheet_1 ).
Regards,
KArthik S
Hi Ram,
I tried the below code too ...can u suggest me on getting the Row index in standard table ..
DATA lo_nd_timesheet TYPE REF TO if_wd_context_node.
DATA lo_el_timesheet TYPE REF TO if_wd_context_element.
DATA ls_timesheet TYPE wd_this->element_timesheet.
* navigate from <CONTEXT> to <TIMESHEET> via lead selection
lo_nd_timesheet = wd_context->get_child_node( name = wd_this->wdctx_timesheet ).
* get element via lead selection
lo_el_timesheet = lo_nd_timesheet->get_element( ).
* alternative access via index
* lo_el_timesheet = lo_nd_timesheet->get_element( index = 1 ).
* @TODO handle not set lead selection
IF lo_el_timesheet IS not INITIAL.
* get all declared attributes
lo_el_timesheet->get_static_attributes(
IMPORTING
static_attributes = ls_timesheet ).
ls_timesheet-day3 = lv_changed_value .
* set all declared attributes
ld_element->set_static_attributes(
EXPORTING
static_attributes = ls_timesheet ).
ENDIF.
regards,
Karthik s
Hi Atil
Thanks for yr reply ..
I tried the below code ...
CALL METHOD lo_nd_timesheet->bind_element
EXPORTING
new_item = ls_timesheet
set_initial_elements = ABAP_TRUE
* index = lv_chang_index
RECEIVING
element = lo_el_timesheet
.
But the values did not set into the specific row of the table ....
Regards,
Karthik S
Hi,
Create an attribute in Component controller and after pressing Ok in popup set the value to that attribute and then in main view read that attribute and set it to the required field.
Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
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.