cancel
Showing results for 
Search instead for 
Did you mean: 

table control existing in WD ?

Former Member
0 Kudos

Hello,

I am intending to populate and display the records using a table control.

Is table control existing in WD ?

Thx in advance

Sw+++

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi

I have right clicked on the table ui element which is under roouielementcontainer and selected create binding.

The selected Cell editor of table coloumn is Input Field.

Binding check box is set Name of Property is value.

I cant still edit any datesince the cells are not editable

@Mago where should your code must be inserted ?

Regards,

sw++

Edited by: spielwiese on Apr 24, 2009 3:13 PM

Former Member
0 Kudos

did it worked for you or not ?

By writing above mentioned code in Wddoinit() , it should work.

Former Member
0 Kudos

Hi,

I have inersted your code as follows. But I get the error message

element_cn_try is unknown. My context node has the name ZHEAD .

DATA lo_nd_cn_try TYPE REF TO if_wd_context_node.
DATA lo_el_cn_try TYPE REF TO if_wd_context_element.
DATA ls_cn_try TYPE wd_this->element_cn_try. <cn_try is my node name here >

DATA ls_cn_try1 TYPE wd_this->elements_cn_try.


navigate from <CONTEXT> to <CN_TRY> via lead selection 
lo_nd_cn_try = wd_context->get_child_node( name = wd_this->wdctx_cn_try ).

do 5 times.

clear ls_cn_try.
append ls_cn_try to ls_cn_try1.
lo_nd_cn_try->bind_table( ls_cn_try1 ).
enddo.

Former Member
0 Kudos

hi,

Replace cn_try with zhead in the below lines :

DATA ls_cn_try TYPE wd_this->element_cn_try.

DATA ls_cn_try1 TYPE wd_this->elements_cn_try.

lo_nd_cn_try = wd_context->get_child_node( name = wd_this->wdctx_cn_try ).

Use :

DATA ls_cn_try TYPE wd_this->element_zhead.

DATA ls_cn_try1 TYPE wd_this->elements_zhead.

lo_nd_cn_try = wd_context->get_child_node( name = wd_this->wdctx_zhead).

It will work.

Former Member
0 Kudos

Mago two more errors:

1)at

DATA ls_cn_try TYPE wd_this->element_zhead.

DATA ls_cn_try1 TYPE wd_this->elements_zhead.

element_zhead or elements_zhead ???

2)

append ls_cn_try to ls_cn_try1

I get the message ls_cn_try1 is not an internal table

Former Member
0 Kudos

ls_cn_try is work area and ls_cn_try1 is an internal table.

Check if it works for you. I have applied this only and this is working fine for me.

Edited by: Saurav Mago on Apr 24, 2009 7:22 PM

Former Member
0 Kudos

If that is not working , you can try with this :

DATA: ls_cn_try1 TYPE if_main=>elements_cn_try,

ls_cn_try TYPE if_main=>element_cn_try.

cn_try is my node name.

Answers (7)

Answers (7)

Former Member
0 Kudos

hi,

this coding has worked .

DATA: lt_sflight TYPE if_main=>elements_zhead,
              wa_sflight TYPE if_main=>element_zhead,
              lv TYPE REF TO if_wd_context_node.

  DO 14 TIMES.
    APPEND wa_sflight TO lt_sflight.
  ENDDO.
  lv = wd_context->get_child_node( name = 'ZHEAD' ).
  lv->bind_table( new_items = lt_sflight ).

Thx

sw+++

Edited by: spielwiese on Apr 24, 2009 4:14 PM

Former Member
0 Kudos

Hi Mago I have created a Table UI Element and binded it to the Context Node

but the problem is the table is not editable I cant insert data in it

Former Member
0 Kudos

Create the cell editor as input field.

Regards,

Radhika.

arjun_thakur
Active Contributor
0 Kudos

Hi,

Please refer this thread: .

Make sure that the UI element that you use in the table column should be input field, it should not be text view.

Regards

Arjun

Edited by: Arjun Thakur on Apr 24, 2009 6:23 PM

Former Member
0 Kudos

Hi,

Right click on the table ui element which is under roouielementcontainer and select create binding.

there you will see that You have selected Cell editor of table coloumn as TextView. Select it as Input Field which ever you want it editable.

Regards,

Manish

Former Member
0 Kudos

write this code to make table Editable :

DATA lo_nd_cn_try TYPE REF TO if_wd_context_node.

DATA lo_el_cn_try TYPE REF TO if_wd_context_element.

DATA ls_cn_try TYPE wd_this->element_cn_try. <cn_try is my node name here >

DATA ls_cn_try1 TYPE wd_this->elements_cn_try.

navigate from <CONTEXT> to <CN_TRY> via lead selection

lo_nd_cn_try = wd_context->get_child_node( name = wd_this->wdctx_cn_try ).

do 5 times.

clear ls_cn_try.

append ls_cn_try to ls_cn_try1.

lo_nd_cn_try->bind_table( ls_cn_try1 ).

enddo.

Do take Input Field inside the Table Column not textView.

Thanx.

Edited by: Saurav Mago on Apr 24, 2009 6:34 PM

Former Member
0 Kudos

Hi Mago

I have one question before I a m closing this thread.

