2023 Nov 13 9:46 AM
Hi everyone ,
I use BAPI_CONTRACT_CREATE to create a contract. And everything works properly as I want. Except the NETPR cell.
Even though I filled this field with the codes below, its value always appears as zero.
(I filled in the Account and Accounx tables because it was stated in a source that we need to fill in the Account table. I didn't normally use these tables.)
But no matter how hard I tried, I couldn't figure it out. can you help?
Thanks.
ls_item-item_no = lv_ctr_item.
ls_item-material = ls_accepted_items-ekpo-matnr.
ls_item-plant = ls_accepted_items-ekpo-werks.
ls_item-stge_loc = ls_accepted_items-ekpo-lgort.
ls_item-target_qty = ls_accepted_items-ekpo-menge. "?
ls_item-preq_no = ls_accepted_items-eban-banfn.
ls_item-preq_item = ls_accepted_items-eban-bnfpo.
ls_item-rfq_no = ls_accepted_items-ekpo-ebeln.
ls_item-rfq_item = ls_accepted_items-ekpo-ebelp.
ls_item-acctasscat = 'U'.
ls_item-net_price = CONV #( ls_accepted_items-ekpo-netpr ).
ls_item-price_unit = ls_accepted_items-ekpo-peinh .
ls_item-info_upd = 'A'. "ÜY ile ya da ÜY olmadan güncelleme
ls_item-prnt_price = 'X' .
APPEND ls_item TO lt_item.
CLEAR: ls_item.
ls_itemx-item_no = lv_ctr_item.
ls_itemx-item_nox = lvc_x.
ls_itemx-material = lvc_x.
ls_itemx-plant = lvc_x .
ls_itemx-stge_loc = lvc_x .
ls_itemx-target_qty = lvc_x . "?
ls_itemx-tax_code = lvc_x .
ls_itemx-item_cat = lvc_x .
ls_itemx-acctasscat = lvc_x .
ls_itemx-preq_no = lvc_x.
ls_itemx-preq_item = lvc_x.
ls_itemx-rfq_no = lvc_x.
ls_itemx-rfq_item = lvc_x.
ls_itemx-acctasscat = lvc_x.
ls_itemx-net_price = lvc_x.
ls_itemx-price_unit = lvc_x.
ls_itemx-prnt_price = lvc_x .
ls_itemx-info_upd = lvc_x .
APPEND ls_itemx TO lt_itemx.
CLEAR: ls_itemx.
""" Account
ls_account-item_no = lv_ctr_item .
ls_account-net_value = CONV #( ls_accepted_items-ekpo-netpr ) .
APPEND ls_account TO lt_account .
CLEAR: ls_account .
ls_accountx-item_no = lv_ctr_item .
ls_accountx-item_nox = lvc_x.
ls_accountx-net_value = lvc_x.
APPEND ls_accountx TO lt_accountx .
CLEAR: ls_accountx .
ENDLOOP.
CALL FUNCTION 'BAPI_CONTRACT_CREATE'
EXPORTING
header = ls_header
headerx = ls_headerx
IMPORTING
purchasingdocument = lv_ex_ctr_number
exp_header = ls_header_exp
TABLES
return = lt_return
item = lt_item
itemx = lt_itemx
account = lt_account
accountx = lt_accountx .
2023 Nov 13 3:43 PM
Try to pass the relevant condition data (line item condition validity and line item condition) to BAPI.
Sometimes net price is based on conditions. It depends on config. Are you entering the net price while creating contract manually or it is automatically populated? If it is automatic then you have to pass the condition data to BAPI.