Issue in creating sales order using process_header API (web service)

Hi All,
I am trying to create sales order header using web service call to OE_ORDER_PUB.Process_header API.
When I pass the inputs and test the service,I get output with return_status='S'. But no record falls at the OE_ORDER_HEADER_ALL table.
I cant identify where the problem is.Is there any commit missing? Pls help me resolve this issue.
Thanks,
Vinoth

Hi All,
I am trying to create sales order header using web service call to OE_ORDER_PUB.Process_header API.
When I pass the inputs and test the service,I get output with return_status='S'. But no record falls at the OE_ORDER_HEADER_ALL table.
I cant identify where the problem is.Is there any commit missing? Pls help me resolve this issue.
Thanks,
Vinoth

Similar Messages

  • Issue in creating sales order using process_header API

    Hi all,
    We have a requirement to create sales order using apps adapter in ebiz from SOA suite composite.I used OE_ORDER_PUB.Process_header API to create order header.
    When I pass the inputs and test the service,I get output with return_status='S'. But no record falls at the OE_ORDER_HEADER_ALL table.
    I cant identify where the problem is.Pls suggest me with the things to resolve this issue.
    Thanks,
    goutham

    Hi all,
    We have a requirement to create sales order using apps adapter in ebiz from SOA suite composite.I used OE_ORDER_PUB.Process_header API to create order header.
    When I pass the inputs and test the service,I get output with return_status='S'. But no record falls at the OE_ORDER_HEADER_ALL table.
    I cant identify where the problem is.Pls suggest me with the things to resolve this issue.
    Thanks,
    goutham

  • ISSUE ON CREATE SALES ORDER USING BAPI

    Hi,
       I am creating a sales order using bapi BAPI_SALESORDER_CREATEFROMDAT2.But it it fails to create a sales order abd below is my code pls check and correct me to create a sales order.
    LOOP AT DATA_TAB.
    clear: l_order_header_in,
           l_salesdocument,
           l_order_partners,
           l_order_items_IN,
           l_order_schedules_IN.
    refresh: l_order_items_in,
             l_order_partners,
             l_order_schedules_IN,
             l_return.
    Order header
    l_order_header_in-DOC_TYPE    = DATA_TAB-AUART.
    l_order_header_IN-SALES_ORG   = DATA_TAB-VKORG.
    l_order_header_IN-DISTR_CHAN  = data_tab-vtweg.
    l_order_header_in-division    = DATA_TAB-SPART.
    l_order_header_in-REF_1_S     = DATA_TAB-IHREZ_E.
    l_order_header_in-PURCH_NO_S  = DATA_TAB-BSTKD_E.
    l_order_header_in-PO_DAT_S    = data_tab-bstdk_e.
    l_order_header_in-PO_METH_S   = DATA_TAB-BSARK_E.
    l_order_header_in-DOC_DATE    = DATA_TAB-AUDAT.
    l_order_header_in-REC_POINT   = DATA_TAB-EMPST.
    l_order_header_inX-DOC_TYPE    = 'X'.
    l_order_header_INX-SALES_ORG   = 'X'.
    l_order_header_INX-DISTR_CHAN  = 'X'.
    l_order_header_inX-division    = 'X'.
    l_order_header_inX-REF_1_S     = 'X'.
    l_order_header_inX-PURCH_NO_S  = 'X'.
    l_order_header_inX-PO_DAT_S    = 'X'.
    l_order_header_inX-PO_METH_S   = 'X'.
    l_order_header_inX-DOC_DATE    = 'X'.
    l_order_header_inX-REC_POINT   = 'X'.
    Partner data SOLD TO PARTY
    l_order_partners-ITM_NUMBER = DATA_TAB-POSNR.
    l_order_partners-partn_role = 'SP'.
    l_order_partners-partn_numb = DATA_TAB-kunnr1.
    append l_ordeR_partners.
    Partner data SHOP TO PARTY
    l_order_partners-ITM_NUMBER = DATA_TAB-POSNR.
    l_order_partners-partn_role = 'SH'.
    l_order_partners-partn_numb = DATA_TAB-kunnr2.
    append l_ordeR_partners.
    Order items
    l_order_items_IN-ITM_NUMBER = DATA_TAB-POSNR.
    l_order_items_IN-material   = DATA_TAB-MABNR.
    l_order_items_IN-BATCH      = DATA_TAB-CHARG.
    l_order_items_IN-REASON_REJ = DATA_TAB-ABGRU.
    append l_order_items_IN.
    l_order_items_INX-ITM_NUMBER = DATA_TAB-POSNR.
    l_order_items_INX-material   = 'X'.
    l_order_items_INX-BATCH      = 'X'.
    l_order_items_INX-REASON_REJ = 'X'.
    append l_order_items_INX.
    Schedules for quantity
    l_order_schedules_IN-itm_number = DATA_TAB-POSNR.
    l_order_schedules_IN-req_qty    = DATA_TAB-KWMENG.
    append l_order_schedules_IN.
    Schedules for quantity
    l_order_schedules_INX-itm_number = data_tab-posnr.
    l_order_schedules_INX-req_qty    =  'X'.
    append l_order_schedules_INX.
    Conditions for value
    l_order_conditions_IN-itm_number = DATA_TAB-POSNR.
    l_order_conditions_IN-cond_type  = DATA_TAB-KSCHL.
    l_order_conditions_IN-cond_value = DATA_TAB-KBETR.
    l_order_conditions_IN-currency   = DATA_TAB-KOEIN.
    append l_order_conditions_IN.
    Conditions for value
    l_order_conditions_INX-itm_number = DATA_TAB-POSNR.
    l_order_conditions_INX-cond_type  = 'X'.
    l_order_conditions_INX-cond_value = 'X'.
    l_order_conditions_INX-currency   = 'X'.
    append l_order_conditions_INX .
    endloop.
    BAPI to create sales order
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
    EXPORTING
    SALESDOCUMENTIN =
      ORDER_HEADER_IN =      l_order_header_IN
      ORDER_HEADER_INX =     l_order_header_INX
    IMPORTING
      SALESDOCUMENT =        l_salesdocument
    TABLES
      RETURN =               l_return
      ORDER_ITEMS_IN =       l_order_items_IN
      ORDER_ITEMS_INX =      l_order_items_INX
      ORDER_PARTNERS =       l_order_partners
      ORDER_SCHEDULES_IN =   l_order_schedules_in
      ORDER_SCHEDULES_INX =  l_order_schedules_inX
      ORDER_CONDITIONS_IN =  l_order_conditions_in
      ORDER_CONDITIONS_INX = l_order_conditions_inX
    IF SY-SUBRC = 0.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
       WAIT           = C_X
    IMPORTING
      RETURN        =
    ENDIF.
      Pls help me to solve the issue.
    Thanks,
    Rajendra.

    Hi Raj
    This is the sameple code which works fine for me,
    REPORT  zkb_sales_order.
    DATA: w_order_header_in TYPE bapisdhd1,
          i_order_partners TYPE TABLE OF bapiparnr,
          w_order_partners TYPE bapiparnr,
          i_return TYPE TABLE OF bapiret2,
          w_return TYPE bapiret2,
         i_order_items_in TYPE TABLE OF bapisditm,
         w_order_items_in TYPE  bapisditm,
         i_order_items_inx TYPE TABLE OF  bapisditmx,
         w_order_items_inx TYPE  bapisditmx,
        i_order_conditions_in TYPE TABLE OF bapicond,
        w_order_conditions_in TYPE bapicond,
        i_order_conditions_inx TYPE TABLE OF bapicondx,
        w_order_conditions_inx TYPE TABLE OF bapicondx.
    CLEAR w_order_header_in.
    w_order_header_in-doc_type  = 'ZSO'.
    w_order_header_in-sales_org =  '1000'.
    w_order_header_in-distr_chan = '01'.
    w_order_header_in-division =  '01'.
    w_order_header_in-req_date_h  = sy-datum.
    w_order_header_in-sales_dist =   '000001'.
    CLEAR: i_order_items_in,w_order_items_in.
    w_order_items_in-material = 77.
    w_order_items_in-salqtynum = 1.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input  = w_order_items_in-material
      IMPORTING
        output = w_order_items_in-material.
    APPEND w_order_items_in TO i_order_items_in.
    * SP
    CLEAR: i_order_partners,w_order_partners.
    w_order_partners-partn_role = 'AG'.
    w_order_partners-partn_numb = '2000016'.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input  = w_order_partners-partn_numb
      IMPORTING
        output = w_order_partners-partn_numb.
    APPEND w_order_partners TO i_order_partners.
    CLEAR: i_order_conditions_in,w_order_conditions_in.
    w_order_conditions_in-itm_number =  '000010'.
    w_order_conditions_in-cond_type  =   'PR00'.
    w_order_conditions_in-cond_value =  100.
    APPEND w_order_conditions_in TO i_order_conditions_in.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
      EXPORTING
    *   SALESDOCUMENTIN               =
        order_header_in               = w_order_header_in
    *   ORDER_HEADER_INX              =
    *   SENDER                        =
    *   BINARY_RELATIONSHIPTYPE       =
    *   INT_NUMBER_ASSIGNMENT         =
    *   BEHAVE_WHEN_ERROR             =
    *   LOGIC_SWITCH                  =
    *   TESTRUN                       =
    *   CONVERT                       = ' '
    * IMPORTING
    *   SALESDOCUMENT                 =
      TABLES
       return                        = i_return
       order_items_in                = i_order_items_in
    *   ORDER_ITEMS_INX               =
        order_partners                = i_order_partners
    *   ORDER_SCHEDULES_IN            =
    *   ORDER_SCHEDULES_INX           =
       order_conditions_in           = i_order_conditions_in
    *   ORDER_CONDITIONS_INX          =
    *   ORDER_CFGS_REF                =
    *   ORDER_CFGS_INST               =
    *   ORDER_CFGS_PART_OF            =
    *   ORDER_CFGS_VALUE              =
    *   ORDER_CFGS_BLOB               =
    *   ORDER_CFGS_VK                 =
    *   ORDER_CFGS_REFINST            =
    *   ORDER_CCARD                   =
    *   ORDER_TEXT                    =
    *   ORDER_KEYS                    =
    *   EXTENSIONIN                   =
    *   PARTNERADDRESSES              =
    READ TABLE i_return INTO w_return WITH KEY type = 'E'.
    IF sy-subrc NE 0.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = 'X'.
    ENDIF.
    LOOP AT i_return INTO w_return .
      WRITE: / w_return-type,
      w_return-id,
      w_return-number,
      w_return-message.
    ENDLOOP.
    Regards
    Kathirvel

  • Confirmation Quantity issue while creating Sales order using BAPI

    Hi SDN,
    Can anyone of you help mein the below issue:
    I have a program to create a sales order using upload file. for this i use "BAPI_SALESORDER_CREATEFROMDAT2" & for changing existing "BAPI_SALESORDER_CHANGE".
    Now If the upload file contains the Same Material, Based on other conditions, it needs to create Multiple sales order.
    When the first Salesorder is created, the Quantity is getting confirmed (Confirmed quantity VBEP-BMENG). But during actual run, since the confirmation is getting done for the same material in the above Sales order, the confirmation is not being done in the subsequent Sales order".
    This poses a problem for business, user need to manual refresh the u201Cconfirmed quantity for each line item in the particular SO where it failed during program upload.
    Also while uploading using the BAPI, if we wait forsometime after creating the first sales order in Debug, then the above material is unlocked & the confirmation quantity is done for the subsequent sales order also.
    But in the actual run, this is creating a problem. Some Refresh or Unlocking problem.
    Can you please suggest a suitable solution for this issue.
    Thanks & regrads,
    Chaitanya LBK

    Have you tried backorder processing?
    V_V1
    V_V2
    V_RA
    V_R1
    V_R2

  • Issue in creating sales order using BAPI's...?

    Hi Guru's,
    i had generated the sales order using the BAPI..but could please guide me how to declare the data declaratin same fields as globally and how to move internal table and how to append ....
    thanks in advance...
    REPORT z_bapi_salesorder_create.
    Sales document type
    PARAMETERS: p_auart TYPE auart OBLIGATORY.
    Sales organization
    PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
    Distribution channel
    PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
    Division.
    PARAMETERS: p_spart TYPE spart OBLIGATORY.
    Sold-to
    PARAMETERS: p_sold  TYPE kunnr OBLIGATORY.
    Ship-to
    PARAMETERS: p_ship  TYPE kunnr OBLIGATORY.
    Material
    PARAMETERS: p_matnr TYPE matnr   OBLIGATORY.
    Quantity.
    PARAMETERS: p_menge TYPE kwmeng  OBLIGATORY.
    Plant
    PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
    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.
    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.
         call FUNCTION 'BAPI_TRANSACTION_COMMIT'.
        WRITE: / 'Document ', v_vbeln, ' created'.
      ENDIF.

    *& Report  ZAREPAS30
    REPORT  zarepas30.
    DATA : gs_vbeln                   TYPE  vbak-vbeln,
           gs_order_header_in         TYPE  bapisdhd1,
           gs_order_header_inx        TYPE  bapisdhd1x,
           gt_order_items_in          TYPE  STANDARD TABLE OF bapisditm,
           gwa_itab1                  TYPE  bapisditm,
           gt_order_items_inx         TYPE  STANDARD TABLE OF bapisditmx,
           gwa_itab2                  TYPE  bapisditmx,
           gt_order_partners          TYPE  STANDARD TABLE OF bapiparnr,
           gwa_itab3                  TYPE  bapiparnr,
           gt_return                  TYPE  STANDARD TABLE OF bapiret2,
           gwa_itab4                  TYPE  bapiret2.
    Sales document type
      PARAMETERS: p_auart TYPE auart OBLIGATORY.
    Sales organization
      PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
    Distribution channel
      PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
    Division.
      PARAMETERS: p_spart TYPE spart OBLIGATORY.
    Requested Delivery Date
      PARAMETERS: p_edatu  TYPE edatu OBLIGATORY.
    Sold-to
      PARAMETERS: p_sold  TYPE kunnr OBLIGATORY.
    Ship-to
      PARAMETERS: p_ship  TYPE kunnr OBLIGATORY.
    Material
      PARAMETERS: p_matnr TYPE matnr   OBLIGATORY.
    Quantity.
      PARAMETERS: p_menge TYPE kwmeng  OBLIGATORY.
    Plant
      PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
    Start-of-selection.
      START-OF-SELECTION.
    Header data
    Sales document type
      gs_order_header_in-doc_type = p_auart.
      gs_order_header_inx-doc_type = 'X'.
    Sales organization
      gs_order_header_in-sales_org = p_vkorg.
      gs_order_header_inx-sales_org = 'X'.
    Distribution channel
      gs_order_header_in-distr_chan  = p_vtweg.
      gs_order_header_inx-distr_chan = 'X'.
    Division
      gs_order_header_in-division = p_spart.
      gs_order_header_inx-division = 'X'.
    Reguested Delivery Date
      gs_order_header_in-req_date_h = p_edatu.
      gs_order_header_inx-req_date_h = 'X'.
      gs_order_header_inx-updateflag = 'I'.
    Partner data
    Sold to
      gwa_itab3-partn_role = 'AG'.
      gwa_itab3-partn_numb = p_sold.
      APPEND gwa_itab3 TO  gt_order_partners .
    ship to
      gwa_itab3-partn_role = 'WE'.
      gwa_itab3-partn_numb = p_ship.
      APPEND gwa_itab3 TO  gt_order_partners .
    ITEM DATA
      gwa_itab2-updateflag = 'I'.
    Line item number.
      gwa_itab1-itm_number = '000010'.
      gwa_itab2-itm_number = 'X'.
    Material
      gwa_itab1-material = p_matnr.
      gwa_itab2-material = 'X'.
    Plant
      gwa_itab1-plant    = p_plant.
      gwa_itab2-plant   = 'X'.
    Quantity
      gwa_itab1-target_qty = p_menge.
      gwa_itab2-target_qty = 'X'.
      APPEND gwa_itab1 TO gt_order_items_in.
      APPEND gwa_itab2 TO gt_order_items_inx.
    Line item number.
      gwa_itab1-itm_number = '000020'.
      gwa_itab2-itm_number = 'X'.
    Material
      gwa_itab1-material = p_matnr.
      gwa_itab2-material = 'X'.
    Plant
      gwa_itab1-plant    = p_plant.
      gwa_itab2-plant   = 'X'.
    Quantity
      gwa_itab1-target_qty = p_menge.
      gwa_itab2-target_qty = 'X'.
      APPEND gwa_itab1 TO gt_order_items_in.
      APPEND gwa_itab2 TO gt_order_items_inx.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
      EXPORTING
        order_header_in               = gs_order_header_in
        ORDER_HEADER_INX              = gs_order_header_inx
      IMPORTING
        SALESDOCUMENT                 = gs_vbeln
      tables
        RETURN                        = gt_return
        ORDER_ITEMS_IN                = gt_order_items_in
        ORDER_ITEMS_INX               = gt_order_items_inx
        order_partners                = gt_order_partners.
    Check the return table.
      LOOP AT gt_return into gwa_itab4 WHERE type = 'E' OR type = 'A'.
        EXIT.
      ENDLOOP.
      IF sy-subrc = 0.
        WRITE: / 'Error occured while creating sales order '.
      ELSE.
    Commit the work.
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
        WRITE: / 'Document ', gs_vbeln, ' created'.
      ENDIF.

  • Create sales order using  IBE_Quote_W1_PVT.SUBMITQUOTEWRAPPER

    Hi,
    I am trying to create an sales order using following api. which creates cart from shopping cart.
    SET serveroutput ON
    DECLARE
    P_API_VERSION_NUMBER NUMBER;
    P_INIT_MSG_LIST VARCHAR2(200);
    P_COMMIT VARCHAR2(200);
    X_RETURN_STATUS VARCHAR2(200);
    X_MSG_COUNT NUMBER;
    X_MSG_DATA VARCHAR2(200);
    P_QUOTE_HEADERID NUMBER;
    P_LAST_UPDATE_DATE DATE;
    P_SHAREE_NUMBER NUMBER;
    P_SHAREE_PARTY_ID NUMBER;
    P_SHAREE_ACCOUNT_ID NUMBER;
    P_SC_BOOK_FLAG VARCHAR2(200);
    P_SC_RESERVE_FLAG VARCHAR2(200);
    P_SC_CALCULATE_PRICE VARCHAR2(200);
    P_SC_SERVER_ID NUMBER;
    P_SC_CC_BY_FAX VARCHAR2(200);
    P_CUSTOMER_COMMENTS VARCHAR2(200);
    P_REASON_CODE VARCHAR2(200);
    P_SALESREP_EMAIL_ID VARCHAR2(200);
    P_MINISITE_ID NUMBER;
    X_LAST_UPDATE_DATE DATE;
    X_ORDER_NUMBER NUMBER;
    X_ORDER_HEADER_ID NUMBER;
    X_ORDER_REQUEST_ID NUMBER;
    X_CONTRACT_ID NUMBER;
    X_STATUS VARCHAR2(200);
    X_HOLD_FLAG VARCHAR2(200);
    BEGIN
    P_API_VERSION_NUMBER := 1;
    P_INIT_MSG_LIST := FND_API.G_TRUE;
    P_COMMIT := FND_API.G_FALSE;
    P_QUOTE_HEADERID := 18534;
    P_LAST_UPDATE_DATE := to_date('2012-10-01 04:33:45','YYYY-MM-DD HH24:MI:SS');
    P_SHAREE_NUMBER := FND_API.G_MISS_NUM ;
    P_SHAREE_PARTY_ID := FND_API.G_MISS_NUM ;
    P_SHAREE_ACCOUNT_ID := FND_API.G_MISS_NUM ;
    P_SC_BOOK_FLAG := FND_API.G_MISS_CHAR;
    P_SC_RESERVE_FLAG := FND_API.G_FALSE;
    P_SC_CALCULATE_PRICE := FND_API.G_FALSE;
    P_SC_SERVER_ID := -1;
    P_SC_CC_BY_FAX := FND_API.G_FALSE;
    P_CUSTOMER_COMMENTS := FND_API.G_MISS_CHAR;
    P_REASON_CODE := FND_API.G_MISS_CHAR;
    P_SALESREP_EMAIL_ID := FND_API.G_MISS_CHAR;
    P_MINISITE_ID := 10660;
    IBE_Quote_W1_PVT.SUBMITQUOTEWRAPPER(
    P_API_VERSION_NUMBER => P_API_VERSION_NUMBER,
    P_INIT_MSG_LIST => P_INIT_MSG_LIST,
    P_COMMIT => P_COMMIT,
    X_RETURN_STATUS => X_RETURN_STATUS,
    X_MSG_COUNT => X_MSG_COUNT,
    X_MSG_DATA => X_MSG_DATA,
    P_QUOTE_HEADERID => P_QUOTE_HEADERID,
    P_LAST_UPDATE_DATE => P_LAST_UPDATE_DATE,
    P_SHAREE_NUMBER => P_SHAREE_NUMBER,
    P_SHAREE_PARTY_ID => P_SHAREE_PARTY_ID,
    P_SHAREE_ACCOUNT_ID => P_SHAREE_ACCOUNT_ID,
    P_SC_BOOK_FLAG => P_SC_BOOK_FLAG,
    P_SC_RESERVE_FLAG => P_SC_RESERVE_FLAG,
    P_SC_CALCULATE_PRICE => P_SC_CALCULATE_PRICE,
    P_SC_SERVER_ID => P_SC_SERVER_ID,
    P_SC_CC_BY_FAX => P_SC_CC_BY_FAX,
    P_CUSTOMER_COMMENTS => P_CUSTOMER_COMMENTS,
    P_REASON_CODE => P_REASON_CODE,
    P_SALESREP_EMAIL_ID => P_SALESREP_EMAIL_ID,
    P_MINISITE_ID => P_MINISITE_ID,
    X_LAST_UPDATE_DATE => X_LAST_UPDATE_DATE,
    X_ORDER_NUMBER => X_ORDER_NUMBER,
    X_ORDER_HEADER_ID => X_ORDER_HEADER_ID,
    X_ORDER_REQUEST_ID => X_ORDER_REQUEST_ID,
    X_CONTRACT_ID => X_CONTRACT_ID,
    X_STATUS => X_STATUS,
    X_HOLD_FLAG => X_HOLD_FLAG
    DBMS_OUTPUT.PUT_LINE('X_RETURN_STATUS = ' || X_RETURN_STATUS);
    DBMS_OUTPUT.PUT_LINE('X_MSG_COUNT = ' || X_MSG_COUNT);
    DBMS_OUTPUT.PUT_LINE('X_MSG_DATA = ' || X_MSG_DATA);
    DBMS_OUTPUT.PUT_LINE('X_LAST_UPDATE_DATE = ' || X_LAST_UPDATE_DATE);
    DBMS_OUTPUT.PUT_LINE('X_ORDER_NUMBER = ' || X_ORDER_NUMBER);
    DBMS_OUTPUT.PUT_LINE('X_ORDER_HEADER_ID = ' || X_ORDER_HEADER_ID);
    DBMS_OUTPUT.PUT_LINE('X_ORDER_REQUEST_ID = ' || X_ORDER_REQUEST_ID);
    DBMS_OUTPUT.PUT_LINE('X_CONTRACT_ID = ' || X_CONTRACT_ID);
    DBMS_OUTPUT.PUT_LINE('X_STATUS = ' || X_STATUS);
    DBMS_OUTPUT.PUT_LINE('X_HOLD_FLAG = ' || X_HOLD_FLAG);
    END;
    When i use this from a OA_HTML jsp the sales order is created . But when i use it from the sql developer
    i got following error
    X_RETURN_STATUS = E
    X_MSG_COUNT = 1
    X_MSG_DATA = You do not have access to this cart.
    X_LAST_UPDATE_DATE =
    X_ORDER_NUMBER = 9.990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+125
    X_ORDER_HEADER_ID = 9.990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+125
    X_ORDER_REQUEST_ID = 9.990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+125
    X_CONTRACT_ID = 9.990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+125
    X_STATUS =
    I checked logs for both .
    For working one log is ie. using jsp
    01-OCT-2012:01:24:46 IBE IBE_UTIL.enable_debug_new p_check_profile is N
    01-OCT-2012:01:24:46 IBE IBE_UTIL.enable_debug_new p_check_profile is N
    01-OCT-2012:01:24:46 IBE Begin validate_user_update10/01/2012:01:24:46
    01-OCT-2012:01:24:46 IBE Incoming party_id is 423832
    01-OCT-2012:01:24:46 IBE Incoming cust_account_id is 140757
    01-OCT-2012:01:24:46 IBE Incoming quote_header_id is 18529
    01-OCT-2012:01:24:46 IBE User id obtained from environment is: -1
    01-OCT-2012:01:24:46 IBE p_save_type is :6
    01-OCT-2012:01:24:46 IBE Entered Validation...T
    01-OCT-2012:01:24:46 IBE no sharee number
    01-OCT-2012:01:24:46 IBE quote_source_code of cart passed in=IStore Account
    01-OCT-2012:01:24:46 IBE In validating Owner flow: 423832,140757 10/01/2012:01:24:46
    01-OCT-2012:01:24:46 IBE Validate_user_update: Before Last update date validation,p_last_update_date= 01-10-12
    01-OCT-2012:01:24:46 IBE Validate_user_update: Last update date validation START
    01-OCT-2012:01:24:46 IBE Validate_user_update: l_last_update_date=
    01-OCT-2012:01:24:46 IBE Validate_user_update: p_last_update_date=10/01/2012:00:22:07
    01-OCT-2012:01:24:46 IBE Validate_user_update: Last update date validation END
    01-OCT-2012:01:24:46 IBE Before calling validate_quote10/01/2012:01:24:46
    01-OCT-2012:01:24:46 IBE Begin Validate_quote10/01/2012:01:24:46
    01-OCT-2012:01:24:46 IBE Validate_quote: Validation for one-click start
    01-OCT-2012:01:24:46 IBE End validate_quote10/01/2012:01:24:46
    01-OCT-2012:01:24:46 IBE End validate_user_update10/01/2012:01:24:46
    but for the failure it is.
    01-OCT-2012:01:20:53 IBE IBE_UTIL.enable_debug_new p_check_profile is N
    01-OCT-2012:01:20:53 IBE IBE_UTIL.enable_debug_new p_check_profile is N
    01-OCT-2012:01:20:53 IBE Begin validate_user_update10/01/2012:01:20:53
    01-OCT-2012:01:20:53 IBE Incoming party_id is 9.990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+125
    01-OCT-2012:01:20:53 IBE Incoming cust_account_id is 9.990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+125
    01-OCT-2012:01:20:53 IBE Incoming quote_header_id is 18529
    01-OCT-2012:01:20:53 IBE User id obtained from environment is: -1
    01-OCT-2012:01:20:53 IBE p_save_type is :6
    01-OCT-2012:01:20:53 IBE Entered Validation...T
    01-OCT-2012:01:20:53 IBE no sharee number
    01-OCT-2012:01:20:53 IBE quote_source_code of cart passed in=IStore Account
    01-OCT-2012:01:20:53 IBE Owner flow with env. userid: 10/01/2012:01:20:53
    01-OCT-2012:01:20:53 IBE partyId::quotehdrId(9.990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+125,18529)
    01-OCT-2012:01:20:53 IBE End:Expected exception:IBE_Quote_Misc_pvt.validate_user_update
    From this u can see that party id and account is fetched when using jsp. but direct running of procedure not getting these values.
    is there sql api running when accessing through jsp . so that these values are got from session.
    Thanks
    Mark

    Hi,
    I have passed that too . still getting same error.
    IBE_Quote_W1_PVT.SUBMITQUOTEWRAPPER calls IBE_Quote_Checkout_Pvt.submitQuote
    which calls another package
    PROCEDURE Validate_User_Update(
    p_api_version_number IN NUMBER := 1.0
    ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
    ,p_quote_header_id IN NUMBER
    ,p_party_id IN NUMBER := FND_API.G_MISS_NUM
    ,p_cust_account_id IN NUMBER := FND_API.G_MISS_NUM
    ,p_quote_retrieval_number IN NUMBER := FND_API.G_MISS_NUM
    ,p_validate_user IN VARCHAR2 := FND_API.G_FALSE
    ,p_privilege_type_code IN VARCHAR2 := 'F'
    ,p_save_type IN NUMBER := FND_API.G_MISS_NUM
    ,p_last_update_date IN DATE := FND_API.G_MISS_DATE
    ,x_return_status OUT NOCOPY VARCHAR2
    ,x_msg_count OUT NOCOPY NUMBER
    ,x_msg_data OUT NOCOPY VARCHAR2)
    in it like this
    IBE_Quote_Misc_pvt.Validate_User_Update(
         p_init_msg_list => FND_API.G_TRUE
         ,p_quote_header_id => p_quote_Header_Id
         ,p_quote_retrieval_number => p_sharee_number
         ,p_validate_user     => FND_API.G_TRUE
         ,p_privilege_type_code => 'A'
    ,p_save_type => PLACE_ORDER
    ,p_last_update_date => p_last_update_date
    ,x_return_status => x_return_status
    ,x_msg_count => x_msg_count
    ,x_msg_data => x_msg_data
    from this u can see that there no value passed for party id and account id .
    Thanks
    Mark

  • 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

  • Issue when creating sales order with Sold-to/Ship-to Party's state

    Hi All,
    we have issue while creating Sales Order with picking up of State tax
    for Ship-to-party & Sold-to-party.
    <b>When we create a sales order, for the sold to party 140052732 and
    ship to party 140052733 it is picking state tax. Which should not
    suppose to pick? Because the partner is marked as tax exemption</b>.
    Can any body tell me how can we solve this issue!
    Why this is happening!
    How to make not to pick tax when it is marked for tax exemtion.
    As i am not Functional guy i am not aware what is happening here!
    Can anybody solve this issue!
    Thanks in advance.
    Thanks,
    Deep.

    Hi Deep
    What do you mean by "It is picking up state tax"? Does it mean that in the pricing procedure it is picking up a condition type which is meant for state tax?
    If so go and check the condition record meant for it. Follow the following steps
    1) Go to Sales order
    2) Select the line item for which the state tax is being picked.
    3) In the condition tab select analysis.
    4) In Analysis you shall find the condition type meant for state tax.
    5) See which condition record has been found.
    6) Go to VK12, enter the state tax condition type and check the condition record for that state tax.
    7) If wrong correct it.
    8) If anything else come back to the post and inform the details
    Thanks
    Regards
    Sunil

  • Issue when creating sales order with Sold-to/Ship-to Party's state tax

    Hi All,
    we have issue while creating Sales Order with picking up of State tax
    for Ship-to-party & Sold-to-party.
    <b>When we create a sales order, for the sold to party 140052732 and
    ship to party 140052733 it is picking state tax. Which should not
    suppose to pick? Because the partner is marked as tax exemption</b>.
    Can any body tell me how can we solve this issue!
    Why this is happening!
    How to make not to pick tax when it is marked for tax exemtion.
    As i am not Functional guy i am not aware what is happening here!
    Can anybody solve this issue!
    Thanks in advance.
    Thanks,
    Deep.

    Hi Deep
    What do you mean by "It is picking up state tax"? Does it mean that in the pricing procedure it is picking up a condition type which is meant for state tax?
    If so go and check the condition record meant for it. Follow the following steps
    1) Go to Sales order
    2) Select the line item for which the state tax is being picked.
    3) In the condition tab select analysis.
    4) In Analysis you shall find the condition type meant for state tax.
    5) See which condition record has been found.
    6) Go to VK12, enter the state tax condition type and check the condition record for that state tax.
    7) If wrong correct it.
    8) If anything else come back to the post and inform the details
    Thanks
    Regards
    Sunil

  • 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.

  • Creating sales order using bapi

    while creating sales order using bapi serial no is added in dat but its not saving.
    plz reply

    Hi
    See tha sample code for sales order creation
    SALES ORDER INPUT CREATION.
    PARAMETERS: p_auart TYPE auart OBLIGATORY.
    PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
    PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
    PARAMETERS: p_spart TYPE vtweg OBLIGATORY.
    PARAMETERS: p_sold TYPE kunnr OBLIGATORY.
    PARAMETERS: p_ship TYPE kunnr OBLIGATORY.
    *ITEM
    PARAMETERS: p_matnr TYPE matnr OBLIGATORY.
    PARAMETERS: p_menge TYPE kwmeng OBLIGATORY.
    PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
    PARAMETERS: p_itcat TYPE pstyv OBLIGATORY.
    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.
    HEADER DATA
    header-doc_type = p_auart.
    headerx-doc_type = 'X'.
    header-sales_org = p_vkorg.
    headerx-sales_org = 'X'.
    header-distr_chan = p_vtweg.
    headerx-distr_chan = 'X'.
    header-division = p_spart.
    headerx-division = 'X'.
    headerx-updateflag = 'I'.
    PARTNER DATA
    partner-partn_role = 'AG'.
    partner-partn_numb = p_sold.
    APPEND partner.
    partner-partn_role = 'WE'.
    partner-partn_numb = p_ship.
    APPEND partner.
    ITEM DATA
    itemx-updateflag = 'I'.
    item-itm_number = '000010'.
    itemx-itm_number = 'X'.
    item-material = p_matnr.
    itemx-material = 'X'.
    item-plant = p_plant.
    itemx-plant = 'X'.
    item-target_qty = p_menge.
    itemx-target_qty = 'X'.
    item-target_qu = 'EA'.
    itemx-target_qu = 'X'.
    item-item_categ = p_itcat.
    itemx-item_categ = '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
    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 WORK AND WAIT.
    WRITE: / 'Document ', v_vbeln, ' created'.
    ENDIF.
    after that check in the table VBAP whether serial number is cretaed or not
    Reward points if useful
    Regards
    Anji

  • Creating sales order using ' BAPI_SALESORDER_CREATEFROMDAT1'

    Hi ,
    i have a problem in creating sales order using ' BAPI_SALESORDER_CREATEFROMDAT1 '  .
    order number is created and every thing unless the order quantity isn't created for material item .
    my inputs are .
    in "ORDER_HEADER_IN"
    (DOC_TYPE , SALES_ORG , DISTR_CHAN , DIVISION ,SALES_OFF )
    in " ORDER_ITEMS_IN"
    (MATERIAL ,PLANT ,REQ_QTY  )
    in "ORDER_PARTNERS"
    (PARTN_ROLE , PARTN_NUMB)
    so the order created but as i say the the order quqntity isn't created for the material  so the "net value and maertial net valve )
    aren't calcoluted .
    << Moderator message - Everyone's problem is important. But the answers in the forum are provided by volunteers. Please do not ask for help quickly. >>
    waiting .
    thanks for all
    Edited by: Rob Burbank on Jan 7, 2011 4:28 PM

    Hi Mr. Ahmed Tohamy,
    my point is just create a schedule line with each item line. The relevant code we used was (excerpt)
    perform bapi_map_filled using:
          lv_matnr      'MATERIAL'   space
            changing ls_in    ls_inx,
          lv_tax_class1 'TAX_CLASS1' gc_true
            changing ls_in    ls_inx,
          lv_qty        'TARGET_QTY' space
            changing ls_in    ls_inx, "QTY to item line
          lv_qty        'REQ_QTY'    space
            changing ls_schdl ls_schdlx,"QTY to schedule line
          lv_itm_number 'ITM_NUMBER' space
            changing ls_in    ls_dummy,
          lv_itm_number 'ITM_NUMBER' space
            changing ls_schdl ls_dummy,
          lv_ref_doc_ca 'REF_DOC_CA' space
            changing ls_in    ls_inx,
          lv_orderid    'ORDERID'    space
            changing ls_in    ls_inx,
          lv_ref_doc    'REF_DOC'    space
            changing ls_in    ls_inx.
        append:
          ls_in       to pt_order_items_in,
          ls_inx      to pt_order_items_inx,
          ls_schdl    to pt_order_schdl,
          ls_schdlx   to pt_order_schdlx.
    Here the quantity is put to item line and schedule line, we always mark the correspoing X structure fields:
    *&      Form  bapi_map_filled
    *       if the value passed is not initial, it is moved to the field
    *       and the corresponding (BAPI-) X-field is marked
    *       if no x-structure is required, a dummy structure is passed
    *       if p_initial parameter is filled, initial fields will be marked
    *       in x-structure. Purpose: transfer of initial values to BAPI
    form bapi_map_filled using    p_value      type any
                                  p_fieldname  type fieldname
                                  p_initial    type flag
                         changing p_structure  type any
                                  p_structurex type any.
      field-symbols:
        <any> type any,
        <c>   type c.
      check:
         not ( p_value is initial and p_initial is initial ).
      assign:
        component p_fieldname of structure p_structure to <any>,
        component p_fieldname of structure p_structurex to <c>.
      <any> = p_value.
      check <c> is assigned.
      <c> = gc_true.
    endform.                    " bapi_map_filled
    Also, we did something to create conditions (i.e. tax) but I think that was project-specific.
    We used BAPI_SALESORDER_CREATEFROMDAT2, I do not know about BAPI_SALESORDER_CREATEFROMDAT1.
    Regards,
    Clemens

  • 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

  • Creating sales order using BDC

    I need to create sales order using BDC by reading material from material master(R/3) and customer from
    customer master(R/3).
    For example. combination should be like this
                Customer1 + Material 1 = Sales order 1
                Customer2 + Material 2 = Sales order 2
    Other than customer and material, all other values are fixed... Could you please help me......

    Hi,
    Better go for BDC rather then BAPI for this requirement.
    Simply, record the transaction and upload the data, Hope you know how it works.
    Try this, In case of any clarification feel free to reply.
    Regards,
    Vikas

  • 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

Maybe you are looking for

  • Worst customer support from HP

    Regarding CASE_ID_NUM: [edited personally identifiable information] and [edited personally identifiable information] initially registered on July 1st week. This is regarding the display issue of my 6 month old HP Pavilion 15-n207TU NB.  They said the

  • Wacom Tablet help

    Earlier I was using a wacom tablet in adobe cs3 just fine, now I get no tip sensitivity. As in, the pen will always draw a think line no matter how light I use the pen. Any help would be great

  • Calling BPEL service using axis client

    Hi, I have created and deployed simple BPEL process and i am trying to invoke this BPEL process using axis client. deployed BPEL wsdl is as follows <?xml version="1.0" encoding="UTF-8" ?> - <definitions name="SimpleProcess" targetNamespace="http://xm

  • WebDAV repository and incremental update

    Hi guys Does any of you know what is needed in order to make incremental update work when you have configured a WebDAV repository manager? Is it only neccessary to check "Send events" or do you also have to activate some services like "properties"? A

  • Role Upload - Could not perform action

    Gurus, I am attempting to upload a sampling of R/3 ECC 6.0 roles into the portal (EP6). I have the system connection defined and testing successfully. I unfortunately can not execute the upload function. After defining the selections that I wish to u