REPORT zian05
.
DATA : i_header_data LIKE bapiobdlvhdrchg . "Delivery header
DATA : i_header_control LIKE bapiobdlvhdrctrlchg . "delivery header control
DATA : i_delivery_no LIKE bapiobdlvhdrchg -deliv_numb . "deliver number
DATA : i_techn_control LIKE bapidlvcontrol . "TECHN_CONTROL
DATA : i_item_data LIKE bapiobdlvitemchg OCCURS 0 WITH HEADER LINE . "ITEM_DATA delivery item
DATA : i_item_control LIKE bapiobdlvitemctrlchg OCCURS 0 WITH HEADER LINE . "ITEM_CONTROL
DATA : i_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE . "Return
*Set Delivery Header data
i_delivery_no = '1315000730' .
i_header_data -deliv_numb = i_delivery_no .
*i_header_data-gross_wt = 6.
*i_header_data-net_weight = 16.
*i_header_data-unit_of_wt = 'KG'.
i_techn_control -upd_ind = 'U' .
i_header_control -deliv_numb = i_delivery_no .
*i_header_control-gross_wt_flg = 'X'.
*i_header_control-net_wt_flg = 'X'.
i_item_data -deliv_numb = i_delivery_no .
i_item_data -deliv_item = '000010' .
i_item_data -gross_wt = 9 .
i_item_data -net_weight = 6 .
i_item_data -unit_of_wt = 'KG' .
i_item_data -conv_fact = '1' .
i_item_data -fact_unit_nom = 1 .
i_item_data -fact_unit_denom = 1 .
APPEND i_item_data .
CLEAR i_item_data .
i_item_data -deliv_numb = i_delivery_no .
i_item_data -deliv_item = '000020' .
i_item_data -gross_wt = 10 .
i_item_data -net_weight = 8 .
i_item_data -unit_of_wt = 'KG' .
i_item_data -conv_fact = '1' .
i_item_data -fact_unit_nom = 1 .
i_item_data -fact_unit_denom = 1 .
APPEND i_item_data .
CLEAR i_item_data .
i_item_control -deliv_numb = i_delivery_no .
i_item_control -deliv_item = '000010' .
i_item_control -volume_flg = 'X' .
i_item_control -net_wt_flg = 'X' .
i_item_control -gross_wt_flg = 'X' .
APPEND i_item_control .
CLEAR i_item_control .
i_item_control -deliv_numb = i_delivery_no .
i_item_control -deliv_item = '000020' .
i_item_control -volume_flg = 'X' .
i_item_control -net_wt_flg = 'X' .
i_item_control -gross_wt_flg = 'X' .
APPEND i_item_control .
CLEAR i_item_control .
"CLEAR i_item_data.
CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
EXPORTING
header_data = i_header_data
header_control = i_header_control
delivery = i_delivery_no
techn_control = i_techn_control
TABLES "header_partner =
" header_partner_addr =
"header_deadlines =
item_data = i_item_data
item_control = i_item_control
" item_serial_no = supplier_cons_data
"extension1 =
"extension2 =
"tokenreference =
return = i_return .
*LOOP AT i_item_data.
*ENDLOOP.
*LOOP AT i_return.
*ENDLOOP.
IF sy -subrc EQ 0 .
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X' .
"importing
" return =
ENDIF .
DATA : i_header_data LIKE bapiobdlvhdrchg . "Delivery header
DATA : i_header_control LIKE bapiobdlvhdrctrlchg . "delivery header control
DATA : i_delivery_no LIKE bapiobdlvhdrchg -deliv_numb . "deliver number
DATA : i_techn_control LIKE bapidlvcontrol . "TECHN_CONTROL
DATA : i_item_data LIKE bapiobdlvitemchg OCCURS 0 WITH HEADER LINE . "ITEM_DATA delivery item
DATA : i_item_control LIKE bapiobdlvitemctrlchg OCCURS 0 WITH HEADER LINE . "ITEM_CONTROL
DATA : i_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE . "Return
*Set Delivery Header data
i_delivery_no = '1315000730' .
i_header_data -deliv_numb = i_delivery_no .
*i_header_data-gross_wt = 6.
*i_header_data-net_weight = 16.
*i_header_data-unit_of_wt = 'KG'.
i_techn_control -upd_ind = 'U' .
i_header_control -deliv_numb = i_delivery_no .
*i_header_control-gross_wt_flg = 'X'.
*i_header_control-net_wt_flg = 'X'.
i_item_data -deliv_numb = i_delivery_no .
i_item_data -deliv_item = '000010' .
i_item_data -gross_wt = 9 .
i_item_data -net_weight = 6 .
i_item_data -unit_of_wt = 'KG' .
i_item_data -conv_fact = '1' .
i_item_data -fact_unit_nom = 1 .
i_item_data -fact_unit_denom = 1 .
APPEND i_item_data .
CLEAR i_item_data .
i_item_data -deliv_numb = i_delivery_no .
i_item_data -deliv_item = '000020' .
i_item_data -gross_wt = 10 .
i_item_data -net_weight = 8 .
i_item_data -unit_of_wt = 'KG' .
i_item_data -conv_fact = '1' .
i_item_data -fact_unit_nom = 1 .
i_item_data -fact_unit_denom = 1 .
APPEND i_item_data .
CLEAR i_item_data .
i_item_control -deliv_numb = i_delivery_no .
i_item_control -deliv_item = '000010' .
i_item_control -volume_flg = 'X' .
i_item_control -net_wt_flg = 'X' .
i_item_control -gross_wt_flg = 'X' .
APPEND i_item_control .
CLEAR i_item_control .
i_item_control -deliv_numb = i_delivery_no .
i_item_control -deliv_item = '000020' .
i_item_control -volume_flg = 'X' .
i_item_control -net_wt_flg = 'X' .
i_item_control -gross_wt_flg = 'X' .
APPEND i_item_control .
CLEAR i_item_control .
"CLEAR i_item_data.
CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
EXPORTING
header_data = i_header_data
header_control = i_header_control
delivery = i_delivery_no
techn_control = i_techn_control
TABLES "header_partner =
" header_partner_addr =
"header_deadlines =
item_data = i_item_data
item_control = i_item_control
" item_serial_no = supplier_cons_data
"extension1 =
"extension2 =
"tokenreference =
return = i_return .
*LOOP AT i_item_data.
*ENDLOOP.
*LOOP AT i_return.
*ENDLOOP.
IF sy -subrc EQ 0 .
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X' .
"importing
" return =
ENDIF .