on 10-20-2009 5:46 PM
Hello Everyone,
Could anyone give me the code to get the value of a field depending on the Leadselect in a table please. I would greatly appreciate your help.
I hope you can understand my question. Please let me know if you need more clarification.
Regards,
Gopal.
You can use the code wizard to generate this for you. Here is the code that is generally generated by the wizard.
To read a single attribute from the leadSelection Element:
DATA lo_nd_sales_orders_sel TYPE REF TO if_wd_context_node.
DATA lo_el_sales_orders_sel TYPE REF TO if_wd_context_element.
DATA ls_sales_orders_sel TYPE wd_this->element_sales_orders_sel.
DATA lv_so_id TYPE wd_this->element_sales_orders_sel-so_id.
* navigate from <CONTEXT> to <SALES_ORDERS_SEL> via lead selection
lo_nd_sales_orders_sel = wd_context->get_child_node( name = wd_this->wdctx_sales_orders_sel ).
* get element via lead selection
lo_el_sales_orders_sel = lo_nd_sales_orders_sel->get_element( ).
* get single attribute
lo_el_sales_orders_sel->get_attribute(
EXPORTING
name = `SO_ID`
IMPORTING
value = lv_so_id ).
To Read the Entire structure of a leadSelection Element:
DATA lo_nd_sales_orders_sel TYPE REF TO if_wd_context_node.
DATA lo_el_sales_orders_sel TYPE REF TO if_wd_context_element.
DATA ls_sales_orders_sel TYPE wd_this->element_sales_orders_sel.
* navigate from <CONTEXT> to <SALES_ORDERS_SEL> via lead selection
lo_nd_sales_orders_sel = wd_context->get_child_node( name = wd_this->wdctx_sales_orders_sel ).
* get element via lead selection
lo_el_sales_orders_sel = lo_nd_sales_orders_sel->get_element( ).
* get all declared attributes
lo_el_sales_orders_sel->get_static_attributes(
IMPORTING
static_attributes = ls_sales_orders_sel ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Gopal ,
u must have created a context node in the context tab of ur view and different context attributes under it.
1 Go to code wizard or Press CONTROL + F7
2 Select the radio butto read context node/attribute
3 to read a single context attribute under ur context node , choose the attribute and press enter
4 to read the entire context node / structure , seect the context node and press enter
thus u wud get the value from LeadSelect in ur table row .
in ur case , u need to select the context node and press enter
** reading context node cn_table
DATA : lo_nd_cn_table TYPE REF TO if_wd_context_node ,
lo_el_cn_table TYPE REF TO if_wd_context_element ,
ls_cn_table TYPE wd_this->element_cn_table.
*
** navigate from <CONTEXT> to <CN_TABLE> via lead selection
lo_nd_cn_table = wd_context->get_child_node(
name = wd_this->wdctx_cn_table ).
*** get element via lead selection
lo_el_cn_table = lo_nd_cn_table->get_lead_selection( ).
lo_el_cn_table->get_static_attributes( IMPORTING
static_attributes = wa_table ).
for my specific example , I am reading the context node cn_node , and the values are stored in the corresponding work area
wa_table. I have declared wa_table like this :
DATA : wa_table type str_table .
// str_table is a structure which contains variable as like context attributes under my node cn_node
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 |
---|---|
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.