cancel
Showing results for 
Search instead for 
Did you mean: 

Select Table row.

Former Member
0 Kudos

Hi.

I need some help!

I'm implementing a web dynpro application with a simple table.

That table has a row popin to show some more complete information about the table row.

I have also a button on that popin and I want to, when that button is pressed, show that row information on a popup window.

How can I get the information of that row?

Regards

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

And one more problem...!

When I do the select it may return 0 values.

When it does I get the error "Node COMPONENTCONTROLLER.1.XPTO does not contain any elements".

How can I resolve this?

Regards

former_member184578
Active Contributor
0 Kudos

Hi.,

Read the Node.,

If node is initial.

display message no elements.,

else.

read the values using get_static_attributes method.,

and then bind.

endif.,

hope this helps u.,

Thanks & Regards,

Kiran

Answers (7)

Answers (7)

Former Member
0 Kudos

Hi.

I tiyed the 1st code sample and I'm getting a " Invalid operand type for the MOVE-CORRESPONDING statement" error.

Please explain the wd_context->path_get_node.

Regards

Edited by: Khaytaah on Jun 7, 2011 1:22 PM

Former Member
0 Kudos

Hi,

You can't use MOVE-CORRESPONDING stement, instead you can try with MOVE or APPEND.

Cheers,

Kris.

Former Member
0 Kudos

hi kissnas,

sorry but i have tried it 2-3 times but its always giving me first record only, or may be I think I have not written this code in the right place.

i have a table and a 'get data' button and Im writing this code in the method written for getting the data. do i need to write this in the table event 'onLeadSelect ' ? kindly suggest me the same or i need to write GET_LEAD_SELECTION method?

thanks.

Former Member
0 Kudos

Hi,

Try this, it will give no of selected records.

DATA lo_nd_et_postab_1 TYPE REF TO if_wd_context_node.
  DATA lo_el_et_postab_1 TYPE REF TO if_wd_context_element.
  DATA ls_et_postab_1    TYPE wd_this->Element_et_postab_1.
  DATA lt_et_postab_1    TYPE wd_this->Elements_et_postab_1. 
  DATA: wa_temp TYPE REF TO if_wd_context_element,
        lt_temp TYPE wdr_context_element_set.
* navigate from <CONTEXT> to <ET_POSTAB_1> via lead selection
  lo_nd_et_postab_1 = wd_context->path_get_node( path = `ZSHP_EXTENDED_DUE_LI.CHANGING_3.ET_POSTAB_1` ).

  CALL METHOD lo_nd_et_postab_1->get_selected_elements
    RECEIVING
      set = lt_temp.

  LOOP AT lt_temp INTO wa_temp.
    CALL METHOD wa_temp->get_static_attributes
      IMPORTING
        static_attributes = ls_et_postab_1.
    * append ls_et_postab_1 to lt_et_postab_1.  // if you watn use this statement
    CLEAR ls_et_postab_1.
  ENDLOOP.

Cheers,

Kris.

Former Member
0 Kudos

Hi kissnas,

Thanks a lot, now its working very fine this is what I wanted.

thanks...

I have one open thread with the same question and i think now you have added the same link in it, so i'll give ur points for you in that thread only..

thanks a lot.

Former Member
0 Kudos

hi all,

i was also facing the same issue except the popup window. i dont wanted that but thanks to 'kissnas' for your reply your solution is working file but the issue with that is it is always showing the first record of the table not the one we selected. so what can be done for this.

thanks all

Former Member
0 Kudos

Hi,

No, the above code will returns the selected record not always first record, try that.

GET_STATIC_ATTIRUBUTES will return selected record.

Cheers,

Kris.

Former Member
0 Kudos

Ok, let me explain a little better!

I have a context node filled with attributes from a table.

In the layout I have a table with some of the attributes from the context node and a row popin were I show the complete attributes from the context node (all the table fields).

When I push the popin button I want to display all the information of that table row in a popup.

Regards

former_member184578
Active Contributor
0 Kudos

Hi.,

If I understood clearly ., for your requirement no need of table popin.,as you want to display details in pop up.,

In OnLeadSelection of Table create an action and read the selected row using get_static_attributes method and call a pop up using window manger and display details in popup.,

check this article for reference how to do.., [Popup ALV onLeadSelect of another ALV|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/7020c76f-c40e-2e10-a795-d88e67740ee4?quicklink=index&overridelayout=true]

Do like this for Table UI too.,

hope this helps u.,

Thanks & Regards,

Kiran

former_member199125
Active Contributor
0 Kudos

where did you place the popin button?

Best Regards

Srinivas

former_member199125
Active Contributor
0 Kudos

Hi Khaytaah ,

Let me rephrase your quiery...

you have a row table popin, in that pop in if you click on button ... again it should display same row information the POPUP window..?

If I understand you correctly...

then in that button action call popup window using context wizard ( create separate window and view for popup). In that view create a form using the same node which you want to display

Best Regards

Srinivas

Former Member
0 Kudos

Hi,

How can you show data in popup, in table? or in different text veiws??

in POPUP veiw WDDOINIT method write like this code.

DATA lo_nd_it_vttk TYPE REF TO if_wd_context_node.
  DATA lo_el_it_vttk TYPE REF TO if_wd_context_element.
  DATA ls_it_vttk    TYPE wd_this->Element_it_vttk.
  DATA lt_it_vttk    TYPE wd_this->Elements_it_vttk.
  DATA wa_vttk       TYPE vttk.

* navigate from <CONTEXT> to <IT_VTTK> via lead selection
  lo_nd_it_vttk = wd_context->path_get_node( path = `ZSHIPMENT_CHANGE.CHANGING.IT_VTTK` ).

* get element via lead selection
  lo_el_it_vttk = lo_nd_it_vttk->get_element( ).

* get all declared attributes
  lo_el_it_vttk->get_static_attributes(
    IMPORTING
      static_attributes = ls_it_vttk ).   // This contains selected record.

Based on your requirement show data in table or in textveiw.

Cheers,

Kris.

former_member184578
Active Contributor
0 Kudos

Hi.,

Use get_static_attributes( ) method., jus read the node of table using code wizard.,

you will get ls_attributes., form get_static_attributes method., which contains the selected row .

then call a popup window using window manager.,

hope this helps u.,

Thanks & Regards,

Kiran