Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

a question on table update

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>

Former Member
Not what you were looking for? View more on this topic or Ask a question