on 01-18-2010 5:27 AM
Hi Experts,
I am new to ABAP and and have never worked on BSP also I have a webdynpro application which needs a 'edit' button to be added, I need the code to execute the same. I got the sample code for cancel button, what more information needs to be added here...
method ONACTIONEDITTREE .
DATA lr_node_info TYPE REF TO if_wd_context_node_info.
DATA lt_value_set TYPE wdy_key_value_table.
DATA lo_el_context TYPE REF TO if_wd_context_element.
clear lt_value_set.
*----- Retrieve node
lr_node_info = wd_context->get_node_info( ).
*----- Set attribute info
lr_node_info->set_attribute_value_set( name = 'TYPE'
value_set = lt_value_set ).
get element via lead selection
lo_el_context = wd_context->get_element( ).
set single attribute
lo_el_context->set_attribute(
name = `ISBUTENABLE`
value = abap_false ).
set single attribute
lo_el_context->set_attribute(
name = `ISTYPE`
value = abap_true ).
set single attribute
lo_el_context->set_attribute(
name = `ISNEW`
value = abap_true ).
set single attribute
lo_el_context->set_attribute(
name = `CANDELETE_TOPIC`
value = abap_true ).
set single attribute
lo_el_context->set_attribute(
name = `CANDO_TOPIC`
value = abap_true ).
set single attribute
lo_el_context->set_attribute(
name = `CANDO_HEADING`
value = abap_true ).
set single attribute
lo_el_context->set_attribute(
name = `INPUT`
value = ' ' ).
set single attribute
lo_el_context->set_attribute(
name = `TYPE`
value = ' ' ).
endmethod.
hi ,
I have created a context node cn_node and a context attribute ca_attribute under it ,
if u want ur Button to be visible / invisible , create this attribute of type WDUI_VISIBILITY
if u want ur Button to be enable /disable , create this attribute of type WDY_BOOLEAN
and like wise ..
now bind the value property with this context attribute .
using get_attribute method , we can get the value which user has entered
using set_attribute method , we can set the value which we want to give for our field
DATA lo_nd_cn_node TYPE REF TO if_wd_context_node.
DATA lo_el_cn_node TYPE REF TO if_wd_context_element.
DATA ls_cn_node TYPE wd_this->element_cn_node .
DATA lv_attr LIKE ls_city-ca_attr.
* navigate from <CONTEXT> to <CN_NODEE> via lead selection
lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_ca_attr).
* get element via lead selection
lo_el_cn_node = lo_nd_cn_node->get_element( ).
* get single attribute
lo_el_cn_node->get_attribute(
EXPORTING
name = `CA_ATTR`
IMPORTING
value = lv_attr ).
* Set single attribute
lo_el_cn_node-Set_attribute(
EXPORTING
name = `CA_ATTR`
value = lv_attr ).
the code is automatically generated when u press control +f7 and choose read/set context node/attribute and choose the attribute
regards,
amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
Go to context tab , right click on context and choose create node and give it a Name
Create a context attribute under it , choose its type as string
Go to layout tab , right click on the root element container and choose insert element
Choose Button UI .. now it is placed
In the TEXT property , write EDIT and there is a property OnAction , right click on that
Create a Event , now in OnActionEvent method , u have to write the coding
Bind Value property with this context attrtibute
Press control +f7 ( code wizard) and choose read context node/attribute .the code will be auto generate
And u can play with get_attribute and set_attribute method
regards,
amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
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.