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-&amp;1 IS NOT INITIAL.<BR>      CLEAR: ls_cfgs_value-charc,<BR>             ls_cfgs_value-value.<BR>      ls_cfgs_value-charc = &amp;2.<BR>      ls_cfgs_value-value = is_cost_order-&amp;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>

Similar Messages

  • 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,
    Louisse

    If 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

  • Getting error when creat sales order and Stock Posting

    Hi
    I have created enterprise structure, xd01, mm01, ovkk but I count't post stock.
    When create sales order getting error is that
    1.This material is not defined for sales area 1000, 10, 00.
    And if i use this T.Code MB1C,
    2. Parameters for plant 1000 not maintained in Inventory Mgt.,
    *3. Unit *** is not created in language EN.*
    Thanks in advance

    Dear selvi sankaran
    1)  Compare the sales organization, distribution channel and division of customer and material.  In your case, either of that should have been created differently.  Maintain the same sales area and retry
    2)  Go to omi8 and maintain the required parameters to your plant
    3)  Go to Material Master, select "Additional data" and click on "Descriptions".  There maintain "EN" under language.
    thanks
    G. Lakshmipathi

  • PS Project description when creating sales order using BAPI

    I am trying to create sales orders using BAPI_SALESORDER_CREATE_FROMDAT2.
    Because of the material configuration in table TCN61 the material will trigger a project creation in the project system.
    Now, in order to create a project, we must provide the project description.
    I would like to ask you if anyone knows how to pass the project description in one of the BAPI parameters.
    Thank you for your help.

    Thank you Sreedhar for the answer.
    I tried the CAMPAIGN field but did not work...
    In fact, I am not able to find a field, in any of the of the tables, that could hold the project description (PROJ-POST1).
    An entry is created in PROJ table when we manually create a sales order for materials specified in table TCN61.
    Thanks.

  • Error while creating sales order using SD_SALESDOCUMENT_CREATE

    Hello All,
    We are using to  SD_SALESDOCUMENT_CREATE function module to create sales order it is working fine for single material.
    When we try to create sales order with multiple matearials we ended up with the following errors
    SALES_HEADER_IN has been processed successfully
    000000
    VBAKKOM
    Internal error in communication between configuration and sales doc.CONFIGURATION_PROCESSING
    000000
    CONFIGURATION_PROCESSING
    Error in SALES_ITEM_IN 000010
    000000
    VBAPKOM
    Internal error in communication between configuration and sales doc.CONFIGURATION_PROCESSING
    000000
    CONFIGURATION_PROCESSING
    Error in SALES_ITEM_IN 000020
    000000
    VBAPKOM
    SALES_ITEM_IN has been processed successfully
    000000
    VBAPKOM
    Could any one help me out to resolve this issue.
    Thanks in advance....
    Cheers,
    Harsha

    Hello,
    Looking at BAPI errors. It looks like you are trying to create sales order with variant configuration.
    Check Below SAP Note.
    900380 - Configurable items in the SD process (idocs & bapis)
    Regards,
    Sameer

  • ERROR IN CREATING SALES ORDER,USING IDOC TYPE ORDERS05

    I am using exit to write my code for creating sales order of IDOC Type ORDERS05 and order type ZDRX.
    IF I proceess the Idoc in background each time error message comes
    FIELD kuwev-kunnr(ship to party)is not an input field.
    but if i run in foreground in debugging mode,sales order is getting created..
    please suggest something.

    If 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

  • Dump Error when creating sales order

    Dear Friends,
    When I am creating sales order after entering order quantity field value in item table giving dump error.
    INCLUDE LV03VF0B.
    INCLUDE LV03VFB4 inside below code trigger error.
    PERFORM VVBBD_AUFBAUEN USING WA_AVBBD
                                        WA_AVBBD-APOMOBILE
                                        DA_SUBRC
                                        DA_UPDKZ
                                        DA_VVBBD_TABIX
                                        0.

    Hello Praveen,
    checked this program in other systems.
    The weird thing in your code is the final parameter 0, it should not be there.
    The call should be:
    PERFORM VVBBD_AUFBAUEN USING WA_AVBBD
                                        WA_AVBBD-APOMOBILE
                                        DA_SUBRC
                                        DA_UPDKZ
                                        DA_VVBBD_TABIX.
    Hope it helps.

  • Error While Creating Sales Order Using OE_ORDER_PUB.PROCESS_ORDER

    Hi All,
    I am trying to create a sales order using oe_order_pub.process_order api..
    The Procedure i had written is as follows.
    CREATE OR REPLACE PROCEDURE TEST_PROC
    AS
    x_return_status VARCHAR2(250);
    x_msg_count NUMBER;
    x_msg_data VARCHAR2(250);
    F varchar2(2000);
    --out parameters
    x_header_rec OE_Order_PUB.Header_Rec_Type;
    x_header_val_rec OE_Order_PUB.Header_Val_Rec_Type;
    x_Header_Adj_tbl OE_Order_PUB.Header_Adj_Tbl_Type;
    x_Header_Adj_val_tbl OE_Order_PUB.Header_Adj_Val_Tbl_Type;
    x_Header_price_Att_tbl OE_Order_PUB.Header_Price_Att_Tbl_Type;
    x_Header_Adj_Att_tbl OE_Order_PUB.Header_Adj_Att_Tbl_Type;
    x_Header_Adj_Assoc_tbl OE_Order_PUB.Header_Adj_Assoc_Tbl_Type;
    x_Header_Scredit_tbl OE_Order_PUB.Header_Scredit_Tbl_Type;
    x_Header_Scredit_val_tbl OE_Order_PUB.Header_Scredit_Val_Tbl_Type;
    x_line_tbl OE_Order_PUB.Line_Tbl_Type;
    x_line_val_tbl OE_Order_PUB.Line_Val_Tbl_Type;
    x_Line_Adj_tbl OE_Order_PUB.Line_Adj_Tbl_Type;
    x_Line_Adj_val_tbl OE_Order_PUB.Line_Adj_Val_Tbl_Type;
    x_Line_price_Att_tbl OE_Order_PUB.Line_Price_Att_Tbl_Type;
    x_Line_Adj_Att_tbl OE_Order_PUB.Line_Adj_Att_Tbl_Type;
    x_Line_Adj_Assoc_tbl OE_Order_PUB.Line_Adj_Assoc_Tbl_Type;
    x_Line_Scredit_tbl OE_Order_PUB.Line_Scredit_Tbl_Type;
    x_Line_Scredit_val_tbl OE_Order_PUB.Line_Scredit_Val_Tbl_Type;
    x_Lot_Serial_tbl OE_Order_PUB.Lot_Serial_Tbl_Type;
    x_Lot_Serial_val_tbl OE_Order_PUB.Lot_Serial_Val_Tbl_Type;
    x_action_request_tbl OE_Order_PUB.Request_Tbl_Type;
    --in parameters
    l_header_rec OE_Order_PUB.Header_Rec_Type;
    t_line_tbl OE_ORDER_PUB.Line_Tbl_Type;
    BEGIN
    apps.mo_global.set_org_context(204,null,'ONT');
    l_header_rec := OE_ORDER_PUB.G_MISS_HEADER_REC;
    l_header_rec.ORG_ID := 204;
    l_header_rec.ORDER_TYPE_ID := 1437;
    l_header_rec.SOLD_TO_ORG_ID := 1290;
    l_header_rec.SHIP_TO_ORG_ID:=1425;
    l_header_rec.INVOICE_TO_ORG_ID:=1424;
    l_header_rec.PRICE_LIST_ID := 1000;
    l_header_rec.salesrep_id := 1006;
    l_header_rec.ORDER_CATEGORY_CODE := 'MIXED';
    l_header_rec.VERSION_NUMBER := 0;
    l_header_rec.OPEN_FLAG := 'Y';
    l_header_rec.BOOKED_FLAG := 'Y';
    l_header_rec.PRICING_DATE := sysdate;
    l_header_rec.TRANSACTIONAL_CURR_CODE := 'USD';
    l_header_rec.created_by := FND_GLOBAL.USER_ID;
    l_header_rec.creation_date := sysdate;
    l_header_rec.LAST_UPDATED_BY := FND_GLOBAL.USER_ID;
    l_header_rec.LAST_UPDATE_DATE := sysdate;
    l_header_rec.attribute1 := '250';
    l_header_rec.operation := 'CREATE';
    t_line_tbl(1) := OE_ORDER_PUB.G_MISS_LINE_REC; ---check
    t_line_tbl(1).inventory_item_id := 193742;
    t_line_tbl(1).ordered_quantity := 1;
    t_line_tbl(1).operation := 'CREATE';
    oe_debug_pub.initialize;
    --oe_debug_pub.SetDebugLevel(1);
    OE_MSG_PUB.INITIALIZE();
    OE_Order_PUB.Process_Order
    ( -- p_org_id =>          204,
    --p_operating_unit                =>          'ONT',
    p_api_version_number =>          1.0,
    p_init_msg_list =>          FND_API.G_TRUE,
    p_return_values =>          FND_API.G_TRUE,
    p_action_commit =>          FND_API.G_TRUE,
    x_return_status =>          x_return_status,
    x_msg_count =>          x_msg_count,
    x_msg_data =>          x_msg_data,
    p_header_rec =>          l_header_rec,
    p_old_header_rec =>          OE_Order_PUB.G_MISS_HEADER_REC,
    p_header_val_rec =>          OE_Order_PUB.G_MISS_HEADER_VAL_REC,
    p_old_header_val_rec =>          OE_Order_PUB.G_MISS_HEADER_VAL_REC,
    p_Header_Adj_tbl =>          OE_Order_PUB.G_MISS_HEADER_ADJ_TBL,
    p_old_Header_Adj_tbl =>          OE_Order_PUB.G_MISS_HEADER_ADJ_TBL,
    p_Header_Adj_val_tbl =>          OE_Order_PUB.G_MISS_HEADER_ADJ_VAL_TBL,
    p_old_Header_Adj_val_tbl =>          OE_Order_PUB.G_MISS_HEADER_ADJ_VAL_TBL,
    p_Header_price_Att_tbl =>          OE_Order_PUB.G_MISS_HEADER_PRICE_ATT_TBL,
    p_old_Header_Price_Att_tbl =>          OE_Order_PUB.G_MISS_HEADER_PRICE_ATT_TBL,
    p_Header_Adj_Att_tbl =>          OE_Order_PUB.G_MISS_HEADER_ADJ_ATT_TBL,
    p_old_Header_Adj_Att_tbl =>          OE_Order_PUB.G_MISS_HEADER_ADJ_ATT_TBL,
    p_Header_Adj_Assoc_tbl =>          OE_Order_PUB.G_MISS_HEADER_ADJ_ASSOC_TBL,
    p_old_Header_Adj_Assoc_tbl =>          OE_Order_PUB.G_MISS_HEADER_ADJ_ASSOC_TBL,
    p_Header_Scredit_tbl =>          OE_Order_PUB.G_MISS_HEADER_SCREDIT_TBL,
    p_old_Header_Scredit_tbl =>          OE_Order_PUB.G_MISS_HEADER_SCREDIT_TBL,
    p_Header_Scredit_val_tbl =>          OE_Order_PUB.G_MISS_HEADER_SCREDIT_VAL_TBL,
    p_old_Header_Scredit_val_tbl =>          OE_Order_PUB.G_MISS_HEADER_SCREDIT_VAL_TBL,
    p_line_tbl =>          t_line_tbl,
    p_old_line_tbl =>          OE_Order_PUB.G_MISS_LINE_TBL,
    p_line_val_tbl =>          OE_Order_PUB.G_MISS_LINE_VAL_TBL,
    p_old_line_val_tbl =>          OE_Order_PUB.G_MISS_LINE_VAL_TBL,
    p_Line_Adj_tbl =>          OE_Order_PUB.G_MISS_LINE_ADJ_TBL,
    p_old_Line_Adj_tbl =>          OE_Order_PUB.G_MISS_LINE_ADJ_TBL,
    p_Line_Adj_val_tbl =>          OE_Order_PUB.G_MISS_LINE_ADJ_VAL_TBL,
    p_old_Line_Adj_val_tbl =>          OE_Order_PUB.G_MISS_LINE_ADJ_VAL_TBL,
    p_Line_price_Att_tbl =>          OE_Order_PUB.G_MISS_LINE_PRICE_ATT_TBL,
    p_old_Line_Price_Att_tbl =>          OE_Order_PUB.G_MISS_LINE_PRICE_ATT_TBL,
    p_Line_Adj_Att_tbl =>          OE_Order_PUB.G_MISS_LINE_ADJ_ATT_TBL,
    p_old_Line_Adj_Att_tbl =>          OE_Order_PUB.G_MISS_LINE_ADJ_ATT_TBL,
    p_Line_Adj_Assoc_tbl =>          OE_Order_PUB.G_MISS_LINE_ADJ_ASSOC_TBL,
    p_old_Line_Adj_Assoc_tbl =>          OE_Order_PUB.G_MISS_LINE_ADJ_ASSOC_TBL,
    p_Line_Scredit_tbl =>          OE_Order_PUB.G_MISS_LINE_SCREDIT_TBL,
    p_old_Line_Scredit_tbl =>          OE_Order_PUB.G_MISS_LINE_SCREDIT_TBL,
    p_Line_Scredit_val_tbl =>          OE_Order_PUB.G_MISS_LINE_SCREDIT_VAL_TBL,
    p_old_Line_Scredit_val_tbl =>          OE_Order_PUB.G_MISS_LINE_SCREDIT_VAL_TBL,
    p_Lot_Serial_tbl =>          OE_Order_PUB.G_MISS_LOT_SERIAL_TBL,
    p_old_Lot_Serial_tbl =>          OE_Order_PUB.G_MISS_LOT_SERIAL_TBL,
    p_Lot_Serial_val_tbl =>          OE_Order_PUB.G_MISS_LOT_SERIAL_VAL_TBL,
    p_old_Lot_Serial_val_tbl =>          OE_Order_PUB.G_MISS_LOT_SERIAL_VAL_TBL,
    p_action_request_tbl     =>          OE_Order_PUB.G_MISS_REQUEST_TBL,
    x_header_rec =>          x_header_rec,
    x_header_val_rec =>          x_header_val_rec,
    x_Header_Adj_tbl =>          x_Header_Adj_tbl,
    x_Header_Adj_val_tbl =>          x_Header_Adj_val_tbl,
    x_Header_price_Att_tbl =>          x_Header_price_Att_tbl,
    x_Header_Adj_Att_tbl =>          x_Header_Adj_Att_tbl,
    x_Header_Adj_Assoc_tbl =>          x_Header_Adj_Assoc_tbl,
    x_Header_Scredit_tbl =>          x_Header_Scredit_tbl,
    x_Header_Scredit_val_tbl =>          x_Header_Scredit_val_tbl,
    x_line_tbl =>          x_line_tbl,
    x_line_val_tbl =>          x_line_val_tbl,
    x_Line_Adj_tbl =>          x_Line_Adj_tbl,
    x_Line_Adj_val_tbl =>          x_Line_Adj_val_tbl,
    x_Line_price_Att_tbl =>          x_Line_price_Att_tbl,
    x_Line_Adj_Att_tbl =>          x_Line_Adj_Att_tbl,
    x_Line_Adj_Assoc_tbl =>          x_Line_Adj_Assoc_tbl,
    x_Line_Scredit_tbl =>          x_Line_Scredit_tbl,
    x_Line_Scredit_val_tbl =>          x_Line_Scredit_val_tbl,
    x_Lot_Serial_tbl =>          x_Lot_Serial_tbl,
    x_Lot_Serial_val_tbl =>          x_Lot_Serial_val_tbl,
    x_action_request_tbl     =>          x_action_request_tbl,
    --For bug 3390458
    p_rtrim_data => 'N',
    p_validate_desc_flex => 'Y' -- bug4343612
    COMMIT;
    if x_msg_count > 0 then
    for l_index in 1..x_msg_count loop
    x_msg_data := oe_msg_pub.get(p_msg_index => l_index, p_encoded => F);
    PRINT('x_msg_data: '||x_msg_data);
    end loop;
    end if;
    -- Check the return status
    if x_return_status = FND_API.G_RET_STS_SUCCESS then
    PRINT('success');
    else
    PRINT('failure');
    end if;
    PRINT('x_return_status: '||x_return_status);
    PRINT('x_msg_count: '||x_msg_count);
    PRINT('x_msg_data: '||x_msg_data);
    PRINT('x_header_val_rec: '||x_header_val_rec.accounting_rule);
    PRINT('x_header_rec header_id: ' ||x_header_rec.header_id);
    PRINT('x_header_rec order_number: ' ||x_header_rec.order_number);
    PRINT('x_header_rec ship_to_org_id: ' ||x_header_rec.ship_to_org_id);
    PRINT('x_header_rec payment_term_id: ' ||x_header_rec.payment_term_id);
    PRINT('x_header_rec order_source_id: ' ||x_header_rec.order_source_id);
    PRINT('x_header_rec order_type_id: ' ||x_header_rec.order_type_id);
    PRINT('x_header_rec price_list_id: ' ||x_header_rec.price_list_id);
    PRINT('x_header_rec invoicing_rule_id: ' ||x_header_rec.invoicing_rule_id);
    PRINT('x_header_rec accounting_rule_id: ' ||x_header_rec.accounting_rule_id);
    PRINT('x_header_rec org_id: ' ||x_header_rec.org_id);
    PRINT('x_header_rec sold_to_org_id: ' ||x_header_rec.sold_to_org_id);
    PRINT('x_header_rec invoice_to_org_id: ' ||x_header_rec.invoice_to_org_id);
    PRINT('x_header_rec salesrep_id: ' ||x_header_rec.salesrep_id);
    PRINT('x_header_rec invoice_to_org_id: ' ||x_header_rec.invoice_to_org_id);
    PRINT('x_header_rec operation: ' ||x_header_rec.operation);
    PRINT('x_header_rec transactional_curr_code: ' ||x_header_rec.transactional_curr_code);
    PRINT('x_header_rec orig_sys_document_ref: ' ||x_header_rec.orig_sys_document_ref);
    PRINT('x_header_rec request_date: ' ||x_header_rec.request_date);
    PRINT('x_header_rec conversion_rate_date: ' ||x_header_rec.conversion_rate_date);
    PRINT('x_header_rec last_update_date: ' ||x_header_rec.last_update_date);
    PRINT('x_header_rec ordered_date: ' ||x_header_rec.ordered_date);
    PRINT('x_header_rec creation_date: ' ||x_header_rec.creation_date);
    PRINT('x_header_rec created_by: ' ||x_header_rec.created_by);
    END;
    It is throwing the following Error.
    SQL> exec TEST_PROC;
    x_msg_data: ORA-01403: no data found in Package OE_ORDER_WF_UTIL Procedure
    Create_HdrWorkItem
    x_msg_data: User-Defined Exception in Package OE_ORDER_WF_UTIL Procedure
    Start_HdrProcess
    failure
    x_return_status: U
    x_msg_count: 2
    x_msg_data: User-Defined Exception in Package OE_ORDER_WF_UTIL Procedure
    Start_HdrProcess
    x_header_val_rec: Immediate
    x_header_rec header_id: 156408
    x_header_rec order_number: 64097
    x_header_rec ship_to_org_id: 1425
    x_header_rec payment_term_id: 4
    x_header_rec order_source_id: 0
    x_header_rec order_type_id: 1437
    x_header_rec price_list_id: 1000
    x_header_rec invoicing_rule_id: -2
    x_header_rec accounting_rule_id: 1
    x_header_rec org_id: 204
    x_header_rec sold_to_org_id: 1290
    x_header_rec invoice_to_org_id: 1424
    x_header_rec salesrep_id: 1006
    x_header_rec invoice_to_org_id: 1424
    x_header_rec operation: CREATE
    x_header_rec transactional_curr_code: USD
    x_header_rec orig_sys_document_ref: OE_ORDER_HEADERS_ALL156408
    x_header_rec request_date: 02-APR-09
    x_header_rec conversion_rate_date:
    x_header_rec last_update_date: 02-APR-09
    x_header_rec ordered_date: 02-APR-09
    x_header_rec creation_date: 02-APR-09
    x_header_rec created_by: 13615
    Any help on this would be appreciated.
    I am using R12..

    Pl see if MOS Doc 117313.1 (Booking Order from Order Capture Errors at OE_ORDER_WF_UTIL) can help
    HTH
    Srini

  • Getting Error when creating sales order

    Hello expert,
    When i ma creating sales order In productive environment, not getting any error.
    While creating sales order in Quality system The Error is"Order Type ZSOS has not defined in sales area 0201,02.00.
    I checked customizing and both the system Quality and Productive system having following configuration and that is identical.
    Combine sales Org
    Sales Org                              Ref Sales org
    0201                                        Blank
    Combine Distribution Channel
    Sales Org                 D.Channel            Ref dist Channel
    0201                            02                            02
    Combine Division
    Sales org             Division            Ref Divison
    0201                      10                      00
    Assign permitted order type to he sales areas.
    Ref Sales org         Ref Distribution              Ref Division   Sales doc type
    0201                        02                                   00                     ZSOS
    Please can anyone assist me where we are missing.
    Regards
    Ajit jaiswal

    Hi Ajit,
    you have to make these assignments in img
    Combine sales organizations(ova0)
    Combine distribution channels(ovam)
    Combine divisions(ovan)
    Assign sales order types permitted for sales areas(ovaz)
    after these assignments the mentionwed error will be resolved
    Revert if helpful
    Mohit Singh

  • Creating Sales Order using BAPI_SALESORDER_CREATEFROMDAT2

    Hi All,
    I am having problem while creating a SO using the BAPI_SALESORDER_CREATEFROMDAT2, Its returning sales documnet type is not defined. I used to get the error to speciy the ship to party or sold party earlier that has been resloved now I am getting the above specifed error.
    Please help me its very urgent
    Thanks,
    Suma

    Hi Suma
    While populating data for Sales Order Creation, populate PARTNER table with Sold-To or Ship-To as per you business process.
    Minimum two fields are to the fields for this structure:PARTN_ROLE , PARTN_NUMB
    PARTN_ROLE    ---> " Partner Role, which specifies the partner type i.e Sold-To, Ship-To, Bill-To ...
    ARTN_NUMB ---> " Customer Number
    Regards
    Eswar

  • Error when creating sales order

    Hi Gurus,
    Please help me resolve the below error.
    "Invalid combination of Business Area   and Mat.Acc.Det.Group 01"
    Thank You
    Kumar

    RESOLVED MYSELF

  • How to create sales order using BAPI.

    Hi all,
    I am trying to create sales order using standard BAPI
    "BAPI_SALESORDER_CREATEFROMDAT2". But, even I had entered all mandatory fields, I am unable to create sales order sucessfully.
    I had gone through the documentaion of this BAPI and entered these fields.
    These are the mandatory fields that which I had tried to create,
    ORDER_HEADER_IN :
    DOC_TYPE Sales document type
    SALES_ORG Sales organization
    DISTR_CHAN Distribution channel
    DIVISION Division
    ORDER_PARTNERS..:
    PARTN_ROLE Partner role, SP sold-to party
    PARTN_NUMB Customer number
    ORDER_ITEMS_IN..:
    MATERIAL Material number
    Do we have anymore fields to give as inputs? I am getting this error message as below :
    Msg: Personal number 00007176 does not exit.
    But, I am not giving any personal number manually. This personal number was having connection with partner role field,
    I had reffered this from the VBPA (Sales Document: Partner Table). Now, please suggest me how to solve this?
    Can anyone tell me how to solve this problem and create sales order sucessfully.
    Thanks in advance,
    Surender Batlanki.

    hi surendra ,
    chech with below code.
    REPORT z_bapi_salesorder_create.
    Parameters
    Sales document type
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text FOR FIELD p_auart.
    PARAMETERS: p_auart TYPE auart OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Sales organization
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text1 FOR FIELD p_vkorg.
    PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Distribution channel
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text2 FOR FIELD p_vtweg.
    PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Division.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text3 FOR FIELD p_spart.
    PARAMETERS: p_spart TYPE spart OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SKIP 1.
    Sold-to
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text4 FOR FIELD p_sold.
    PARAMETERS: p_sold  TYPE kunnr OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Ship-to
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text5 FOR FIELD p_ship.
    PARAMETERS: p_ship  TYPE kunnr OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SKIP 1.
    Material
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text6 FOR FIELD p_matnr.
    PARAMETERS: p_matnr TYPE matnr   OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Quantity.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text7 FOR FIELD p_menge.
    PARAMETERS: p_menge TYPE kwmeng  OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Plant
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text9 FOR FIELD p_plant.
    PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Data declarations.
    DATA: v_vbeln            LIKE vbak-vbeln.
    DATA: header             LIKE bapisdhead1.
    DATA: headerx            LIKE bapisdhead1x.
    DATA: item               LIKE bapisditem  OCCURS 0 WITH HEADER LINE.
    DATA: itemx              LIKE bapisditemx OCCURS 0 WITH HEADER LINE.
    DATA: partner            LIKE bapipartnr  OCCURS 0 WITH HEADER LINE.
    DATA: return             LIKE bapiret2    OCCURS 0 WITH HEADER LINE.
    DATA: lt_schedules_inx   TYPE STANDARD TABLE OF bapischdlx
                             WITH HEADER LINE.
    DATA: lt_schedules_in    TYPE STANDARD TABLE OF bapischdl
                             WITH HEADER LINE.
    Initialization.
    INITIALIZATION.
    v_text   = 'Order type'.
    v_text1  = 'Sales Org'.
    v_text2  = 'Distribution channel'.
    v_text3  = 'Division'.
    v_text4  = 'Sold-to'.
    v_text5  = 'Ship-to'.
    v_text6  = 'Material'.
    v_text7  = 'Quantity'.
    v_text9  = 'Plant'.
    Start-of-selection.
    START-OF-SELECTION.
    Header data
    Sales document type
      header-doc_type = p_auart.
      headerx-doc_type = 'X'.
    Sales organization
      header-sales_org = p_vkorg.
      headerx-sales_org = 'X'.
    Distribution channel
      header-distr_chan  = p_vtweg.
      headerx-distr_chan = 'X'.
    Division
      header-division = p_spart.
      headerx-division = 'X'.
      headerx-updateflag = 'I'.
    Partner data
    Sold to
      partner-partn_role = 'AG'.
      partner-partn_numb = p_sold.
      APPEND partner.
    Ship to
      partner-partn_role = 'WE'.
      partner-partn_numb = p_ship.
      APPEND partner.
    ITEM DATA
      itemx-updateflag = 'I'.
    Line item number.
      item-itm_number = '000010'.
      itemx-itm_number = 'X'.
    Material
      item-material = p_matnr.
      itemx-material = 'X'.
    Plant
      item-plant    = p_plant.
      itemx-plant   = 'X'.
    Quantity
      item-target_qty = p_menge.
      itemx-target_qty = 'X'.
      APPEND item.
      APPEND itemx.
      Fill schedule lines
      lt_schedules_in-itm_number = '000010'.
      lt_schedules_in-sched_line = '0001'.
      lt_schedules_in-req_qty    = p_menge.
      APPEND lt_schedules_in.
      Fill schedule line flags
      lt_schedules_inx-itm_number  = '000010'.
      lt_schedules_inx-sched_line  = '0001'.
      lt_schedules_inx-updateflag  = 'X'.
      lt_schedules_inx-req_qty     = 'X'.
      APPEND lt_schedules_inx.
    Call the BAPI to create the sales order.
      CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
           EXPORTING
                sales_header_in     = header
                sales_header_inx    = headerx
           IMPORTING
                salesdocument_ex    = v_vbeln
           TABLES
                return              = return
                sales_items_in      = item
                sales_items_inx     = itemx
                sales_schedules_in  = lt_schedules_in
                sales_schedules_inx = lt_schedules_inx
                sales_partners      = partner.
    Check the return table.
      LOOP AT return WHERE type = 'E' OR type = 'A'.
        EXIT.
      ENDLOOP.
      IF sy-subrc = 0.
        WRITE: / 'Error in creating document'.
      ELSE.
    Commit the work.
        COMMIT WORK AND WAIT.
        WRITE: / 'Document ', v_vbeln, ' created'.
      ENDIF.
    let us know if you have any qauistions.
    ~linganna

  • TO CREATE SALES ORDER USING BAPI PROBLEM

    I am trying to create Sales Order using bapi function, this is giving me error as mentioned below
    *Please enter SHIP-TO-PARTY OR SOLD TO PARTY
    *SALES DOCUMENT WAS NOT CHANGED.
    it does not GIVE ME THE SALES DOCUMENT NO .
    The BAPI I am using is BAPI_SALESORDER_CREATEFROMDAT2.
    Would someone know which parameters I have to papulate,or have any other suggestion
    THE INTERNAL TABLES I AM PASSING TO BAPI FUNCTION ARE
    DATA:  IT_BAPI_HEADER LIKE BAPISDHD1.
    DATA:     IT_BAPI_SOLD_TO_PARTY LIKE BAPIPARNR occurs 0 with header line.
    DATA:  SO_NO LIKE BAPIVBELN-VBELN.
    DATA:  IT_BAPI_ITEMS_IN LIKE BAPISDITM occurs 0 with header line.
    DATA: IT_BAPI_RETURN LIKE BAPIRET2 occurs 0 with header line.
    IS THERE ANYTHING ELSE TO POPULATE OTHER THAN THIS STRUCTURES
    HEADER
          Sales-Document type:      
    *     Sales-Organization
    *     Distrubution-Channel: 
    *     Division          
    PARTNER
            Partner Function     
         Customer Number      
    ITEM DETAIL
             Material Number      
    how to accomplish my task?

    Nandan,
    Please go through the documentation of the BAPI. It gives you details of what needs to be filled in in which structure/parmater. Also, read the documentation associated with each structure, that will tell what to fill.
    It is really hard to explain it in simple terms as to what are required. But, you need the header, items and partners at the minimum. Also, with some of these structures there are also 'X' structures(like ORDER_ITEMS_INX for ORDER_ITEMS_IN) which should also be filled based on what fields you filled in the original structure. For example, if you filled 'MATERIAL' field on the ORDER_ITEMS_IN structure, you should also fill in the same field on the ORDER_ITEMS_INX structure with an 'X' in it.
    All this is well documented in the BAPI.
    Srinivas

  • How to create sales order using bapi( test purpose)

    Hi all,
           while i was creating sales order using the BAPI_SALESORDER_CREATEFROMDAT1 it is giving some error,
    version 0 is not defined for the fiscal year ****.
    I have given the fallowing parameters as input
    ORDER_HEADER_IN
         DOC_TYPE     OR
                    SALES_ORG  1000
         DISTR_CHAN  10
                    DIVISION         00
    ORDER_PATNERS
         PARTN_ROLE     SP
         PARTN_NUMB     1000
    ORDER_ITEMSIN
         MATERIAL     M-13
    I need to create sample sales order . Please help me how to create sales order with an example( for test purpose).
    Regards
    Deviprasad.

    Hi Prasad,
    Try using BAPI_SALESORDER_CREATEFROMDAT2.
    While creating sales order using FM: BAPI_SALESORDER_CREATEFROMDAT2, please make sure ORDER_ITEMS_IN, ORDER_ITEMS_INX, ORDER_SCHEDULES_IN, ORDER_SCHEDULES_INX.
    Pricing Conditions will not be mandatory to create a sales order via BAPI.
    As you were saying, you can create a sales order but not with items. Do populate the internal tables that i have specified above.
    Also try to pass the item number internally, this will help you in identifying the schedule lines.
    Regards,
    Priyanka.

  • Setting user specific contract data while creating sales order using BAPI

    Hi all,
    I am creating sales order using BAPI - BAPI_SALESORDER_CREATEFROMDAT2.
    Now my problem is that there is no structure for contract data (i.e. VEDA), system automatically set contract data using customization values.
    I am doing some validations on cotract data in MV45AFZZ which fails, because these validations are performed on standard values, user specific values r not set.
    How to handle this issue, your small clue may help a lot.
    Regards,
    S@meer

    HI
      Pricing will be carried basing on the pricing
    procedure.
    Case1: Prices will be carried out automatically if
    necessary condition records are maintained for the
    condition type.
      For this you can go to Sales Order-> Item Conditions
    In the screen you can click on command button Analysis,
    which gives you the list of condition types associated
    to the pricing procedure. By clicking on the condition
    type you can know the action that has taken place.
    Case2: Manually forcing prices for Items.
      To do this, you have to populate ORDER_CONDITIONS_IN &
    ORDER_CONDITIONS_INX. Also note to identify the item
    numbers, you manually pass the item number for each item
    in the sales order, use the same item number for
    populating conditions.
      Parameters required:
    ORDER_CONDITIONS_IN:
      ITM_NUMBER, COND_TYPE, COND_VALUE, CURRENCY
    ORDER_CONDITIONS_INX:
      ITM_NUMBER, COND_TYPE, UPDATEFLAG, COND_VALUE,CURRENCY.
       Hope the above info helps you. Do revert back if you
    need more info.
    Kind Regards
    Eswar

Maybe you are looking for