CMOD->PPCO0001
*&---------------------------------------------------------------------*
*& 包含 ZXCO1U01
*&---------------------------------------------------------------------*
IF header_table-auart EQ 'ZP07'.
DATA: lv_value TYPE p LENGTH 16 DECIMALS 2.
READ TABLE header_table INTO DATA(lwa_head) INDEX 1.
DATA(lv_objnr) = 'OR' && lwa_head-aufnr.
SELECT * INTO TABLE @DATA(lta_cobrb) FROM cobrb WHERE objnr EQ @lv_objnr.
IF lta_cobrb IS NOT INITIAL.
LOOP AT lta_cobrb ASSIGNING FIELD-SYMBOL(<lfs_cobrb>).
READ TABLE position_table INTO DATA(lwa_position) WITH KEY aufnr = lwa_head-aufnr
posnr = <lfs_cobrb>-posnr.
IF sy-subrc EQ 0.
SELECT stprs INTO @DATA(lv_stprs) UP TO 1 ROWS
FROM mbew
WHERE matnr EQ @lwa_position-matnr
AND bwkey EQ @lwa_head-werks.
ENDSELECT.
CLEAR lv_value.
lv_value = lv_stprs * lwa_position-psmng.
<lfs_cobrb>-aqzif = floor( lv_value ).
ENDIF.
CLEAR lwa_position.
ENDLOOP.
CALL FUNCTION 'K_SRULE_SAVE_UTASK'
TABLES
* T_COBRA_INSERT =
* T_COBRA_UPDATE =
* T_COBRA_DELETE =
* T_COBRB_INSERT =
t_cobrb_update = lta_cobrb
* T_COBRB_DELETE =
EXCEPTIONS
srule_utask_error = 1
OTHERS = 2.
ENDIF.
ENDIF.
***变更日志表
CALL FUNCTION 'ZFM_PP_ORDER_SAVE_LOG'
TABLES
header_table = header_table
header_table_old = header_table_old
component_table = component_table
component_table_old = component_table_old.