‎2008 Apr 28 3:14 PM
Hi all,
I'm using bapi 'BAPI_QUOTATION_CREATEFROMDATA2' to create quotation.
This is my code:
DATA: t_quotation_header_in LIKE bapisdhd1,
t_quot_header_inx LIKE bapisdhd1x OCCURS 0 WITH HEADER LINE,
t_quot_item_in LIKE bapisditm OCCURS 0 WITH HEADER LINE,
t_quot_item_inx LIKE bapisditmx OCCURS 0 WITH HEADER LINE,
t_quot_partenrs LIKE bapiparnr OCCURS 0 WITH HEADER LINE,
t_quot_schedule_in LIKE bapischdl OCCURS 0 WITH HEADER LINE,
t_quot_conditions_in LIKE bapicond OCCURS 0 WITH HEADER LINE,
t_quot_conditions_inx LIKE bapicondx OCCURS 0 WITH HEADER LINE,
t_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
t_quotation_header_in-doc_type = vbak-auart.
t_quotation_header_in-sales_org = vbak-vkorg.
t_quotation_header_in-distr_chan = vbak-vtweg.
t_quotation_header_in-division = vbak-spart.
t_quotation_header_in-sales_grp = vbak-vkgrp.
t_quotation_header_in-sales_off = vbak-vkbur.
t_quotation_header_in-req_date_h = vbak-vdatu.
t_quotation_header_in-qt_valid_t = vbak-bnddt.
t_quotation_header_in-price_date = vbkd-prsdt.
t_quotation_header_in-pmnttrms = knvv-zterm.
t_quotation_header_in-pymt_meth = knvv-zzlsch.
t_quotation_header_in-currency = waers.
t_quotation_header_in-ship_cond = knvv-vsbed.
t_quot_header_inx-updateflag = 'U'.
t_quot_header_inx-doc_type = 'X'.
t_quot_header_inx-sales_org = 'X'.
t_quot_header_inx-distr_chan = 'X'.
t_quot_header_inx-division = 'X'.
t_quot_header_inx-sales_grp = 'X'.
t_quot_header_inx-sales_off = 'X'.
t_quot_header_inx-req_date_h = 'X'.
t_quot_header_inx-qt_valid_t = 'X'.
t_quot_header_inx-price_date = 'X'.
t_quot_header_inx-pmnttrms = 'X'.
t_quot_header_inx-pymt_meth = 'X'.
t_quot_header_inx-ship_cond = 'X'.
t_quot_header_inx-currency = 'X'.
APPEND t_quot_header_inx.
t_quot_item_in-itm_number = v_itm_number.
t_quot_item_in-material = wa_basket02-matnr.
t_quot_item_in-target_qty = wa_basket02-qta.
t_quot_item_in-pmnttrms = 'Z102'.
t_quot_item_in-price_date = vbkd-prsdt.
t_quot_item_in-plant = wa_basket02-werks.
t_quot_item_in-store_loc = wa_basket02-lgort.
t_quot_item_in-dlv_time = wa_basket02-dlv_time.
APPEND t_quot_item_in.
t_quot_item_inx-itm_number = v_itm_number.
t_quot_item_inx-updateflag = 'I'.
t_quot_item_inx-item_categ = 'X'.
t_quot_item_inx-material = 'X'.
t_quot_item_inx-target_qty = 'X'.
t_quot_item_inx-plant = 'X'.
t_quot_item_inx-store_loc = 'X'.
t_quot_item_inx-dlv_time = 'X'.
APPEND t_quot_item_inx.
t_quot_conditions_in-itm_number = v_itm_number.
t_quot_conditions_in-cond_st_no = '285'.
t_quot_conditions_in-cond_count = '01'.
t_quot_conditions_in-cond_type = 'ZPR0'.
t_quot_conditions_in-cond_value = wa_basket02-zpr0. " / 10.
t_quot_conditions_in-currency = waers.
t_quot_conditions_in-calctypcon = 'G'.
t_quot_conditions_in-cond_p_unt = wa_basket02-zpr0_kpein.
t_quot_conditions_in-cond_value = wa_basket02-zpr0.
APPEND t_quot_conditions_in.
t_quot_conditions_inx-itm_number = v_itm_number.
t_quot_conditions_inx-cond_st_no = '285'.
t_quot_conditions_inx-cond_count = '01'.
t_quot_conditions_inx-cond_type = 'ZPR0'.
t_quot_conditions_inx-updateflag = 'U'.
t_quot_conditions_inx-cond_value = 'X'.
t_quot_conditions_inx-cond_p_unt = 'X'.
t_quot_conditions_inx-currency = 'X'.
APPEND t_quot_conditions_inx.
t_quot_partenrs-partn_role = 'AG'.
t_quot_partenrs-partn_numb = knvv-kunnr.
APPEND t_quot_partenrs.
CALL FUNCTION 'BAPI_QUOTATION_CREATEFROMDATA2'
EXPORTING
* SALESDOCUMENTIN =
quotation_header_in = t_quotation_header_in
IMPORTING
salesdocument = v_quotation
TABLES
return = t_return
quotation_items_in = t_quot_item_in
QUOTATION_ITEMS_INX = t_quot_item_inx
quotation_partners = t_quot_partenrs
quotation_schedules_in = t_quot_schedule_in
quotation_conditions_in = t_quot_conditions_in
quotation_conditions_inx = t_quot_conditions_inx
.I'm receiving this error message
V1 453 Statistics:The currency from in EUR for date 28.04.2008 could not be determined
EUR is value that I set for currency. From??? Do I set currency in other field???
Have you got any idea??
Thanks in advance.
Federica
‎2008 Apr 28 3:50 PM
Hi Federica,
What are you passing to this parameter inside your code:
"t_quot_conditions_in-currency = waers."
Thanks,
Greetson
‎2008 Apr 28 4:17 PM
Hi Greetson,
"waers" is "EUR" for all occurrences.
Thanks for your response,
Federica.