on 2007 Nov 30 6:05 AM
Hi,
I am using bapi 'BAPI_SALESORDER_CREATEFROMDAT2' to create a sales order with reference to contract. I am getting a error 'Address category does not exist '. Am i missing any thing in my code.
e_contract_header_in-refdoc_cat = 'G'.
e_contract_header_in-ref_doc = gv_vbeln.
e_contract_header_in-refdoctype = 'ZDIR'.
e_contract_header_in-doc_type = 'ZSH'.
e_contract_header_in-sales_org = vbak-vkorg.
e_contract_header_in-distr_chan = 'ZD'.
e_contract_header_in-division = 'CA'.
Header data check list
e_contract_header_inx-updateflag = 'I'.
e_contract_header_inx-refdoc_cat = c_x.
e_contract_header_inx-ref_doc = c_x.
e_contract_header_inx-doc_type = c_x.
e_contract_header_inx-sales_org = c_x.
e_contract_header_inx-distr_chan = c_x.
e_contract_header_inx-division = c_x.
LOOP AT t_vbap.
s_contract_items_in-ref_doc = t_vbap-vbeln.
s_contract_items_in-ref_doc_it = t_vbap-posnr.
s_contract_items_in-ref_doc_ca = 'G'.
s_contract_items_in-target_qty = t_vbap-fmeng.
s_contract_items_in-material = t_vbap-matnr.
APPEND s_contract_items_in TO i_contract_items_in.
Fill item update table
s_contract_items_inx-itm_number = t_vbap-posnr.
s_contract_items_inx-material = c_x.
s_contract_items_inx-target_qty = c_x.
s_contract_items_inx-refobjtype = c_x.
s_contract_items_inx-ref_doc = c_x.
s_contract_items_inx-ref_doc_it = c_x.
s_contract_items_inx-ref_doc_ca = c_x.
APPEND s_contract_items_inx TO i_contract_items_inx.
s_contract_schedule-itm_number = t_vbap-posnr.
s_contract_schedule-sched_line = sy-tabix.
s_contract_schedule-req_qty = t_vbap-fmeng.
APPEND s_contract_schedule TO i_contract_schedule.
s_contract_schedulex-itm_number = t_vbap-posnr.
s_contract_schedulex-sched_line = sy-tabix.
s_contract_schedulex-updateflag = 'X'.
s_contract_schedulex-req_qty = 'X'.
APPEND s_contract_schedulex TO i_contract_schedulex.
ENDLOOP.
Fill Partner Table
s_contract_partners-partn_role = 'AG'.
s_contract_partners-partn_numb = vbak-kunnr.
APPEND s_contract_partners TO i_contract_partners.
s_contract_partners-partn_role = 'WE'.
s_contract_partners-partn_numb = vbak-kunnr.
APPEND s_contract_partners TO i_contract_partners.
Call Bapi to create sales order
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
SALESDOCUMENTIN =
order_header_in = e_contract_header_in
order_header_inx = e_contract_header_inx
SENDER =
BINARY_RELATIONSHIPTYPE =
INT_NUMBER_ASSIGNMENT =
BEHAVE_WHEN_ERROR =
LOGIC_SWITCH =
TESTRUN =
CONVERT = ' '
IMPORTING
salesdocument = iv_sales_doc
TABLES
return = i_return
order_items_in = i_contract_items_in
order_items_inx = i_contract_items_inx
order_partners = i_contract_partners
order_schedules_in = i_contract_schedule
order_schedules_inx = i_contract_schedulex.
Please help me to reslove the issue.
Regards,
Satya.
No one encountered such kind of problem?
Satya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
105 | |
8 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.