1、前台
报价是提供给客户交付货物或服务的一份文件,客户想要知道产品价格以及装运时间。
事务代码VA21
输入报价单类型和销售组织、分销渠道、产品组
输入售达方和行项目的物料信息,订购数量等信息
输入条件,金额
2、源代码
"--------------------@斌将军-------------------- DATA: lv_vbeln TYPE bapivbeln-vbeln, "询报价单 ls_head_in TYPE bapisdhd1, "抬头 ls_head_inx TYPE bapisdhd1x, ls_logic_switch TYPE bapisdls, "执行新的定价标记 lt_item_in TYPE TABLE OF bapisditm WITH HEADER LINE, "行项目 lt_item_inx TYPE TABLE OF bapisditmx WITH HEADER LINE, lt_partner_in TYPE TABLE OF bapiparnr WITH HEADER LINE, "合作伙伴 lt_schdl_in TYPE TABLE OF bapischdl WITH HEADER LINE, "计划行 lt_schdl_inx TYPE TABLE OF bapischdlx WITH HEADER LINE, lt_cond_in TYPE TABLE OF bapicond WITH HEADER LINE, "定价 lt_cond_inx TYPE TABLE OF bapicondx WITH HEADER LINE, lt_return TYPE TABLE OF bapiret2 WITH HEADER LINE. "返回消息 DATA:lv_check TYPE char1, lv_message TYPE char200. "询报价单抬头 * ls_head_in-purch_no_c = '111'."客户参考PO ls_head_in-purch_date = '20230508'."客户参考日期 ls_head_in-doc_type = 'Z000'. "销售订单类型 ls_head_in-sales_org = '1050'. "销售组织 ls_head_in-distr_chan = '00'."分销渠道 ls_head_in-division = '00'."产品组 ls_head_in-qt_valid_f = '20230508'."询报价单有效开始日期 ls_head_in-qt_valid_t = '20230531'."询报价单有效截止日期 ls_head_inx-updateflag = 'I'. ls_head_inx-purch_no_c = 'X'."客户参考PO ls_head_inx-purch_date = 'X'."客户参考日期 ls_head_inx-doc_type = 'X'. "销售订单类型 ls_head_inx-sales_org = 'X'. "销售组织 ls_head_inx-distr_chan = 'X'."分销渠道 ls_head_inx-division = 'X'."产品组 ls_head_inx-qt_valid_f = 'X'."询报价单有效开始日期 ls_head_inx-qt_valid_t = 'X'."询报价单有效截止日期 "合作伙伴 lt_partner_in-partn_role = 'AG'. "售达方 lt_partner_in-partn_numb = '0001003763'."售达方 APPEND lt_partner_in. CLEAR:lt_partner_in. ls_logic_switch-pricing = 'G'."重新定价 lt_item_in-itm_number = '000010'."销售分销行项目 lt_item_in-material = '000000000000000999'. lt_item_in-target_qty = '10'."数量 lt_item_in-target_qu = 'H'."单位 lt_item_in-plant = '1050'."订货工厂 * lt_item_in-tax_class1 = ."物料税分类 lt_item_inx-updateflag = 'I'. lt_item_inx-itm_number = '000010'."销售分销行项目 lt_item_inx-material = 'X'."物料编码 lt_item_inx-target_qty = 'X'."数量 lt_item_inx-target_qu = 'X'."单位 lt_item_inx-plant = 'X'."订货工厂 * lt_item_inx-tax_class1 = 'X'."物料税分类 APPEND: lt_item_in,lt_item_inx. CLEAR:lt_item_in,lt_item_inx. "计划行项目 lt_schdl_in-itm_number = '000010'."销售分销行项目 lt_schdl_in-req_qty = '10'."数量 lt_schdl_inx-updateflag = 'I'. lt_schdl_inx-itm_number = 'X'. lt_schdl_inx-req_qty = 'X'. APPEND:lt_schdl_in,lt_schdl_inx. CLEAR:lt_schdl_in,lt_schdl_inx. "定价 lt_cond_in-itm_number = '000010'."销售分销行项目 lt_cond_in-cond_type = 'ZP00'. "条件类型 lt_cond_in-cond_value = 10. "定价值 lt_cond_in-currency = 'CNY'. "货币码 lt_cond_in-cond_unit = 'H'. "定价单位 * lt_cond_in-cond_p_unt = t_item-kpein. lt_cond_inx-updateflag = 'I'. lt_cond_inx-itm_number = '000010'."销售分销行项目 lt_cond_inx-cond_type = 'ZP00'. "条件类型 lt_cond_inx-cond_value = 'X'. "定价值 lt_cond_inx-currency = 'X'. "货币码 lt_cond_inx-cond_unit = 'X'. "定价单位 * lt_cond_inx-cond_p_unt = 'X'. APPEND:lt_cond_in,lt_cond_inx. CLEAR:lt_cond_in,lt_cond_inx. CALL FUNCTION 'BAPI_QUOTATION_CREATEFROMDATA2' EXPORTING * SALESDOCUMENTIN = quotation_header_in = ls_head_in quotation_header_inx = ls_head_inx logic_switch = ls_logic_switch IMPORTING salesdocument = lv_vbeln TABLES return = lt_return quotation_items_in = lt_item_in quotation_items_inx = lt_item_inx quotation_partners = lt_partner_in quotation_schedules_in = lt_schdl_in quotation_schedules_inx = lt_schdl_inx quotation_conditions_in = lt_cond_in quotation_conditions_inx = lt_cond_inx. CLEAR:lv_check,lv_message. LOOP AT lt_return WHERE type CA 'EAX'. lv_message = lv_message && lt_return-message. lv_check = 'E'. ENDLOOP. IF lv_check = 'E'. CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'. ELSE. CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' EXPORTING wait = 'X'. ENDIF. "--------------------@斌将军--------------------
TRANSLATE with