on 07-21-2008 8:17 AM
Hi Experts,
I need a clarification regarding table settings, presetly I'm displaying a table with records in edit mode avaiable in data base, but user wants to create new records in the table. Please suggest me how to make create new record in table control.
Thanks & Regards
Sridhar
Thank you Shruti Rathour , problem was solved.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can add an ADD button and enter the following code in its event handler method.
method onactionadditem .
data:
node_material type ref to if_wd_context_node,
elem_material type ref to if_wd_context_element,
stru_material type if_entry=>element_material .
/* navigate from <CONTEXT> to <MATERIAL> via lead selection */
node_material = wd_context->get_child_node( name = if_entry=>wdctx_material ).
/* get element via lead selection */
elem_material = node_material->get_element( ).
/* alternative access via index
Elem_Material = Node_Material->get_Element( Index = 1 ).
@TODO handle non existant child */
if ( elem_material is initial ).
call method node_material->create_element
receiving
element = elem_material
.
endif.
/* get all declared attributes */
elem_material->get_static_attributes(
importing
static_attributes = stru_material ).
call method node_material->bind_structure
exporting
new_item = stru_material
set_initial_elements = abap_false
.
endmethod.
Hope this will help.
Thanks
Shruti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
put an add button and save button in the layout
in event handler of the add button , place the code
data: lr_node type ref to if_wd_context_node.
data: str_node type <context node type>.
data: lr_element type ref to if_wd_context_element.
lr_node = wd_context->get_child_node( '<node name>' ).
lr_element =
lr_node->bind_element( new_item = str_node set_initial_elements = abap_false ).
Abhi
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.