cancel
Showing results for 
Search instead for 
Did you mean: 

LINK TO ACTION

ananth_anni
Participant
0 Kudos

hi,

im created one table ,for the table im assigned link to action to one key field . Than im created table and inputfield in another view .Than im getting link to action .BUT WHEN IM CLICKED LINK TO ACTION ELEMENT I HAVE TO GET THE MATERIAL NUM( 4969) IN THE INPUT FIELD.

thanking you,

Accepted Solutions (0)

Answers (4)

Answers (4)

ananth_anni
Participant
0 Kudos

ans

Former Member
0 Kudos

Hi,

go thru this thread

in this you will get your query resolved.

in this thread you will get step wise detail on link to action

Former Member
0 Kudos

Hello Ananth,

You could achieve the same even if you maintain two views for table and input field.

you just have to define a variable in the component controller.

So when someone clicks the link to action, the value gets stored and before navigating to the next view you could read the same value for the another view.

Regards

Anurag

Former Member
0 Kudos

both these tables are in differnet views...

If they are on different views, how do you want to transfer the data..

i mean if the suer clicks on first row of the 1st table then same should be shown in the same record of the other table in other view...

doe these tables have similar strcuture...

Edited by: Lekha on Dec 7, 2009 4:07 PM

ananth_anni
Participant
0 Kudos

hi lekha,

ok im inserted two tables and a input field .For first table we assigned link to action to second table. WHEN I CLICK ON FIRST ELEMENT im getting a describtion for second table .but i need when im clicking first element link the element number (4969) should be display in inputfield.

data : node_input type REF TO if_wd_context_node,

node_output type REF TO if_wd_context_node,

lr_element TYPE REF TO if_wd_context_element,

it_vbeln type vbak-vbeln,

itab type STANDARD TABLE OF vbak.

node_input = wd_context->get_child_node( name = 'VBAK1').

lr_element = wdevent->get_context_element( 'CONTEXT_ELEMENT' ).

node_input->get_attribute( EXPORTING name = 'VBELN'

IMPORTING value = it_vbeln ).

lr_element->get_attribute( EXPORTING name = 'VBELN'

IMPORTING value = it_vbeln ).

*

node_output = wd_context->get_child_node( name = 'VBAK2' ).

select * from vbak into table itab where vbeln = it_vbeln.

node_output->bind_table( itab ).

here the code shown .for this im getting the link to action but i want when im click the element i need to get the num of the element in inputfield.PLEASE ADD SOME CODE TO THAT.

Former Member
0 Kudos

HI,

Let me know to which context attrute teh input field is bound to..

In teh Linktoaction handler, just set the above attribute value to the clicked element by reading the get_static_attributes method of if_wd_context_element..

Is this clear..

Former Member
0 Kudos

hi

proceed as follow :

1 read the context node which is binded to the table using get_static_attributes

this can be done by code wizard ( CONTROL + F7 ) and selecting the radio button read context node/attribute and selecting the appropriate node


* 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 ).
// I have read the node CN_NODE using get_static attributes method
// code is automatically generated

2 suppose the column element number  is binded to a context attribute *ca_number* under this node
thn u can get the value in another variable as 

DATA : lv_num type string.

lv_num = wa_table-ca_number .


3 thn u have to set the context attribute ( ca_attr)  which is binded to ur  input field , thn 
u wud set ca_attr to lv_num using *set_attribute* method 

DATA lo_nd_cn_all TYPE REF TO if_wd_context_node.

DATA lo_el_cn_all TYPE REF TO if_wd_context_element.

DATA ls_cn_all TYPE wd_this->element_cn_all.

DATA lv_ca_attr LIKE ls_cn_all-ca_attr.

  • navigate from <CONTEXT> to <CN_ALL> via lead selection

lo_nd_cn_all = wd_context->get_child_node(

name = wd_this->wdctx_cn_all ).

  • get element via lead selection

lo_el_cn_all = lo_nd_cn_all->get_element( ).

  • set single attribute

lo_el_cn_all->set_attribute(

EXPORTING

name = `CA_ATTR`

value = lv_num ).

// CA_ATTR is under context node CN_ALL n binded to input field

regards,

amit

Former Member
0 Kudos

where


  work area of type structure
  DATA :wa_table        TYPE str_table .
//and str_table is a strucutre tht is declared with same variables as there are context attributes under node CN_TABLE

  TYPES :BEGIN OF str_table ,
           checkbox          TYPE wdy_boolean ,
           image             TYPE xstring ,
           userid            TYPE string,
           role              TYPE z2ts_roledesc,
         
         END OF str_table .

regards,

amit