on 06-20-2008 5:34 AM
i want to know how to get the data from database table to abap web dynpro application and how to insert the record from abap web dynpro to database table.
Hi,
To getdata from the DBASE:
You have to write select queries and bind ur internal tables with the UI elements like tables and ALVs in WD ABAP>
To modify database:
You just have to write queries for modification on happening of an event and insert data. Say click of a button.
I suggest u to use Assistance class to interact with Data base.
See [link|http://help.sap.com/saphelp_nw70/helpdata/EN/43/1f6442a3d9e72ce10000000a1550b0/frameset.htm]
For assistance class.
I hope it helps.
Regards,
Sumit Oberoi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
To get data from data base table to webdynpro abap application:
1.If you want to get data on initialisation on view then write in WDDOINIT() or if u want to display data based on some entered value then write in Onaction methods.
--If in wddoinit()
declare a internal table of your database table type.
write the select statement to get data into internal table.
Get the reference of node in context to which your table UI element is binded using code wizard--get node/attribute.
Bind the node to internal tablle using
nodename->bind_table( internal table name ).
If it is on based on submission of some data then.
Get the attribute reference using code wizard.
write select statement with where clause with attribute u got from context.
2)to insert data into database table:
-Get the node or attributes reference to ehich your UI elements which has to be inserted are binded.
-declare a workarea of type your database table.
-add attributes to work area.
For example
wa-matnr = item_matnr.
wa-ersda = item_ersda,
where item_matnr is attribute we got from context.
write insert statement as
insert into tablename values wa.
reward points if usefull,
regards,
Anusha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raj,
For getting the data from DB tables to webdynpro view tables create the the node corresponding to that table and bind that node to the table.
In wddoinit method write the code as:
data: main_node type ref to IF_WD_CONTEXT_NODE,
itab type standard table of SFLIGHT.
select * from SFLIGHT into table itab.
main_node = wd_Context->get_Child_Node( Name = 'FLIGHT_NODE' ).
bind the internal table to context node.
main_node->Bind_Table( itab ).
and insert the data into table as:
First get the data into work area and insert into table through work area as..
insert into Ztable(name of table not standard tables) values wa...............
Reward points if useful...........
Edited by: srilalitha yerramsetti on Jun 20, 2008 1:27 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.