on 08-11-2009 6:00 AM
dear all,
ive a requirement when we select a row from table view and press delete button it should get deleted from database
.please give me step by step procedure how to do this.ihve tried debugging using the examples from post but did not understand . i am new to bsp.please help.
Hi Sushani.
Please refer the sample code below this will delete the enteries from internal table...please replace them with ur Database table.
and importatn thing in the
Proprties tab please keep the staut as STATEFULL FROM NOW ON Enabled.
On initialization Event
IF fl_delete IS INITIAL.
SELECT carrid
connid
FROM spfli
INTO TABLE t_spfli
WHERE carrid = 'AA'.
ENDIF.
On Input Processing Event.
DATA:
w_event TYPE REF TO cl_htmlb_event.
CALL METHOD cl_htmlb_manager=>get_event
EXPORTING
request = runtime->server->request
RECEIVING
event = w_event.
IF w_event IS NOT INITIAL.
IF w_event->id = 'del'.
DATA: table TYPE REF TO cl_htmlb_tableview.
DATA: selectedrowindex TYPE string.
table ?= cl_htmlb_manager=>get_data( request = request
name = 'tableView'
id = 'tab' ).
IF table IS NOT INITIAL.
DATA: table_event TYPE REF TO cl_htmlb_event_tableview.
CLEAR selectedrowindex.
table_event = table->data.
selectedrowindex = table_event->selectedrowindex.
DELETE t_spfli index selectedrowindex.
fl_delete = 1.
ENDIF.
ENDIF.
ENDIF.
Layout Code.
<htmlb:tableView id = "tab"
width = "100%"
selectionMode = "SINGLESELECT"
table = "<%= t_spfli %>" >
<htmlb:tableViewColumn columnName="CARRID" >
</htmlb:tableViewColumn>
<htmlb:tableViewColumn columnName="CONNID" >
</htmlb:tableViewColumn>
</htmlb:tableView>
<htmlb:button id = "del"
text = "delete"
Click = "OnInputProcessing()"
/>
Hope this is helpful to you, let me know if you still have any problem.
Thanks
Kalyan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
11 | |
10 | |
8 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.