on 05-08-2012 5:51 AM
hii, i want to add a row at top of table in which already data is diaplayed....
the scenario is ..
first I displayed some records in table ..
then when i pressed a button like filter , a row is added as first record which is empty where i can add some data...
(this is not in alv i want it in normal table)
Thanks in advance ..
LOKESH
hi chengalarayulu urs is right by keeping index value we it allows to add a row ..
but for adding i need to do some action ,in the action method what can we write ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lokesh,
DATA lo_nd_table TYPE REF TO if_wd_context_node.
DATA lo_el_table TYPE REF TO if_wd_context_element.
DATA stru TYPE wd_this->element_NODE_NAME.
lo_nd_table = wd_context->get_child_node( name = 'NODE_NAME' ).
CALL METHOD lo_nd_table->bind_structure
EXPORTING
new_item = stru
set_initial_elements = abap_false
index = 1.
Just write this code and run. Change the NODE_NAME with the name of the node you bound for the table.
Regards,
Fareez
hi thanks for ur reply...
but for adding a row im creating a button as filter ..
when i click on it a new row will be added ...then in the action method of button what can i write im not getting pls help me..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lokesh,
you can do like below.
DATA lo_nd_table TYPE REF TO if_wd_context_node.
DATA lo_el_table TYPE REF TO if_wd_context_element.
DATA ls_table TYPE wd_this->element_table.
* navigate from <CONTEXT> to <TABLE> via lead selection
lo_nd_table = wd_context->get_child_node( name = wd_this->wdctx_table ).
CALL METHOD lo_nd_table->bind_structure
EXPORTING
new_item = ls_table
set_initial_elements = abap_false
* index =
.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi fareez and chengalarayulu... thanks for ur valuable reply..
im not getting how to add a row for a table having data ie... my output is a table initially displayed a data ..
when i clicked on a button(filter) an empty row will append ..
then i can type a field record name (fert ) below it will show all records related to that name..
this is my actual requirement..
fareez : what is the insert command to insert arow ..at starting ?
Hi lokesh,
As chengalarayulu says, bind_structure or bind_element will insert a new row to an existing table without affecting the data already present in the table.
If you use any of these methods then no need to use the insert command to insert on an itab and then doing bind_table. Just do as chengalarayulu said and don't forget to give the index as 1 to make the row appear on the top.
Regards,
Fareez
Hi Lokeshwar,
As you say you want to enter data, use TextEdit element to show the data. Now on the action of the button do as follows,
1. get the data on the table using get_static_attributes_table from the context node.
2. now add an empty row at the top using insert command
3. Now bind the table to the context node
This will make a new row appear on the table and you can enter data.
Regards,
Fareez
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
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.