2010 Nov 24 5:51 AM
Dear experts , I am passing condition data to bapi_po_create1 , but conditions are not getting updated , my po is getting created successfully in held status , some condition types are coming automatically from pricing procedure , but the contion I am giving thru bapi are not coming in PO
please help.
I am passing data like
header conditions
ls_cheader-cond_type = 'PBXX'.
ls_cheader-cond_st_no = '001'.
ls_cheaderx-cond_st_no = '001'.
ls_cheader-ITM_NUMBER = '00000'.
ls_cheader-cond_value = zcond_wa-cond_rate.
ls_cheader-currency = zcond_wa-cond_curr.
ls_cheader-cond_unit = zcond_wa-cond_unit.
ls_cheader-cond_p_unt = zcond_wa-cond_prc_unit.
ls_cheader-CHANGE_ID = 'U'.
ls_cheaderx-ITM_NUMBER = '00000'.
ls_cheaderx-cond_type = 'X'.
ls_cheaderx-cond_value = 'X'.
ls_cheaderx-currency = 'X'.
ls_cheaderx-CHANGE_ID = 'X'.
item conditions
ls_citem-cond_type = 'PBXX'.
ls_citem-cond_st_no = '001'.
ls_citemX-cond_st_no = '001'.
ls_citem-itm_number = zitems_wa-number_int+5(5) * 10.
ls_citem-calctypcon = ' ' ..
ls_citem-cond_value = zcond_wa-cond_rate .
ls_citem-conbaseval = ls_citem-cond_value .
ls_citem-currenckey = zcond_wa-cond_curr .
ls_citem-change_id = 'U' .
ls_citem-calctypcon = 'A' .
ls_citemx-itm_number = zitems_wa-number_int+5(5) * 10.
ls_citemx-cond_type = 'X' .
ls_citemx-cond_value = 'X' .
ls_citemx-currency = 'X' .
ls_citemx-currency_iso = 'X' .
ls_citemx-factbasval = 'X' .
ls_citemx-scalbasval = 'X' .
ls_citemx-change_id = 'X' .
ls_citem-calctypcon = 'X'.
Dear experts , I am passing condition data to bapi_po_create1 , but conditions are not getting updated , my po is getting created successfully in held status , some condition types are coming automatically from pricing procedure , but the contion I am giving thru bapi are not coming in PO
please help.
I am passing data like
header conditions
ls_cheader-cond_type = 'PBXX'.
ls_cheader-cond_st_no = '001'.
ls_cheaderx-cond_st_no = '001'.
ls_cheader-ITM_NUMBER = '00000'.
ls_cheader-cond_value = zcond_wa-cond_rate.
ls_cheader-currency = zcond_wa-cond_curr.
ls_cheader-cond_unit = zcond_wa-cond_unit.
ls_cheader-cond_p_unt = zcond_wa-cond_prc_unit.
ls_cheader-CHANGE_ID = 'U'.
ls_cheaderx-ITM_NUMBER = '00000'.
ls_cheaderx-cond_type = 'X'.
ls_cheaderx-cond_value = 'X'.
ls_cheaderx-currency = 'X'.
ls_cheaderx-CHANGE_ID = 'X'.
item conditions
ls_citem-cond_type = 'PBXX'.
ls_citem-cond_st_no = '001'.
ls_citemX-cond_st_no = '001'.
ls_citem-itm_number = zitems_wa-number_int+5(5) * 10.
ls_citem-calctypcon = ' ' ..
ls_citem-cond_value = zcond_wa-cond_rate .
ls_citem-conbaseval = ls_citem-cond_value .
ls_citem-currenckey = zcond_wa-cond_curr .
ls_citem-change_id = 'U' .
ls_citem-calctypcon = 'A' .
ls_citemx-itm_number = zitems_wa-number_int+5(5) * 10.
ls_citemx-cond_type = 'X' .
ls_citemx-cond_value = 'X' .
ls_citemx-currency = 'X' .
ls_citemx-currency_iso = 'X' .
ls_citemx-factbasval = 'X' .
ls_citemx-scalbasval = 'X' .
ls_citemx-change_id = 'X' .
ls_citem-calctypcon = 'X'.
2010 Nov 24 5:59 AM
Hi,
Check the values you are passing to "ls_citem-calctypcon" while populating items ... .
item conditions
ls_citem-cond_type = 'PBXX'.
ls_citem-cond_st_no = '001'.
ls_citemX-cond_st_no = '001'.
ls_citem-itm_number = zitems_wa-number_int+5(5) * 10.
ls_citem-calctypcon = ' ' ..
ls_citem-cond_value = zcond_wa-cond_rate .
ls_citem-conbaseval = ls_citem-cond_value .
ls_citem-currenckey = zcond_wa-cond_curr .
ls_citem-change_id = 'U' .
ls_citem-calctypcon = 'A' . <-- this will be overwritten by the below statement
ls_citemx-itm_number = zitems_wa-number_int+5(5) * 10.
ls_citemx-cond_type = 'X' .
ls_citemx-cond_value = 'X' .
ls_citemx-currency = 'X' .
ls_citemx-currency_iso = 'X' .
ls_citemx-factbasval = 'X' .
ls_citemx-scalbasval = 'X' .
ls_citemx-change_id = 'X' .
ls_citem-calctypcon = 'X'.
Regards,
Srini.
2010 Nov 24 11:25 AM
Hi srini , thanks for reply now I am getting conditions in my PO but it is inconsistant
like I am getting two line items in condition tab for condition type PBXX
on what basis I should pass value in ls_citem-calctypcon.
I am getting wrong net price and condition value
2010 Dec 08 7:05 AM
problem solved , actually for PBXXX I have to pass change indicatoter as U , thank you all
2020 Jan 17 4:45 AM
I have also faced the same issue resolved with Below Code :
*----------------------------------------------------------------------*
* Header Level Data
*----------------------------------------------------------------------*
pohead-comp_code = gt_po_header-co_code.
pohead-doc_type = gt_po_header-doc_type.
pohead-creat_date = sy-datum.
pohead-vendor = gt_po_header-vendor.
pohead-purch_org = gt_po_header-purch_org.
pohead-pur_group = gt_po_header-pur_group.
pohead-langu = sy-langu.
pohead-doc_date = sy-datum.
pohead-pmnttrms = gt_po_header-pmnttrms.
poheadx-comp_code = c_x.
poheadx-doc_type = c_x.
poheadx-creat_date = c_x.
poheadx-vendor = c_x.
poheadx-langu = c_x.
poheadx-purch_org = c_x.
poheadx-pur_group = c_x.
poheadx-doc_date = c_x.
poheadx-pmnttrms = c_x.
*----------------------------------------------------------------------*
* Item Data
*----------------------------------------------------------------------*
item_no = gt_po_items-po_item.
poitem-po_item = item_no.
poitem-material = gt_po_items-material.
poitem-plant = gt_po_items-plant.
poitem-stge_loc = gt_po_items-store_loc.
poitem-quantity = gt_po_items-quantity.
poitem-tax_code = gt_po_items-tax_code.
poitem-preq_no = gt_po_items-preq_no.
poitem-preq_item = gt_po_items-preq_item.
APPEND poitem.
poitemx-po_item = item_no.
poitemx-po_itemx = c_x.
poitemx-material = c_x.
poitemx-plant = c_x .
poitemx-stge_loc = c_x .
poitemx-quantity = c_x .
poitemx-tax_code = c_x .
poitemx-item_cat = c_x .
poitemx-acctasscat = c_x .
poitemx-preq_no = c_x .
poitemx-preq_item = c_x .
APPEND poitemx.
*----------------------------------------------------------------------*
* Schedule Line Level Data
*----------------------------------------------------------------------*
posched-po_item = item_no.
posched-sched_line = 1 . "gt_po_item_schedules-s
posched-del_datcat_ext = gt_po_item_schedules-del_datcat_ext. " 'D'.
del_date = sy-datum + 1.
WRITE del_date TO posched-delivery_date.
posched-deliv_time = '000001'.
posched-quantity = gt_po_items-quantity.
APPEND posched.
poschedx-po_item = item_no.
poschedx-sched_line = 1.
poschedx-po_itemx = c_x.
poschedx-sched_linex = c_x.
poschedx-del_datcat_ext = c_x.
poschedx-delivery_date = c_x.
poschedx-quantity = c_x.
APPEND poschedx.
*----------------------------------------------------------------------*
* Account Assignment
*----------------------------------------------------------------------*
wa_account-po_item = item_no.
wa_account-gl_account = gt_po_item_account_assignment-g_l_acct.
APPEND wa_account TO it_account.
wa_accountx-po_item = item_no.
wa_accountx-gl_account = 'X'.
APPEND wa_accountx TO it_accountx.
*----------------------------------------------------------------------*
* Condition Records
*----------------------------------------------------------------------*
wa_pocond-itm_number = item_no.
wa_pocond-cond_st_no = '001'.
wa_pocond-cond_type = 'PB00'.
wa_pocond-cond_value = '100.00'.
wa_pocond-conbaseval = '100.00'.
wa_pocond-change_id = 'U'.
wa_pocond-calctypcon = 'A'.
wa_pocond-currency = gt_po_header-currency.
wa_pocond-currenckey = gt_po_header-currency.
wa_pocond-currency_iso = gt_po_header-currency.
APPEND wa_pocond TO it_pocond.
wa_pocondx-itm_number = item_no.
wa_pocondx-itm_numberx = 'X'.
wa_pocondx-cond_st_no = '001'.
wa_pocondx-cond_st_nox = 'X'.
wa_pocondx-cond_type = 'X'.
wa_pocondx-cond_value = 'X'.
wa_pocondx-conbaseval = 'X'.
wa_pocondx-change_id = 'X'.
wa_pocondx-calctypcon = 'X'.
wa_pocondx-currency = 'X'.
wa_pocondx-currenckey = 'X'.
wa_pocondx-currency_iso = 'X'.
APPEND wa_pocondx TO it_pocondx.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = pohead
poheaderx = poheadx
testrun = ' '
no_price_from_po = 'X'
IMPORTING
exppurchaseorder = ex_po_number
expheader = exp_head
TABLES
return = return
poitem = poitem
poitemx = poitemx
poschedule = posched
poschedulex = poschedx
pocond = it_pocond
pocondx = it_pocondx
poaccount = it_account
poaccountx = it_accountx.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
2010 Dec 03 12:37 PM
try
ttable3-operation = '009'.
ttable3-cond_no = '$000000001'.
ttable3-cond_count = '01'.
ttable3-applicatio = 'V'.
ttable3-cond_type = 'ZPR0'.
ttable3-scaletype = 'A'.
ttable3-scalebasin = 'C'.
ttable3-scale_qty = '1'.
ttable3-cond_p_unt = '1'.
ttable3-cond_unit = 'EA'.
ttable3-calctypcon = 'C'.
ttable3-cond_value = '444'.
ttable3-condcurr = 'USD'.
APPEND ttable3 TO table3.
CALL FUNCTION 'BAPI_PRICES_CONDITIONS'
TABLES
ti_bapicondct = table1
ti_bapicondhd = table2
ti_bapicondit = table3
ti_bapicondqs = table4
ti_bapicondvs = table5
to_bapiret2 = table6
to_bapiknumhs = table7
to_mem_initial = table8
EXCEPTIONS
update_error = 1
OTHERS = 2
.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |