You are on page 1of 2

Prepared by Vijayendar Reddy( OASIS Technologies ) hyderabad

--------------------------------------------------------------Fetching data from database to WEbDynpro Component:


data ttab type table of ttab.
select * from zemp into table ttab.
lo_nd_itab->bind_table( ttab ).
-------------------------------------------------------------Delete the selected record:
To capture hte selected record from webdynpro Table:
code wizard
get_static_attributes( importing static_attributes = ls_itab ).
workarea
if ls_itab-id is not initial.
delete from zemp where id = ls_itab-id.

----->database

lo_nd_itab->remove_element( lo_el_itab ).

------>node level/webdynpro

endif.
-----------------------------------------------------------To update the record:
To capture hte modified record from webdynpro form/ITAB:
get_static_attributes( importing static_attributes = ls_itab ).
workarea
Update zemp set name = ls_itab-name
salpm = ls_itab-salpm
permarks = ls_itab-permarks
where id = ls_itab-id.
-------------------------------------------------------------To save multiple records or to update multiple records
We need to capture the Modified records from node itab
data ttab type table of zemp.
get_static_attributes_table( importing table = ttab ).
modify zemp from table ttab.
------------------------------------------------------------------TO insert the record into database:
Capture the input record from node input

get_static_attributes( importing static_attributes = ls_input ).


workarea
if ls_inputid is not initial.
insert into zemp values ls_input.
endif.
wd_comp_contoller->executmed( ).
----------------------------------------------------------------------clear the values from FORM in webdynpro;
clear ls_input.
set_static_attributes( exporting static_attributes = ls_input ).
--------------------------------------------------------------------To intialize the default values in a FORM: ( WDDOINIT( ) )
WDDOINIT( ) is a standard method to initialize the values :
ls_input-id = '1001'.
ls_nput-name = 'VijayendarReddy'.
ls_input-salpm = 200000.
ls_input-permarks = 56.
set_static_attributes( exporting static_attributes = ls_input ).
-------------------------------------------------------------------

You might also like