Error in BAPI_SALESORDER_CREATEFROMDAT2
HI gurus
I am using BAPI_SALESORDER_CREATEFROMDAT2 and ocurrs log error in txt file :
The material 40000221 does not exist in the center CE52 / country BR
Error VBAPKOM 000010
Item 000020 nonexistent
The doc.vendas not be modified
Any Idea?
Hi Ronaldo,
Please check in VB03 Transaction code.
1.Execute the VB03
2.Enter the List/ excl.type ' CE52'.
2.Slect the Customer/Material Radio button
3.Enter the customer and material ( Please check whether the material is created or not by using MM03 transaction code).
I think this may solve your issue.
Regards,
Gurunath Kumar D
Similar Messages
-
Error in BAPI_SALESORDER_CREATEFROMDAT2 to create sales order
Hi all,
I'm trying to create a sales order using bapi_salesorder_createfromdat2. I have given the import parameters as per the documentation. But i'm getting the following error messages from the return parameter
number message
233 SALES_HEADER_IN has been processed successfully
233 SALES_ITEM_IN has been processed succesfully
555 The sales document is not yet complete: Edit
311 Standard Order 73 has been saved
I gave the partner role (SP) and partner number in ORDERS_PARTNERS. But i din get any message regarding its processing.
Pls can anyone guide me to create sales order using this bapi.
Thanks & Regards,
Revathi.Hi
I Think there problem in passing data to function module some important data is missing
run the functional in se37 and pass the data and see the result i have created sale order by passing the value below
header-doc_type = 'ZS4'.
header-sales_org = wa_temp1-vkorg.
header-purch_no = wa_temp1-bstnk.
header-distr_chan = wa_temp1-vtweg.
header-division = wa_temp1-spart.
header-purch_no_s = wa_temp1-bstnk.
wa_partner-partn_role = 'AG'.
wa_partner-partn_numb = wa_temp1-kunnr.
APPEND wa_partner TO it_partner.
wa_partner-partn_role = 'WE'.
wa_partner-partn_numb = wa_temp1-kunnr.
APPEND wa_partner TO it_partner.
CLEAR: wa_partner.
wa_item-material = wa_temp2-matnr.
wa_item-plant = wa_temp2-werks.
wa_item-req_qty = wa_temp2-fkimg.
wa_item-target_qty = wa_temp2-fkimg.
APPEND wa_item TO it_item.
with regards
Nilesh -
Sold-to party error in 'BAPI_SALESORDER_CREATEFROMDAT2'
Hi,
I am using 'BAPI_SALESORDER_CREATEFROMDAT2' and am getting error message 'Please enter sold-to party or ship-to party', Parameter Name - 'SALES_HEADER_IN'.
I am using ECC 6.0.
In the BAPI, import parameter ORDER_HEADER_IN does not have Sold to party.
How do I pass sold to party to the sales order header?
Thanks.check the below code.
Check below code. I used BAPI_SALESORDER_CREATEFROMDAT2.
Dont forget to call BAPI_TRANSACTION_COMMIT.
o
+ Order header
x_order_header_in-doc_type = it_file-auart.
x_order_header_in-sales_org = it_file-vkorg.
x_order_header_in-distr_chan = it_file-vtweg.
x_order_header_in-division = it_file-spart.
x_order_header_in-ord_reason = it_file-augru.
x_order_header_in-purch_no_c = it_file-pohead.
o
+ Partners data
+ Sold to party
it_order_partners-partn_role = 'AG'.
it_order_partners-partn_numb = it_file-soldto.
append it_order_partners.
clear it_order_partners.
o
+ Ship to party
it_order_partners-partn_role = 'WE'.
it_order_partners-partn_numb = it_file-shipto.
append it_order_partners.
clear it_order_partners.
o
+ Item Details
it_orders_items_in-itm_number = g_itemno.
it_orders_items_in-material = it_file-matnr.
it_orders_items_in-target_qty = it_file-zmeng.
it_orders_items_in-target_qu = it_file-zieme.
it_orders_items_in-plant = it_file-werks.
append it_orders_items_in.
clear it_orders_items_in.
o
+ Schedule Lines
it_order_schedules_in-itm_number = g_itemno.
it_order_schedules_in-sched_line = c_0001.
it_order_schedules_in-req_qty = it_file-zmeng.
append it_order_schedules_in.
clear it_order_schedules_in.
Thanks,
Rajesh. -
Error while creating a sales order BAPI_SALESORDER_CREATEFROMDAT2
Hi All,
I am using the BAPI BAPI_SALESORDER_CREATEFROMDAT2 to create a sales order.
I am passing all the required fields and also the rejection code at the item level.
Also I am using a variant configuration material and hence ai am filling the VC config tables.
When I execute this BAPI it is giving me the error 'Item 000010's configuration can no longer be changed' although configuration is maintained for this material.
When I try the same case with no rejection code and with VC configuration, the sales order is created.
When I try the same case again with rejection code and NO VC configuration, the sales order is created.
When I maintain both the rejection code and VC configuration I am getting the error.
Does anyone have any idea what is causing this error or I am supposed to populate any flag in ORDER_ITEMS_INX to get this correctly.
Any answers will be greatly apppreciated!
Thanks
SandeepSandeep,
There are a few SAP Notes that you should investigate, some of which you may have already seen. First, I'd suggest you look at [Note 481102|https://service.sap.com/sap/support/notes/481102] and its three related Notes: [774346|https://service.sap.com/sap/support/notes/774346], [550431|https://service.sap.com/sap/support/notes/550431], [366265|https://service.sap.com/sap/support/notes/366265].
If these Notes do not help then check if [Note 1099414|https://service.sap.com/sap/support/notes/1099414] has been applied in your system. If it has been applied, then [Note 1116144|https://service.sap.com/sap/support/notes/1116144] might solve your issue. If neither of these two notes are applied, then it could be that they both need to be applied. However, if both notes are already applied, then you may want to consider opening a customer message with SAP. Since these two SAP Notes are relatively new, it makes me think that you might have discovered a related error that has not been reported to SAP yet.
Best Regards,
Jamie -
Error in sales order creation using BAPI_SALESORDER_CREATEFROMDAT2
Hi all,
Pl look into below code :
Here order is getting created , however ship to party and sold to party shows the same value.
*& Report ZSD_SALEORDCRE
report zsd_saleordcre.
Order header:*
- Order type: OR Important you must use the german code TA*
- Sales org: 1000*
- Distrb. chan.: 10*
- Division: 00*
- Sold to party: 1032*
- Ship to party: 1032*
- Purch order: DG-19970626-3*
Order item:*
- Material: P-100*
- Qty: 1*
data:
Order partners*
li_order_partners type standard table of bapiparnr,
l_order_partners like bapiparnr,
Structures for order header*
l_order_header_in like bapisdhd1,
l_order_header_inx like bapisdhd1x,
Tables for order items*
li_order_items_in type standard table of bapisditm,
l_order_items_in like bapisditm,
li_order_items_inx type standard table of bapisditmx,
l_order_items_inx like bapisditmx,
schedules*
li_order_schedules_in type standard table of bapischdl,
l_order_schedules_in like bapischdl,
li_order_schedules_inx type standard table of bapischdl,
l_order_schedules_inx like bapischdl,
Return table from bapi call*
li_return type standard table of bapiret2,
l_return type bapiret2,
Sales document number*
l_vbeln like bapivbeln-vbeln,
Error flag*
l_errflag(1) type c.
start-of-selection.
Build partner information*
clear l_order_partners.
l_order_partners-partn_role = 'WE'. "Remember German codes !
l_order_partners-partn_numb = '0000000101'.
append l_order_partners to li_order_partners.
l_order_partners-partn_role = 'SP'. "Remember German codes !
l_order_partners-partn_numb = '0000000107'.
append l_order_partners to li_order_partners.
Build order header*
Update flag*
l_order_header_inx-updateflag = 'I'.
Sales document type*
l_order_header_in-doc_type = 'ZOD2'. "Remember German codes !
l_order_header_inx-doc_type = 'X'.
Sales organization*
l_order_header_in-sales_org = '1100'.
l_order_header_inx-sales_org = 'X'.
Distribution channel*
l_order_header_in-distr_chan = '20'.
l_order_header_inx-distr_chan = 'X'.
Division*
l_order_header_in-division = '10'.
l_order_header_inx-division = 'X'.
Purchase order*
l_order_header_in-purch_no_c = 'DG-19970626-300'.
l_order_header_inx-purch_no_c = 'X'.
l_order_header_in-purch_date = '20090817'.
l_order_header_inx-purch_date = 'X'.
Build order item(s) - Only 1 is used in this example*
l_order_items_in-itm_number = '10'.
l_order_items_inx-itm_number = 'X'.
l_order_items_in-material = '29019501AA'.
l_order_items_inx-material = 'X'.
l_order_items_in-plant = 'WH03'.
l_order_items_inx-plant = 'X'.
append l_order_items_in to li_order_items_in.
l_order_items_in-itm_number = '20'.
l_order_items_inx-itm_number = 'X'.
l_order_items_in-material = '29066641'.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = l_order_items_in-material
importing
output = l_order_items_in-material.
l_order_items_inx-material = 'X'.
l_order_items_in-plant = 'WH03'.
l_order_items_inx-plant = 'X'.
append l_order_items_in to li_order_items_in.
l_order_items_inx-updateflag = 'I'.
append l_order_items_inx to li_order_items_inx.
l_order_schedules_in-itm_number = '10'.
l_order_schedules_in-req_qty = '10.00'.
append l_order_schedules_in to li_order_schedules_in.
l_order_schedules_in-itm_number = '20'.
l_order_schedules_in-req_qty = '20.00'.
append l_order_schedules_in to li_order_schedules_in.
CALL Bapi*
call function 'BAPI_SALESORDER_CREATEFROMDAT2'
exporting
order_header_in = l_order_header_in
order_header_inx = l_order_header_inx
testrun = ' '
importing
salesdocument = l_vbeln
tables
return = li_return
order_items_in = li_order_items_in
order_items_inx = li_order_items_inx
order_partners = li_order_partners
order_schedules_in = li_order_schedules_in.
order_schedules_inx = li_order_schedules_inx.*
end-of-selection.
Check and write Return table*
clear l_errflag.
write: / 'Sales dcoument: ', l_vbeln.
loop at li_return into l_return.
write: / l_return-type, l_return-message(50).
if l_return-type = 'E'.
l_errflag = 'X'.
endif.
endloop.
No errors - Commit*
if l_errflag is initial.
call function 'BAPI_TRANSACTION_COMMIT'.
endif.
What could be problem ?
Pl help
Regards
NagarajanHi,
Go through this sample code
LOOP AT t_salesorder INTO wa_salesorder.
t_header-sales_org = wa_salesorder-vkorg.
t_header-distr_chan = wa_salesorder-vtweg.
t_header-division = wa_salesorder-spart.
t_header-doc_type = wa_salesorder-auart.
APPEND t_header.
t_headerx-sales_org = 'X'.
t_headerx-distr_chan = 'X'.
t_headerx-division = 'X'.
t_headerx-doc_type = 'X'.
APPEND t_headerx.
t_itemx-material = 'X'.
t_itemx-target_qty = 'X'.
APPEND t_itemx.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_salesorder-kunnr
IMPORTING
output = wa_alpha-kunnr.
wa_partner-partn_role = 'AG'.
wa_partner-partn_numb = wa_alpha-kunnr.
APPEND wa_partner TO t_partner.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_salesorder-kunnr1
IMPORTING
output = wa_alpha-kunnr1.
wa_partner-partn_role = 'WE'.
wa_partner-partn_numb = wa_alpha-kunnr1.
APPEND wa_partner TO t_partner.
wa_item-po_itm_no = wa_salesorder-bstnk.
wa_item-itm_number = wa_salesorder-posnr.
wa_item-material = wa_salesorder-matnr.
wa_item-target_qty = wa_salesorder-kwmeng.
APPEND wa_item TO t_item.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
order_header_in = t_header
order_header_inx = t_headerx
IMPORTING
salesdocument = gv_doc_no
TABLES
return = t_return
order_items_in = t_item[]
order_items_inx = t_itemx
order_partners = t_partner[].
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'
IMPORTING
return = t_return.
ENDLOOP.
Please paste only the portion of your code that gives you trouble. -
Error when creating sales order using BAPI_SALESORDER_CREATEFROMDAT2
Hello!
I am using BAPI_SALESORDER_CREATEFROMDAT2 for creating the Sales order. But I have a problem when Iu2019m trying to create configuration. I think that parameter order_items_in-material should be generated before calling BAPI described above. I try to use order_items_in-mat_entrd, but BAPI return error message id = V1, number = 320 (No item category available (Table T184 ZAPC TEXT )).
Help me please, How I can solve this problem?<P><STRONG>FUNCTION Z_SD_GET_TEH_COST.<BR>"----<BR>" IMPORTING<BR>" REFERENCE(IS_COST_ORDER) TYPE ZWCLIF_COST_ORDER<BR>" EXPORTING<BR>" REFERENCE(EV_KBETR) TYPE KBETR<BR>"----
</STRONG></P>
<P><STRONG> DEFINE fill_prizn.<BR> IF is_cost_order-&1 IS NOT INITIAL.<BR> CLEAR: ls_cfgs_value-charc,<BR> ls_cfgs_value-value.<BR> ls_cfgs_value-charc = &2.<BR> ls_cfgs_value-value = is_cost_order-&1.<BR>* ls_cfgs_value-valcode = '1'.<BR> APPEND ls_cfgs_value TO lt_cfgs_value.<BR> ENDIF.<BR> END-OF-DEFINITION.</STRONG></P>
<P><STRONG>DATA: ls_header_in TYPE bapisdhd1,<BR> ls_header_inx TYPE bapisdhd1x,</STRONG></P>
<P><STRONG> lt_partners TYPE TABLE OF bapiparnr,<BR> ls_partners TYPE bapiparnr,</STRONG></P>
<P><STRONG> lt_items_in TYPE TABLE OF bapisditm,<BR> lt_items_inx TYPE TABLE OF bapisditmx,</STRONG></P>
<P><STRONG> ls_items_in TYPE bapisditm,<BR> ls_items_inx TYPE bapisditmx,</STRONG></P>
<P><STRONG> ls_cfgs_ref TYPE bapicucfg,<BR> lt_cfgs_ref TYPE TABLE OF bapicucfg,</STRONG></P>
<P><STRONG> lt_cfgs_value TYPE TABLE OF bapicuval,<BR> ls_cfgs_value TYPE bapicuval,</STRONG></P>
<P><STRONG> lt_schedules_in TYPE TABLE OF bapischdl,<BR> ls_schedules_in TYPE bapischdl,</STRONG></P>
<P><STRONG> lt_schedules_inx TYPE TABLE OF bapischdlx,<BR> ls_schedules_inx TYPE bapischdlx,</STRONG></P>
<P><STRONG> lt_cfgs_inst TYPE TABLE OF bapicuins,<BR> ls_cfgs_inst TYPE bapicuins,<BR> lt_cfgs_partof TYPE TABLE OF bapicuprt,<BR> ls_cfgs_partof TYPE bapicuprt,</STRONG></P>
<P><STRONG> lv_vbeln TYPE bapivbeln-vbeln,<BR> lt_return TYPE TABLE OF bapiret2.</STRONG></P>
<P><STRONG>* fill header<BR> ls_header_in-doc_type = 'ZAPC'.<BR> ls_header_in-sales_org = is_cost_order-vkorg.<BR> ls_header_in-distr_chan = is_cost_order-vtweg.<BR> ls_header_in-division = '01'.<BR> ls_header_in-sales_off = '1011'.</STRONG></P>
<P><STRONG> ls_header_inx-updateflag = 'I'.<BR> ls_header_inx-doc_type = 'X'.<BR> ls_header_inx-sales_org = 'X'.<BR> ls_header_inx-distr_chan = 'X'.<BR> ls_header_inx-division = 'X'.<BR> ls_header_inx-sales_off = 'X'.</STRONG></P>
<P><STRONG>* fill partners<BR> ls_partners-partn_role = 'AG'.<BR> ls_partners-partn_numb = '1000000031'. " фиктивный заказчик<BR> APPEND ls_partners TO lt_partners.</STRONG></P>
<P><STRONG>* ls_items_in-material = is_cost_order-matnr.<BR> ls_items_in-mat_entrd = is_cost_order-matnr.<BR> ls_items_in-target_qty = '1'.<BR> ls_items_in-itm_number = '000001'.<BR> ls_items_in-po_itm_no = '000001'.<BR> ls_items_in-item_categ = 'ZCRM'.<BR> SELECT SINGLE meins INTO ls_items_in-target_qu<BR> FROM mara<BR> WHERE matnr = is_cost_order-matnr.<BR> APPEND ls_items_in TO lt_items_in.</STRONG></P>
<P><STRONG> ls_items_inx-itm_number = '000001'.<BR> ls_items_inx-item_categ = 'X'.<BR> ls_items_inx-po_itm_no = 'X'.<BR>* ls_items_inx-material = 'X'.<BR> ls_items_inx-mat_entrd = 'X'.<BR> ls_items_inx-target_qty = 'X'.<BR> ls_items_inx-target_qu = 'X'.<BR> ls_items_inx-updateflag = 'I'.<BR> APPEND ls_items_inx TO lt_items_inx.</STRONG></P>
<P><STRONG>* fill configuration<BR> ls_cfgs_ref-posex = '000001'.<BR> ls_cfgs_ref-config_id = '000001'.<BR> ls_cfgs_ref-root_id = '00000001'.<BR> APPEND ls_cfgs_ref TO lt_cfgs_ref.</STRONG></P>
<P><STRONG> ls_cfgs_value-config_id = '000001'.<BR> ls_cfgs_value-inst_id = '00000001'.</STRONG></P>
<P><STRONG> fill_prizn kod_prod 'KOD_PROD'.<BR> fill_prizn tlot_min 'TLOT_MIN'.<BR> fill_prizn tlot_max 'TLOT_MAX'.<BR> fill_prizn shot_min 'SHOT_MIN'.<BR> fill_prizn shot_max 'SHOT_MAX'.<BR> fill_prizn dlot_min 'DLOT_MIN'.<BR> fill_prizn dlot_max 'DLOT_MAX'.<BR> fill_prizn marka 'MARKA'.<BR> fill_prizn stndrt_marka 'STNDRT_MARKA'.<BR> fill_prizn stndrt_prod 'STNDRT_PROD'.<BR> fill_prizn tprk 'TPRK'.<BR> fill_prizn grot 'GROT'.<BR> fill_prizn vityazhka 'VITYAZHKA'.<BR> fill_prizn krom 'KROM'.<BR> fill_prizn chisl_st_pokr 'CHISL_ST_POKR'.<BR> fill_prizn kls_tol_pokr 'KLS_TOL_POKR'.<BR> fill_prizn proch_izg_t_lic_max 'PROCH_IZG_T_LIC_MAX'.<BR> fill_prizn priz_zasch_pov 'PRIZ_ZASCH_POV'.<BR> fill_prizn vid_pokr 'VID_POKR'.<BR> fill_prizn mark_pokr 'MARK_POKR'.<BR> fill_prizn mat_pokr_lic 'MAT_POKR_LIC'.<BR> fill_prizn plsk 'PLSK'.<BR> fill_prizn vid_postavki 'VID_POSTAVKI'.<BR> fill_prizn dressir 'DRESSIR'.<BR> fill_prizn travl 'TRAVL'.<BR> fill_prizn fsfr_min 'FSFR_MIN'.<BR> fill_prizn fsfr_max 'FSFR_MAX'.<BR> fill_prizn krmn_min 'KRMN_MIN'.<BR> fill_prizn krmn_max 'KRMN_MAX'.<BR> fill_prizn mrgn_min 'MRGN_MIN'.<BR> fill_prizn mrgn_max 'MRGN_MAX'.<BR> fill_prizn almn_min 'ALMN_MIN'.<BR> fill_prizn almn_max 'ALMN_MAX'.<BR> fill_prizn cugl_min 'CUGL_MIN'.<BR> fill_prizn cugl_max 'CUGL_MAX'.</STRONG></P>
<P><STRONG> ls_schedules_in-itm_number = '000001'.<BR>* ls_schedules_in-req_date = sy-datum.<BR> ls_schedules_in-sched_line = '0001'.<BR> ls_schedules_in-req_qty = '1'.<BR> APPEND ls_schedules_in TO lt_schedules_in.</STRONG></P>
<P><STRONG> ls_schedules_inx-itm_number = '000001'.<BR> ls_schedules_inx-sched_line = '0001'.<BR>* ls_schedules_inx-req_date = 'X'.<BR> ls_schedules_inx-req_qty = 'X'.<BR> ls_schedules_inx-updateflag = 'I'.<BR> APPEND ls_schedules_inx TO lt_schedules_inx.</STRONG></P>
<P><STRONG> ls_cfgs_partof-parent_id = '00000001'.<BR> ls_cfgs_partof-inst_id = '00000001'.<BR> ls_cfgs_partof-class_type = '300'.<BR> ls_cfgs_partof-obj_type = 'MARA'.<BR> ls_cfgs_partof-obj_key = is_cost_order-matnr.<BR> APPEND ls_cfgs_partof TO lt_cfgs_partof.</STRONG></P>
<P><STRONG> ls_cfgs_inst-config_id = '000001'.<BR> ls_cfgs_inst-inst_id = '00000001'.<BR> ls_cfgs_inst-obj_type = 'MARA'.<BR> ls_cfgs_inst-class_type = '300'.<BR> ls_cfgs_inst-obj_key = is_cost_order-matnr.<BR> APPEND ls_cfgs_inst TO lt_cfgs_inst.</STRONG></P>
<P><STRONG> CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'<BR> EXPORTING<BR> order_header_in = ls_header_in<BR> order_header_inx = ls_header_inx<BR>* testrun =<BR> IMPORTING<BR> salesdocument = lv_vbeln<BR> TABLES<BR> return = lt_return<BR> order_items_in = lt_items_in<BR> order_items_inx = lt_items_inx<BR> order_partners = lt_partners<BR> order_schedules_in = lt_schedules_in<BR> order_schedules_inx = lt_schedules_inx<BR> order_cfgs_ref = lt_cfgs_ref<BR> order_cfgs_inst = lt_cfgs_inst<BR> order_cfgs_part_of = lt_cfgs_partof<BR> order_cfgs_value = lt_cfgs_value<BR> .</STRONG></P>
<P><STRONG> READ TABLE lt_return TRANSPORTING NO FIELDS WITH KEY type = 'E'.<BR> IF sy-subrc = 0.<BR> CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'<BR> .<BR> ELSE.<BR> CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'<BR> EXPORTING<BR> wait = 'X'<BR> .<BR> ENDIF.</STRONG></P>
<P><STRONG>ENDFUNCTION.</STRONG></P>
<P><STRONG></STRONG> </P>
<P><STRONG></STRONG> </P> -
Error in Creating Sales Order Using BAPI_SALESORDER_CREATEFROMDAT2
Hi Everyone,
We have a requirement to create sales order from flat file using BAPI. Everything was working well until we encounter a customer with credit control limit setup.
Using the partners table for BAPi, the sold to customer is enter at header level, and we have this requirement to add the payer at item level. This is where the error is occuring. Upon debugging, I found out that the customer has a credit limit setup at FD33, and has a record found in KNKK, which is giving the error "Credit limit customer differs from credit limit customer in header".
However, duting manual creation of sales order via VA01, this error is not encountered.
Any ideas or suggesstions on how we can move forward with SO creation using BAPI with customers where credit management is setup?
Thanks,
LouisseIf thats not working..
try BAPI_SALESORDER_CREATEFROMDAT2
If BAPI is not working. try creating a bdc for the same if there's not error on trying from VA01 -
BAPI_SALESORDER_CREATEFROMDAT2 Error with profit center
Hello everyone,
I am using BAPI_SALESORDER_CREATEFROMDAT2 to create a sales order, but it is not being created. The return tab shows this:
S V4 233 SALES_HEADER_IN has been processed successfully
E KM 026 Profit center 2000/2000 does not exist for 08.04.2010
E V4 248 Error in SALES_ITEM_IN 000000
W V1 555 The sales document is not yet complete: Edit data
E V4 219 Sales document was not changed
I am exporting teh profit center like this:
it_items-profit_ctr = '2000'.
The strange thing about this is that when I create the sales order manually, using VA01 and the same parameters I am using in the BAPI, the sales order is created.
What am I doing wrong?
Thanks in advanceHi,
Welcome to SCN!!!
This looks like Profit center is not valid as on date. Please check with your functional whether this is the valid Profit center for you sales area and for the given date.
Thanks,
Vinod. -
BAPI_SALESORDER_CREATEFROMDAT2- Checking Group Error
Hi Friends,
I am creating order through BAPI_SALESORDER_CREATEFROMDAT2.. Its working fine .
One of the material dont maintained Checking group in the MRP view because this this not delivered to anyone. Item Category Maintained (ZNUL- No Sales order required).
While Creating order i am getting following messae (No Checking group is maintained fro product XXXXX , Plant XXXx in Matl Master).
Please let me know how to resolve or any parameter i need tp pass to avoid this error in the BAPI..
Thanks
Prabu KThanks Reddy..
Header : Order typer, Sales Org, Division, D.Channel and Reg Date
Item: Item number , Material
Partner : Partner Profile, Customer
Schedule line : Item Number and Qty.
I fell the issue in Customer only.. I tried same material with other customer its working fine.. For this we need to pass any parameter fro ATP Check realted in the BAPI fro avoiding that Error message and creating the order...
Please let me know if anything required..
Thanks
Prabu -
BAPI_SALESORDER_CREATEFROMDAT2 configure error information
hi every body:
I use BAPI_SALESORDER_CREATEFROMDAT2 to creat a SO ,when i need to configure it's item, the thing come out
"S V4 233
SALES_HEADER_IN has been processed successfully
A CU 013
Internal error: 10, 000010, NOT_ALL_INPUT_DATA_PROCESSED,
E V1 331
Item 000010 does not exist"
I don't know the reason,
I Have used 'va01' to creat one so and used
"BAPISDORDER_GETDETAILEDLIST" get the corresponding configure parameters,
I don't know the reasn now.hi, i post my main code ,
DEFINE fill_upd.
if &1 ne space.
&2 = 'X'.
endif.
END-OF-DEFINITION.
DEFINE convert_matnr.
call function 'CONVERSION_EXIT_MATN1_INPUT'
exporting
input = &1
importing
output = &1
exceptions
length_error = 1
others = 2.
if sy-subrc <> 0.
message e398 with 'transfer error'.
endif.
END-OF-DEFINITION.
the header
wa_order_header_in-doc_type = doc_type.
CALL FUNCTION 'CONVERSION_EXIT_AUART_INPUT'
EXPORTING
input = wa_order_header_in-doc_type
IMPORTING
output = wa_order_header_in-doc_type.
fill_upd wa_order_header_in-doc_type wa_order_header_inx-doc_type.
wa_order_header_in-sales_org = sales_or.
fill_upd wa_order_header_in-sales_org wa_order_header_inx-sales_org.
wa_order_header_in-distr_chan = distr_ch.
fill_upd wa_order_header_in-distr_chan wa_order_header_inx-distr_chan.
wa_order_header_in-division = division.
fill_upd wa_order_header_in-division wa_order_header_inx-division.
wa_order_header_in-req_date_h = sy-datum.
fill_upd wa_order_header_in-req_date_h wa_order_header_inx-req_date_h.
wa_order_header_in-date_type = '1'.
fill_upd wa_order_header_in-date_type wa_order_header_inx-date_type.
wa_order_header_in-purch_no_c = '1234567'.
fill_upd wa_order_header_in-purch_no_c wa_order_header_inx-purch_no_c.
wa_order_header_in-ord_reason = ord_reas.
fill_upd wa_order_header_in-ord_reason wa_order_header_inx-ord_reason.
the item
wa_order_items_in-material = material.
convert_matnr wa_order_items_in-material.
fill_upd wa_order_items_in-material wa_order_items_inx-material.
wa_order_items_in-short_text = maktx.
fill_upd wa_order_items_in-short_text wa_order_items_inx-short_text.
wa_order_items_in-target_qty = '2'.
fill_upd wa_order_items_in-target_qty wa_order_items_inx-target_qty.
wa_order_items_in-target_qu = target_q. "
fill_upd wa_order_items_in-target_qu wa_order_items_inx-target_qu.
wa_order_items_in-po_itm_no = '000010'.
fill_upd wa_order_items_in-po_itm_no wa_order_items_inx-po_itm_no.
wa_order_items_in-target_qty = '1'.
APPEND wa_order_items_in TO i_order_items_in.
APPEND wa_order_items_inx TO i_order_items_inx.
wa_order_partners-partn_role = 'AG'.
wa_order_partners-partn_numb = sp.
APPEND wa_order_partners TO i_order_partners.
wa_order_partners-partn_role = 'WE'.
wa_order_partners-partn_numb = sh.
APPEND wa_order_partners TO i_order_partners.
wa_order_schedules_in-itm_number = 10.
wa_order_schedules_inx-itm_number = 10.
wa_order_schedules_in-req_date = sy-datum.
fill_upd wa_order_schedules_in-req_date
wa_order_schedules_inx-req_date.
wa_order_schedules_in-req_qty = '2'.
fill_upd wa_order_schedules_in-req_qty
wa_order_schedules_inx-req_qty.
APPEND wa_order_schedules_inx TO i_order_schedules_inx.
APPEND wa_order_schedules_in TO i_order_schedules_in.
wa_order_conditions_in-itm_number = 10.
wa_order_conditions_inx-itm_number = 10.
wa_order_conditions_in-cond_type = cond_ty.
wa_order_conditions_inx-cond_type = cond_ty.
wa_order_conditions_in-applicatio = 'V'. "Application
wa_order_conditions_in-condorigin = 'C'. "Condit.origin
wa_order_conditions_in-condclass = 'B'. "Condition class
Calculation type for condition
wa_order_conditions_in-calctypcon = 'C'.
*Condition control Changed manually
wa_order_conditions_in-condcntrl = 'C'.
wa_order_conditions_in-condchaman = 'X'. "Changed manual
wa_order_conditions_in-cond_value = cond_v.
fill_upd wa_order_conditions_in-cond_value
wa_order_conditions_inx-cond_value.
wa_order_conditions_in-currency = currency.
fill_upd wa_order_conditions_in-currency
wa_order_conditions_inx-currency.
wa_order_conditions_in-cond_p_unt = '1'.
fill_upd wa_order_conditions_in-cond_p_unt
wa_order_conditions_inx-cond_p_unt.
wa_order_conditions_in-cond_unit = target_q.
fill_upd wa_order_conditions_in-cond_unit
wa_order_conditions_inx-cond_unit.
*for later ersion
WA_ORDER_CONDITIONS_IN-ACCOUNTKEY = 'ERL'.
wa_order_conditions_inx-updateflag = 'U'.
APPEND wa_order_conditions_inx TO i_order_conditions_inx.
APPEND wa_order_conditions_in TO i_order_conditions_in.
WA_ORDER_CFGS_REF-POSEX = WA_ORDER_ITEMS_IN-PO_ITM_NO.
wa_order_cfgs_ref-posex = '000010'.
wa_order_cfgs_ref-config_id = '000001'.
wa_order_cfgs_ref-root_id = '00000001'.
APPEND wa_order_cfgs_ref TO i_order_cfgs_ref.
wa_order_cfgs_inst-config_id = '000001'.
wa_order_cfgs_inst-inst_id = '00000001'.
wa_order_cfgs_inst-obj_type = 'MARA'.
wa_order_cfgs_inst-class_type = '300'.
wa_order_cfgs_inst-obj_key = material.
APPEND wa_order_cfgs_inst TO i_order_cfgs_inst.
wa_order_cfgs_part_of-config_id = '000001'.
wa_order_cfgs_part_of-parent_id = '000001'.
wa_order_cfgs_part_of-inst_id = '000001'.
wa_order_cfgs_part_of-part_of_no = '000001'.
APPEND wa_order_cfgs_part_of TO i_order_cfgs_part_of.
wa_order_cfgs_value-config_id = '000001'.
wa_order_cfgs_value-inst_id = '00000001'.
wa_order_cfgs_value-charc = 'Z_DEMO_BP'.
wa_order_cfgs_value-value = '01'.
APPEND wa_order_cfgs_value TO i_order_cfgs_value.
wa_order_cfgs_value-config_id = '000001'.
wa_order_cfgs_value-inst_id = '00000001'.
wa_order_cfgs_value-charc = 'Z_DEMO_CBR'.
wa_order_cfgs_value-value = '2005.11.03'.
APPEND wa_order_cfgs_value TO i_order_cfgs_value.
wa_order_cfgs_value-config_id = '000001'.
wa_order_cfgs_value-inst_id = '00000001'.
wa_order_cfgs_value-charc = 'Z_DEMO_DL'.
wa_order_cfgs_value-value = '02'.
APPEND wa_order_cfgs_value TO i_order_cfgs_value.
wa_order_cfgs_value-config_id = '000001'.
wa_order_cfgs_value-inst_id = '00000001'.
wa_order_cfgs_value-charc = 'Z_DEMO_DY'.
wa_order_cfgs_value-value = '01'.
APPEND wa_order_cfgs_value TO i_order_cfgs_value. -
BAPI_SALESORDER_CREATEFROMDAT2 error
Hi all,
While creating the sales order using BAPI - BAPI_SALESORDER_CREATEFROMDAT2
got the following error message
"Material is not defined for sales org., distr.chan., language EN"
Any suggestion welcome,
Thanks ,thanks for reply,
I checked that material in table mvke for sales org and disti channel and that material exist .
If i execute that BAPI from se37 using same paramaters then it successfully creates the Sales order.
But in report got the following error message.
Any suggestions welcome,
Regards, -
Error BAPI_SALESORDER_CREATEFROMDAT2
hi..........
error in uploading item details.
can you guide me how to upload item details using BAPI_SALESORDER_CREATEFROMDAT2 method........
thanks & regards
prabhakar
Edited by: Prabhakar on Mar 25, 2010 5:33 PMTry this:
REPORT z_bapi_create_sales_order_test .
Order header:
- Order type: OR Important you must use the german code TA
- Sales org: 1000
- Distrb. chan.: 10
- Division: 00
- Sold to party: 1032
- Ship to party: 1032
- Purch order: DG-19970626-3
Order item:
- Material: P-100
- Qty: 1
DATA:
Order partners
li_order_partners TYPE STANDARD TABLE OF bapiparnr,
l_order_partners LIKE bapiparnr,
Structures for order header
l_order_header_in LIKE bapisdhd1,
l_order_header_inx LIKE bapisdhd1x,
Tables for order items
li_order_items_in TYPE STANDARD TABLE OF bapisditm,
l_order_items_in LIKE bapisditm,
li_order_items_inx TYPE STANDARD TABLE OF bapisditmx,
l_order_items_inx LIKE bapisditmx,
Return table from bapi call
li_return TYPE STANDARD TABLE OF bapiret2,
l_return TYPE bapiret2,
Sales document number
l_vbeln LIKE bapivbeln-vbeln,
Error flag
l_errflag(1) TYPE c.
START-OF-SELECTION.
Build partner information
CLEAR l_order_partners.
l_order_partners-partn_role = 'AG'. "Remember German codes !
l_order_partners-partn_numb = '0000001032'.
APPEND l_order_partners TO li_order_partners.
Build order header
Update flag
l_order_header_inx-updateflag = 'I'.
Sales document type
l_order_header_in-doc_type = 'TA'. "Remember German codes !
l_order_header_inx-doc_type = 'X'.
Sales organization
l_order_header_in-sales_org = '1000'.
l_order_header_inx-sales_org = 'X'.
Distribution channel
l_order_header_in-distr_chan = '10'.
l_order_header_inx-distr_chan = 'X'.
Division
l_order_header_in-division = '00'.
l_order_header_inx-division = 'X'.
Purchase order
l_order_header_in-purch_no_c = 'DG-19970626-300'.
l_order_header_inx-purch_no_c = 'X'.
Build order item(s) - Only 1 is used in this example
l_order_items_in-itm_number = '10'.
l_order_items_inx-itm_number = '10'.
l_order_items_in-material = 'P-100'.
l_order_items_inx-material = 'X'.
l_order_items_in-comp_quant = '1.000'.
l_order_items_inx-comp_quant = 'X'.
APPEND l_order_items_in TO li_order_items_in.
l_order_items_inx-updateflag = 'I'.
APPEND l_order_items_inx TO li_order_items_inx.
CALL Bapi
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
order_header_in = l_order_header_in
order_header_inx = l_order_header_inx
testrun = 'X'
IMPORTING
salesdocument = l_vbeln
TABLES
return = li_return
order_items_in = li_order_items_in
order_items_inx = li_order_items_inx
order_partners = li_order_partners.
END-OF-SELECTION.
Check and write Return table
CLEAR l_errflag.
WRITE: / 'Sales dcoument: ', l_vbeln.
LOOP AT li_return INTO l_return.
WRITE: / l_return-type, l_return-message(50).
IF l_return-type = 'E'.
l_errflag = 'X'.
ENDIF.
ENDLOOP.
No errors - Commit
IF l_errflag IS INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ENDIF. -
BAPI_SALESORDER_CREATEFROMDAT2 Error "Address category does not exist"
Hello everyone,
I have the following error "Address category does not exist" when executing bapi "BAPI_SALESORDER_CREATEFROMDAT2" from a user application, the error is not constant, meaning sometimes shows and sometimes does not, I´ve been investigatnig regarding this and it seems to be a buffer problem, found SAP Note "1232196 - Inexplicable error in BAPI" and implemented FM "SD_SALES_DOCUMENT_INIT." as solution described, but it's still not working, does anyone faced this problem before that could help me out?
Thanks in advance for your replies.
Regards,
Julio CesarHi julio,
I guess this error occurs due to some pre configuration issue with the value by which your creating the sales order. Have you tried creating sales order with any other value or with just header data.
Regards,
sivaganesh -
"BAPI_SALESORDER_CREATEFROMDAT2" - getting error while executing in se37.
Hi All,
I am executing BAPI -("BAPI_SALESORDER_CREATEFROMDAT2") in SE37 and getting error - "Unpermitted combination of business object BUS2032 and sales doc. category 0".
I passed SD_Doc_Cat - 'C'.
Please suggest, where should i correct.
Regards,
Chessleo.
Edited by: chessleo on May 21, 2011 12:46 PMHi,
Passing values in BAPI :
_Header data :_
REFDOCTYPE ZGK
DOC_TYPE ZRPS
SALES_ORG PGBU
DISTR_CHAN PG
DIVISION PG
REQ_DATE_H 05/10/2010
PURCH_NO_C 123456 "Fixed values
PO_DAT_S 05/21/2011 "Fixed values
SD_DOC_CAT C
REF_DOC P057
COMP_CDE_B W001
REFDOC_CAT 0.
_Item data :_
ITM_NUM MATERIAL TARGET_QTY SHORT_TEXT SAL
100 R-I UNSP MAJ COMP 15 TESTING1 EA
200 R-I UNSP MAJ COMP 16 TESTING1 EA
Partners Data :
PA PARTN_NUMB
SP 603424
SH 200530
Purchase order no and date - Fixed values
Please find the passing values.
Regards
chessleo.
Edited by: chessleo on May 26, 2011 10:29 AM -
Error when using BAPI_SALESORDER_CREATEFROMDAT2...
Hello Experts,
I am encountering this error: "Target unit of measure BT is not defined in item
000010 for material 115282". I checked in material master and its UOM is BT. What I'm
concerned is that some SKUs which are included in the upload file also has a UOM of BT(bottle)
so I am wondering on why some materials are having this error.
Hope you can help me guys. Thank you and take care!Hi dude,
The target UOM for that particular item is not showing up and the UOM 'BT' is supposed to be thee. Also,when you check MARA for that particular item it is showing up as 'BT'.U wanted to know,why it is nt showing on your case?
Is this ur query?
If yes,check from which table the values for target UOM is fetched in your case.If it is not going to be MARA,then this particular field value would not be updated , this is the cause I suppose.
Share with me what is right?
R U encountering this situ. in a report?
Regards,
Lakshmanan
Maybe you are looking for
-
Microphone problem on Windows XP running on Macbook Pro
I just bought a Macbook Pro with a built-in Realtek HD audio card, and I have a problem using the microphone on the Windows side (I've installed via Bootcamp a Windows XP Home edition service pack 2). For some reason Windows doesn't recognise the mic
-
2nd Gen iPod shuffle is not recognized by iTunes or computer
I read the other posts about people's 2nd Gen Ipod shuffles not being rcognized by iTunes or their computer, but none of them seemed to fit. I have had my iPod shuffle for less than a week. Last time I had my iPod connected to iTunes in the "Settings
-
Swipe experience..Now I need to either send it to be fixed or exchange my phone
I had a problem connecting to the link yesterday and after trying to get the link to work I lost most of my data on the z10. My deleting the link and reinstalling didn't work and the restore function went to 100% on the desktop and wouldn't finish o
-
Hi I have a alv grid display. when i run the report in background, i am able to see that a spool number is generated but i dont know how to check whether what is inside the spool is same as in ALV.
-
To change Account assinment category to the open orders
Hi, We need to change the GL account assinged existing Account assignment category which is assinged to the sales order. Our Acc ***. catergory X goes to GL 101000 I will create a new Acc Assi catergory Y and it will go to the new GL account 102000.