on 10-23-2007 8:53 AM
hi guys,
i'm using controller+view to create BSP application. after read some article here fail to the solution on how to update record to SAP.
attach controller & view source code for reference. please kindly provide idea/solution. thanks.
controller
-
method DO_REQUEST.
*CALL METHOD SUPER->DO_REQUEST
.
DATA: result_view TYPE REF TO if_bsp_page.
select * from zpoinfo into table po_items.
dispatch_input( ).
result_view = create_view( view_name = 'poinfo.htm' ).
if po_items[] is not initial.
result_view->set_attribute(
name = 'po_items'
value = me->po_items ).
endif.
call_view( result_view ).
endmethod.
method DO_HANDLE_DATA.
data wa type IHTTPNVP.
data po type ZPOINFO-PONUMBER.
data po_items type table of ZPOINFO.
data w_mandt type sy-mandt.
data updtab type standard table of zpoinfo.
read table form_fields into wa with key name = 'ponumber'.
po = wa-value.
if not po is initial.
select single mandt into w_mandt from zpoinfo
where ponumber = po.
if sy-subrc EQ 0.
select * from zpoinfo
into table po_items
where ponumber = po.
endif.
else.
select * from zpoinfo
into table po_items.
endif.
if sy-subrc = 0.
me->po_items = po_items.
endif.
endmethod.
view
-
<htmlb:tableView id = "result"
design = "ALTERNATING"
headerText = "Header Text"
filter = "SERVER"
sort = "SERVER"
onNavigate = "onMyNavigate"
selectionMode = "lineedit"
emptyTableText = "No records found!"
onRowSelection = "onMyRowSelection"
allRowsEditable = "TRUE"
table = "<%= PO_ITEMS %>"
visibleRowCount = "10" >
<htmlb:tableViewColumns>
<htmlb:tableViewColumn columnName = "PONUMBER"
width = "70"
horizontalAlignment = "left"
title = "PO"
sort = "TRUE"
wrapping = "TRUE" >
</htmlb:tableViewColumn>
<htmlb:tableViewColumn columnName = "POITEM"
width = "40"
horizontalAlignment = "left"
title = "Item"
wrapping = "TRUE" >
</htmlb:tableViewColumn>
<htmlb:tableViewColumn columnName = "MATERIAL"
width = "80"
horizontalAlignment = "left"
title = "Material"
wrapping = "TRUE"
edit = "TRUE" >
</htmlb:tableViewColumn>
<htmlb:tableViewColumn columnName = "POITEMQTY"
width = "70"
horizontalAlignment = "right"
title = "Order Qty"
wrapping = "TRUE"
edit = "TRUE" >
</htmlb:tableViewColumn>
</htmlb:tableViewColumns>
</htmlb:tableView>
Hi,
maybe you should give some more details on the problems you are facing.
If I haven't overlooked something you have no UPDATE or INSERT statements in your code (or a call to a FM or method to update data).
So I suggest reading all the excellent BSP weblogs here on SDN.
You would need to react on the event the user triggered and pass the data to the database (e.g. via UPDATE statement).
As a tip: try to go with MVC design from the beginning. You will have to create a model class holding your data and managing the business functions.
Hope this helps.
Regards,
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.