In order to insert data I can set the properties at cell editor.

Which settings are there needed to insert data into the cells

Former Member
0 Kudos

hi,

Your Q is not that much clear.

You want to insert data into your Table UI Element ?

If that is the case , you dont have to do any settings. Just write the code :

1. Fetch desired data into an internal table.

2. bind the internal table to the context Node. ( Context Node is binded to Table UI element).

You can write the below mentioned code in WDDoinit() :

Data : it_table type STANDARD TABLE OF sflight.

DATA lo_nd_for_table TYPE REF TO if_wd_context_node.

DATA lo_el_for_table TYPE REF TO if_wd_context_element.

DATA ls_for_table TYPE wd_this->element_for_table. < For_table is my Context Node which is binded to Table UI >

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

lo_nd_for_table = wd_context->get_child_node( name = wd_this->wdctx_for_table ).

<here I am fetching carrid connid fldate from Standard table Sflight and putting it in Internal Table>

select carrid connid fldate from sflight into CORRESPONDING FIELDS OF TABLE it_table.

<Finally , I am binding whatever data is there in internal table to the Node>

lo_nd_for_table->bind_table( it_table ).

I hope it is clear.

Thanx.

Edited by: Saurav Mago on Apr 24, 2009 5:37 PM

Former Member
0 Kudos

I hope you have created a Table UI Element and binded it to the Context Node having desired attributes.

In case not, Right click on Table UI Element and Create Binding.

Now your table is binded to Context node and now you can write above mentioned code to WdDoinit().

Former Member
0 Kudos

hi mago i am trying to fill a DDIC table through table UI in WD

do you have an example to do that

arjun_thakur
Active Contributor
0 Kudos

Hi,

To fill the DDIC table from UI table, just get the data (present in the table UI) in an internal table and after that use ABAP insert/append/modify statement to fill the data in the database table.

To get the data in the internal table, simply read the node (that is binded to the table UI) with the help of code wizard (ctrl+ F7).

Regards

Arjun

Former Member
0 Kudos

Hi,

Once you have data in your table UI in WD, you can use the following code to update your DDIC table.

Data: l_node type ref to if_wd_context_node.

l_node = wd_context->get_child_node( 'Node Name' ). " Node bound to your table control

* get the contents of the table
l_node->get_static_attributes_table( table = lt_table ) .

Now lt_table will have the contents of your WD table control, use this to fill/update your DDIC table using modify/insert statements.

Hope this helps.

former_member40425
Contributor
0 Kudos

Hi,

Create Structure of type context node and then create internal table and work area of type context node

and after that create internal table and work area of type DDIC.

Then Put a loop on itab of type DDIC and keep transfering values from work area of Context node type to work area of DDIC typpe.

and keep appending values of work area to itab ot type DDIC.

then finally bind the itab of type DDIC with table using following code.



*    Binding the internal table to node
    lo_nd_cn_current->bind_table( itab_currentdetails ).

I hope it helps.

Regards,

Rohit

Former Member
0 Kudos

hi,

-> I hope you have the data in your Table UI Element.

-> If not , you can insert data inside the table by using Supply Funciton for the Nodes or by having the logic in Wd do init.

-> After that , you have to put this data in DDIC table.

->Create a button and on Action of button.

->In On Action Just read the Table data inside your Node by using Code Wizard(control + F7).

-> Finally Put the data inside your DDIC Table using Simple ABAP statement. (append/insert)

Once you have data in Table UI element , use below mentioned code :

DATA lo_nd_n2 TYPE REF TO if_wd_context_node.

DATA lo_el_n2 TYPE REF TO if_wd_context_element.

DATA ls_n2 TYPE wd_this->element_n2.

DATA IT_N2 TYPE STANDARD TABLE OF /BI0/PCS_UNIT.

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

lo_nd_n2 = wd_context->get_child_node( name = wd_this->wdctx_n2 ).

  • get element via lead selection

lo_el_n2 = lo_nd_n2->get_element( ).

  • get all declared attributes

lo_el_n2->get_static_attributes(

IMPORTING

static_attributes = ls_n2 ).

CALL METHOD LO_ND_N2->GET_STATIC_ATTRIBUTES_TABLE

IMPORTING

TABLE = IT_N2.

MODIFY /BI0/PCS_UNIT from table IT_N2.

Thanx.

Edited by: Saurav Mago on Apr 24, 2009 4:52 PM

Former Member
0 Kudos

hi,

You are talking in ABAP terms about Table control.

In WD ABAP , there is Table only in which we are able to see the content. So you can work with Table UI element to see or populate data.

Thanx.

Former Member
0 Kudos

hi,

sorry i am speaking about table control element as like sap dynpro and not of a table

Former Member
0 Kudos

yes

the table control exist in wd also.

Best regards,

Rohit

Former Member
0 Kudos

how can I create one ?

Former Member
0 Kudos

Hi ,

Yes, a table control uielement is available.

Check this link

[http://help.sap.com/saphelp_nw70/helpdata/en/b5/ac884118aa1709e10000000a155106/content.htm]

Also refer component WDR_TEST_TABLE.

You can also create ALV.

[]

Regards,

Radhika.

Former Member
0 Kudos

hi,

Refer this to populate table control:

Thanx.