cancel
Showing results for 
Search instead for 
Did you mean: 

rertrieving the table

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (2)

Answers (2)

Former Member
0 Kudos

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

Former Member
0 Kudos

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