Rg: Open Sales Order Uplaod Using BAPI (BAPI_SALESORDER_CREATEFROMDAT2)

Hi Frinds..
I am Creating Program Sales Order Uplaod Progrm using BAPI BAPI_SALESORDER_CREATEFROMDAT2.
All header and Po data uploaded Properly . But Item Leal data not updated.. Please let me know any Conditions need to pass to update item data.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
        EXPORTING
          salesdocumentin      = v_extr
          order_header_in      = l_vbak
          order_header_inx     = l_vbakx
          behave_when_error    = 'P'
        IMPORTING
          salesdocument        = v_vbeln
        TABLES
          return               = return
          order_items_in       = l_vbap
          order_items_inx      = l_vbapx
          order_partners       = l_vbpa
          order_schedules_in   = l_shline
          order_schedules_inx  = l_shlinex .
I can pass like that.

hi Prabu,
It is not uploading for company code 1100 ..

Similar Messages

  • Sales Order Creation using bapi BAPI_SALESORDER_CREATEFROMDAT2

    Please help me..
    I am using BAPI_SALESORDER_CREATEFROMDAT2 for creating sales order
    can you please tell me in which field the quantity(of items) is to be populated.
    i am populating in BAPISDITM-TARGET_QTY but i am not getting quantity field after sales order is created.
    i also tried with BAPISDITM-TRG_QTY_NO but i am not getting .
    and also if i provide ship to number it is automatically taking the adress but if i want to give my own adress in which structure i have to populate

    Please help me..
    I am using BAPI_SALESORDER_CREATEFROMDAT2 for creating sales order for replace VA01, 
    can you please tell me in which field the amount KBETR (of items) is to be populated.
    i thing that i will populate COND_VALUE in ORDER_CONDITIONS_IN with field kbetr but I don't know what will I populate field COND_TYPE ? the same problem I have with net value (NETWR).
    Would you explain me what I will populate fields  in differents fields of this BAPI ?

  • Program for Sales Order cretaion using BAPI BAPI_SALESORDER_CREATEFROMDAT2

    Hi All,
    Can any one please give me one modal program which uses the BAPI 'BAPI_SALESORDER_CREATEFROMDAT2' to create Sales Orders...
    Thank You very much in advance.....................

    Hi Krishna ,
    Please check the below links .
    [http://www.sap-basis-abap.com/abap/bapi-sample-to-upload-data-from-flat-file-to-va01.htm]
    [http://abapreports.blogspot.com/2008/06/bapi-sample-code-for.html] -- > Select and Copy from this one.

  • Mass sales order creation using BAPI

    Dear All,
    Can anyone help in  mass sales order creation using Bapi BAPI_SALESORDER_CREATEFROMDAT2.
    For example if i want to create 3 sales order with three item per order . i am populating
    HEADER = 3 Records
    Item   = 9 records
    schedule = 9 records
    partner  = 1 record.
    Then after populating the records I am calling Bapi BAPI_SALESORDER_CREATEFROMDAT2
    to create order. It should have created three order but unfortunately it creates
    only one sales order. I debugged and found that records are correct both in header,
    item, scheudle and partners.
    Could you please guide me what I am missing for creation of mass orders.
    I appreciate your time and many thanks in advance.
    cheers
    chandra

    Hi Chandra,
    Do like this.
    Loop at Header table into wa_header.
    *-- Move BAPI Header data
    Loop at item table into wa_item where condition.
    *--  in this move all Item and Schedule line item  to the BAPI.
      At end of item .
    Use the below function modules.
    BAPI_SALESORDER_CREATEFROMDAT2
    BAPI_TRANSACTION_COMMIT.
    Endloop.
    Endloop.
    Regards,
    Balavardhan.K

  • Change only material qunatity in sales order by using BAPI

    Hi All,
    How to change only the material quantity in existing sales order by using BAPI.
    Please help me in this regards.
    Regards
    Deekshitha.

    Hi
    See the sample code and do accordingly
    REPORT Z_SALES_ORDER_CHANGE
    NO STANDARD PAGE HEADING
    LINE-SIZE 132
    LINE-COUNT 65(0)
    MESSAGE-ID ZZ.
    TABLES: VBAP.
    DATA:
    V_FILEIN(90) TYPE C,
    V_RECIN TYPE I,
    V_RECVBAP TYPE I,
    V_RECORDER TYPE I,
    V_VBELN LIKE VBAP-VBELN,
    ORDERHEADERINX LIKE BAPISDH1X.
    DATA: BEGIN OF I_ORDERS OCCURS 0,
    VBELN LIKE VBAK-VBELN,
    POSNR LIKE VBAP-POSNR,
    BRGEW(18) TYPE C,
    VOLUM(18) TYPE C,
    END OF I_ORDERS.
    DATA: BEGIN OF I_OUTPUT OCCURS 0,
    VBELN LIKE VBAK-VBELN,
    POSNR LIKE VBAP-POSNR,
    GEWEI LIKE VBAP-GEWEI,
    BRGEW LIKE VBAP-BRGEW,
    VOLUM LIKE VBAP-VOLUM,
    CKWGT TYPE C,
    CKVOL TYPE C,
    END OF I_OUTPUT.
    DATA: BEGIN OF ORDERITEMIN OCCURS 0.
    INCLUDE STRUCTURE BAPISDITM.
    DATA: END OF ORDERITEMIN.
    DATA: BEGIN OF ORDERITEMINX OCCURS 0.
    INCLUDE STRUCTURE BAPISDITMX.
    DATA: END OF ORDERITEMINX.
    DATA: BEGIN OF RETURN OCCURS 0.
    INCLUDE STRUCTURE BAPIRET2.
    DATA: END OF RETURN.
    DATA: BEGIN OF BAPIRETURN OCCURS 0.
    INCLUDE STRUCTURE BAPIRET2.
    DATA: END OF BAPIRETURN.
    PARAMETERS:
    P_PATH(45) TYPE C DEFAULT '/usr/users/ftpsapom/' LOWER CASE,
    P_FNAME(32) TYPE C DEFAULT '/sweetjo.txt' LOWER CASE.
    START-OF-SELECTION.
    CONCATENATE PATH AND FILE NAME INTO ONE VARIABLE
    CONCATENATE P_PATH P_FNAME INTO V_FILEIN.
    OPEN DATASET
    IF V_FILEIN IS INITIAL.
    MESSAGE E002 WITH 'FILE' V_FILEIN 'DOES NOT CONTAIN ANY DATA!'.
    ELSE.
    OPEN DATASET V_FILEIN
    FOR INPUT
    IN TEXT MODE.
    IF SY-SUBRC = 0.
    READ DATASET
    DO.
    READ DATASET V_FILEIN INTO I_ORDERS.
    IF SY-SUBRC = 0.
    APPEND I_ORDERS.
    ELSE.
    EXIT.
    ENDIF.
    ENDDO.
    CLOSE DATASET
    CLOSE DATASET V_FILEIN.
    IF SY-SUBRC <> 0.
    MESSAGE E002 WITH 'ERROR - CLOSING' V_FILEIN.
    ENDIF.
    ELSE.
    MESSAGE E002 WITH 'ERROR - COULD NOT OPEN' V_FILEIN.
    ENDIF.
    ENDIF.
    SORT AND REMOVE DUPLICATES FROM I_ORDERS
    SORT I_ORDERS BY VBELN POSNR.
    DELETE ADJACENT DUPLICATES FROM I_ORDERS.
    POPULATE I_OUTPUT
    LOOP AT I_ORDERS.
    SHIFT I_ORDERS-POSNR LEFT DELETING LEADING SPACE.
    CONCATENATE '0' I_ORDERS-POSNR INTO I_ORDERS-POSNR.
    SELECT SINGLE BRGEW VOLUM
    FROM VBAP
    INTO (VBAP-BRGEW, VBAP-VOLUM)
    WHERE VBELN = I_ORDERS-VBELN
    AND POSNR = I_ORDERS-POSNR.
    IF SY-SUBRC = 0.
    IF VBAP-BRGEW = 0.
    I_OUTPUT-CKWGT = 'X'.
    ENDIF.
    IF VBAP-VOLUM = 0.
    I_OUTPUT-CKVOL = 'X'.
    ENDIF.
    I_OUTPUT-VBELN = I_ORDERS-VBELN.
    I_OUTPUT-POSNR = I_ORDERS-POSNR.
    I_OUTPUT-GEWEI = 'ST'.
    I_OUTPUT-BRGEW = I_ORDERS-BRGEW.
    I_OUTPUT-VOLUM = I_ORDERS-VOLUM.
    APPEND I_OUTPUT.
    CLEAR: I_OUTPUT.
    ENDIF.
    V_RECIN = V_RECIN + 1.
    ENDLOOP.
    POPULATE BAPI DATA AND RUN BAPI
    CLEAR: ORDERHEADERINX, ORDERITEMIN, ORDERITEMINX,
    RETURN, BAPIRETURN.
    REFRESH: ORDERITEMIN, ORDERITEMINX, RETURN, BAPIRETURN.
    ORDERHEADERINX-UPDATEFLAG = 'U'.
    LOOP AT I_OUTPUT WHERE CKWGT = 'X' OR CKVOL = 'X'.
    V_RECVBAP = V_RECVBAP + 1.
    IF I_OUTPUT-VBELN <> V_VBELN AND SY-TABIX <> 1.
    V_RECORDER = V_RECORDER + 1.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
    SALESDOCUMENT = V_VBELN
    ORDER_HEADER_INX = ORDERHEADERINX
    TABLES
    RETURN = RETURN
    ORDER_ITEM_IN = ORDERITEMIN
    ORDER_ITEM_INX = ORDERITEMINX.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    WAIT = 'X'
    IMPORTING
    RETURN = BAPIRETURN.
    WRITE OUT RETURN
    LOOP AT RETURN.
    WRITE: / RETURN.
    ENDLOOP.
    WRITE: / BAPIRETURN.
    SKIP.
    CLEAR: ORDERITEMIN, ORDERITEMINX,
    RETURN, BAPIRETURN.
    REFRESH: ORDERITEMIN, ORDERITEMINX, RETURN, BAPIRETURN.
    ENDIF.
    ORDERITEMIN-ITM_NUMBER = I_OUTPUT-POSNR.
    ORDERITEMIN-UNTOF_WGHT = I_OUTPUT-GEWEI.
    IF NOT I_OUTPUT-CKWGT IS INITIAL.
    ORDERITEMIN-GROSS_WGHT = I_OUTPUT-BRGEW.
    ORDERITEMINX-GROSS_WGHT = 'X'.
    ENDIF.
    IF NOT I_OUTPUT-CKVOL IS INITIAL.
    ORDERITEMIN-VOLUME = I_OUTPUT-VOLUM.
    ORDERITEMINX-VOLUME = 'X'.
    ENDIF.
    APPEND ORDERITEMIN.
    ORDERITEMINX-ITM_NUMBER = I_OUTPUT-POSNR.
    ORDERITEMINX-UNTOF_WGHT = 'X'.
    ORDERITEMINX-UPDATEFLAG = 'U'.
    APPEND ORDERITEMINX.
    V_VBELN = I_OUTPUT-VBELN.
    ENDLOOP.
    RUN BAPI ON LAST ORDER
    IF NOT ORDERITEMIN IS INITIAL.
    V_RECORDER = V_RECORDER + 1.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
    SALESDOCUMENT = V_VBELN
    ORDER_HEADER_INX = ORDERHEADERINX
    TABLES
    RETURN = RETURN
    ORDER_ITEM_IN = ORDERITEMIN
    ORDER_ITEM_INX = ORDERITEMINX.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    WAIT = 'X'
    IMPORTING
    RETURN = BAPIRETURN.
    WRITE OUT RETURN
    LOOP AT RETURN.
    WRITE: / RETURN.
    ENDLOOP.
    WRITE: / BAPIRETURN.
    SKIP.
    ENDIF.
    WRITE OUT RECORD COUNT FROM FILE
    WRITE: / 'RECORD COUNT FROM FILE ', V_RECIN.
    SKIP.
    WRITE OUT RECORD COUNT FROM FILE
    WRITE: / 'RECORD COUNT OF LINES TO CHANGE ', V_RECVBAP.
    SKIP.
    WRITE OUT RECORD COUNT FROM FILE
    WRITE: / 'RECORD COUNT OF ORDERS TO CHANGE ', V_RECORDER.
    SKIP.
    TOP OF PAGE
    TOP-OF-PAGE.
    WRITE:/1(5) TEXT-H01, 6(8) SY-DATUM MM/DD/YY,
    100(8) TEXT-H02, 126(8) SY-PAGNO.
    WRITE:/1(5) TEXT-H03, 6(8) SY-UZEIT USING EDIT MASK '__:__:__',
    20(77) TEXT-H04,
    100(8) TEXT-H05, 108(25) SY-REPID.
    WRITE:/1(6) TEXT-H06, 8(12) SY-UNAME,
    20(4) TEXT-H07, 25(32) SY-HOST,
    100(13) TEXT-H08, 121(8) SY-SYSID,
    129 '/', 130(3) SY-MANDT.
    ULINE.
    SKIP.
    Reward points if useful
    Regards
    Anji

  • Reena Prabhakar - Sales order creation Using BAPI

    Hi Reena,
    This is Dinesh,i also face problem in Sales order creation using BAPI if you can send me the code it would be great help to me.
    Regards,
    Dinesh

    Anyhow, here is the code that I am using currently which works perfectly well. Not sure if it will be of any help to you, since the values to the BAPI come from the Webdynpro application. I have values stored in my "Test data directory" which I use for testing from the backend.
    FUNCTION ztest.
    Call the BAPI to create Sales Order
      CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
        EXPORTING
          order_header_in     = l_order_header
        IMPORTING
          salesdocument       = l_salesdocument
        TABLES
          return              = it_return
          order_items_in      = it_order_items
          order_partners      = it_order_partners
          order_schedules_in  = it_order_schdl
          order_conditions_in = it_order_conditions
          order_text          = it_order_text.
      READ TABLE it_return WITH KEY type = 'E'.
      IF sy-subrc = 0.
    *-- error occured
        CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
      ELSE.
    *-- no error
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
      ENDIF.
    ENDFUNCTION.

  • Need sales order creation using bapi in oops

    need code for sales order creation using bapi in oops

    hi rocky,
              could you pls give a bit explanation on what you are expecting.
    regards,
    Pavan

  • Open sales order migration using lsmw

    Hello guys iam migrating open sales order and iam having header  fields
    AUART
    VKORG
    VTWEG
    SPART
    KUNNR
    KUNNR
    BSTKD
    BSTDK
    VBEGDAT
    VENDDAT
    item fields  are
    MATNR
    ZMENG
    SPART
    ISMACTIVATION
    what is the standard object available for this migration in lsmw.?i thought of using
    0090 salesdocument standrd object using direct input method but field ismactivation is not available in that object.
    if i go for bapi method salesorder_createfromdat2 i couldnt find the above fields for mapping in that object.but some of the guys in this forum used this bapi method  for this type of migration i dnt how they did it can u please suggest solution for this .
    Regards
    Janapathi

    Hi!
    In the given BAPI, the field names are different. You have to match them using their description or data type.
    If you check this BAPI in transaction SE37, on hte Import tab, click on the BAPISDHD1ref type.
    Here you can find the field DOC_TYPE (type AUART). With this way, you can find the matching fields.
    Regards
    Tamá

  • How to update VBFA while sales order creation using BAPI

    Hi,
    I am trying to create sales orders for each schedule line items while inquiry creation.
    This I have done in the user exit in the VA11 program MV45AFF using BAPI "BAPI_SALESORDER_CREATEFROMDAT2".
    along with the Inquiry, Sales orders are also getting created. But I am facing 2 problems.
    1) BAPI is not returning the sales order number to the program but when checked from SE37 it is returning the sales order   
        number.
    2) It is not updating the VBFA (SD flow) table.
    Regards,
    Krishna.

    Hello,
    1) BAPI is not returning the sales order number to the program but when checked from SE37 it is returning the sales order
    number.
    - are you passing simulation parameter (TESTRUN) as 'X'
    2) It is not updating the VBFA (SD flow) table.
    - Please use BAPI_SALESDOCUMENT_COPY for copying and updating VBFA table
    Thanks
    Krish

  • SQL Open Sales Orders Value using today's currency rates

    Hi experts,
    I am creating a report for displaying the open sales order values (and other fields) using current currency rate (where applicable). I developed the below query. The only problem with this query is that it ignores the order rows in which the currency field is blank (Don't understand why this happens in SAP). Do you have other ideas?
    Thanks & Regards,
    IC
    SELECT 
    T0.DocNum as 'Sales Ord No', T0.DocDate as "Ord Date",  T0.CardCode as "Cust Code",  T0.CardName as "Customer Name",  T1.ItemCode, 
    T1.Dscription,  T3.ItmsGrpNam,  T1.U_SU,  T1.U_SULEN,  T1.U_SUQTY,  T2.InvntryUom as 'Stock UOM',  T1.Quantity as 'Ord Qty', T1.Quantity*T2.U_ITWTSTU as 'Weight (KG)', T1.Quantity-T1.OpenQty as "Qty Delivered", T1.OpenQty as 'Bal Qty', T1.Price*T1.Quantity/T4.Rate AS "Ord Value (GBP)", T1.Price*T1.OpenQty/T4.Rate  AS "Open Qty Val (GBP)", T1.Price/T4.Rate  AS "Price (GBP)", T1.Price*T1.OpenQty as "Ord Value (BP Currency)", T1.Price as 'Price (BP Curr)', T1.Currency as 'Cur Ind', T4.[Rate] AS 'Curr Rate', T0.DocDueDate as "Due Date",  T1.WhsCode as 'Del WHG'
    FROM ORDR T0  INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode INNER JOIN OITB T3 ON T2.ItmsGrpCod = T3.ItmsGrpCod, ORTT T4 WHERE T0.DocCur <> 'GBP' AND T1.Currency=T4.Currency AND T4.[RateDate] = [%0] AND T1.OpenQty > 0
    UNION ALL
    SELECT
    T0.DocNum as 'Sales Ord No', T0.DocDate as "Ord Date", T0.CardCode as "Cust Code", T0.CardName as "Customer Name", T1.ItemCode, T1.Dscription, T3.ItmsGrpNam, T1.U_SU, T1.U_SULEN, T1.U_SUQTY, T2.InvntryUom as 'Stock UOM', T1.Quantity as 'Ord Qty', T1.Quantity*T2.U_ITWTSTU as 'Weight (KG)', T1.Quantity-T1.OpenQty as "Qty Delivered", T1.OpenQty as 'Bal Qty', T1.LineTotal AS "Ord Value (GBP)", T1.LineTotal/T1.Quantity*T1.OpenQty AS "Open Qty Val (GBP)", T1.LineTotal/T1.Quantity AS "Price (GBP)", T1.Price*T1.OpenQty as "Ord Value (BP Currency)",T1.Price as 'Price (BP Curr)', T1.Currency as 'Cur Ind', T1.[Rate] AS 'Curr Rate', T0.DocDueDate as "Due Date", T1.WhsCode as 'Del WHG'
    FROM ORDR T0  INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode INNER JOIN OITB T3 ON T2.ItmsGrpCod = T3.ItmsGrpCod WHERE T0.DocCur = 'GBP'  AND T1.OpenQty > 0 ORDER BY 2,1

    Hi,
    Try:
    SELECT 
    T0.DocNum as 'Sales Ord No', T0.DocDate as "Ord Date",  T0.CardCode as "Cust Code",  T0.CardName as "Customer Name", 
    T1.ItemCode,  T1.Dscription,  T3.ItmsGrpNam,  T1.U_SU,  T1.U_SULEN,  T1.U_SUQTY,  T2.InvntryUom as 'Stock UOM', 
    T1.Quantity as 'Ord Qty', T1.Quantity*T2.U_ITWTSTU as 'Weight (KG)', T1.Quantity-T1.OpenQty as "Qty Delivered",
    T1.OpenQty as 'Bal Qty', T1.Price*T1.Quantity/T4.Rate AS "Ord Value (GBP)",
    T1.Price*T1.OpenQty/T4.Rate  AS "Open Qty Val (GBP)", T1.Price/T4.Rate  AS "Price (GBP)",
    T1.Price*T1.OpenQty as "Ord Value (BP Currency)", T1.Price as 'Price (BP Curr)',
    T1.Currency as 'Cur Ind', T4.[Rate] AS 'Curr Rate', T0.DocDueDate as "Due Date",  T1.WhsCode as 'Del WHG'
    FROM ORDR T0  INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry
    INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode
    INNER JOIN OITB T3 ON T2.ItmsGrpCod = T3.ItmsGrpCod
    LEFT JOIN ORTT T4 ON T1.Currency=T4.Currency AND T4.[RateDate] = [%0] AND T4.Rate != 0
    WHERE T0.DocCur != 'GBP' AND AND T1.OpenQty > 0
    Thanks,
    Gordon

  • Error in sales order creation using bapi

    Hi,
    Iam trying to create sales order by using BAPI_SALESORDER_CREATEFROMDAT1 and when iam trying to execute
    the function module by passing all th eparameters and iam getting the error as
    inspite of entering sold_to_party and ship_to_party details in table ORDER_PARTNERS
    "enter the sold_to_party or ship to party details"
    please help me out in this isue its an urgent.
    Thanks.
    sayed.

    Can you share the codes ?
    Thanks.
    Ashish

  • Problem in Sales order create using BAPI with reference to quotation

    Hi,
    I am creating a sales order from Quotation using BAPI /AFS/BAPI_SALESORD_CREATEFDATA.
    The Sale order is getting created and the document flow is updated. When i check the status of quotation it is "OPEN".
    Ideally when a sale order is created in VA01 with reference to a quotation and if all items are added in the order from quotation, then the status of the quotation must be "Complete".
    When i use the BAPI, the status of the quotation is sill "Open". Has anyone faced this issue?
    Even if anyone has faced this issue with BAPI_SALESORDER_CREATEFROMDAT2, please let me know...
    Regards

    Hi RV,
    I am using BAPI  to create order reference to contracts. I am facing same issue. Its not updating document flow (vbfa-plmin field). After creating orders I am forcing to update plmin field in vbfa. This worked fine. But now status in reference document not updating properly. I saw your thread. It looks like similar issue. I saw your comments "Customization was not maintained properly for the Order types ". Please can you explain little bit more about your solution. It will helps us lot.
    Thanks,
    srini

  • Creating sale order by using BAPI

    Hi,
    My requirement is to create a inquiry(VA11),  By using the Inquiry no as a input in report, i should create a salesorder using BAPI in which the datas should be flowed from inquiry to sale order. i did almost everything except the Pricing Condition.
        I am fetching the pricing condition values from table KONV-KSCHL and passing the value via BAPI_SALESORDER_CREATEFROMDAT2 it creates saleorder. In the created salesorder, there are two  same pricing conditions  but different rate 1.) the price of the MATNR which is maintained  2.) the changed MATNR price in inquiry level,
    i need the value which is changed in inquiry level that is 2nd value.
    can anyone help me in this...

    REPORT  ZSALESORDER.
    << Cut and paste without attribution from
    create sales order using BAPI
    removed >>
    Edited by: Rob Burbank on Feb 24, 2009 10:43 AM

  • Populating Customized fields in Sales Order Creation using BAPI

    Hi All,
    I have a requirement that, I need to populate 2 customized fields which are appedned in the VBAK tables through Append structure. I am using BAPI_SALESORDER_CREATEFROMDAT2 FM for creating it.
    Could anybody tell me how to send these 2 coustomized field values in this BAPI using EXTERNIN parameter.
    Regards
    Rajesh
    [email protected]

    Hi,
    To add data to custom fields there are two appraoches.
    <b>1)</b>Using the <b>EXTENSIONIN</b> in the Tables option in the FM <b>BAPI_SALESORDER_CREATEFROMDAT2</b>
    Check the Documentation for the same,
    <b>Customer Enhancement for VBAK, VBAP, VBEP</b>
    <i>Description</i>
    You can use this parameter to transfer user-specific enhancments to a BAPI. The customer has to complete the EXTENSION structure and the system automatically continues processing it. If you have not defined any user-specific fields, then you can transfer a blank EXTENSIONIN structure.
    <b>Technical information about Customer Enhancements</b>
    The following description uses an example to explain how to proceed with customer enhancements to the SD tables VBAK, VBKD, VBAP and VBEP.
    The customer has added their own fields to table VBAP using the INCLUDE structure CUTEST. This structure contains 2 fields:
    CFIELD1, CHAR 10
    CFIELD2, CHAR 3.
    The customer also requires that these two fields can be maintained with the BAPI.
    1. Maintain structure CUTEST in table VBAP
    2. Because the BAPIs work with checkboxes, you must also define a CUTESTX checkbox for the customer structure. It should be structured like this:
    Field name       Data element
    CFIELD1            CHAR1
    CFIELD2          CHAR1
    3. Define these customer structures in the structures VBAPKOZ und VBAPKOZX using INCLUDE or APPEND.
    4. Add the customer structures to the BAPE_VBAP and BAPE_VBAPX BAPI structures using the APPEND technique.
    5. Adjust the following structures for customer enhancements to table VBAK:
    a) VBAKKOZ
    b) VBAKKOZX
    c) BAPE_VBAK
    d) BAPE_VBAKX
    6. Adjust the following structures for customer enhancements to table VBEK:
    a) VBEPKOZ
    b) VBEPKOZX
    c) BAPE_VBEP
    d) BAPE_VBEPX
    7. Generally, the data should be added to the BAPI interface in the internal communication structures (VBAKKOM, and so on). There, you can process the data in the SD tables (VBAK, and so on).
    8. If the EXTENSIONIN parameter contains customer data, you must complete at least the key fields in the relevant standard parameters.
    <i>For example:</i>
    You want to change customer field VBAP-CFIELD2 for item 20 to "XYZ" in order 4711.
    The following entries are expected:
    Import:     BAPIVBELN-VBELN       = '0000004711'  Document number
                BAPISDHD1X-UPDATEFLAG = 'U'           UPDKZ for doc header
    Tables:     BAPISDITM-ITM_NUMBER  = '000020'      Item number
                BAPISDITMX-ITM_NUMBER = '000020'      Item number
              + BAPISDITMX-UPDATEFLAG = 'U'           UPDKZ for item
    You must complete the EXTENSION table as follows:
    STRUCTURE                          VALUEPART1       1234561234567890123
    BAPE_VBAP                       0000004711000020                 XYZ
    BAPE_VBAPX                      0000004711000020       X
    <b>Further Information</b>
    You can find more information in the BAPI programming guide in the chapter for enhancements to BAPIs.
    Notes
    You must complete the STRUCTURE field with the name of the relevant enhancement structure (BAPE_VBAK, BAPE_VBAP, BAPE_VBEP). You can complete the remaining fields with the append structures from the enhancement structures.
    At the moment, you can use the BAPI to store enhancements in the following structures:
    VBAK : An enhancement to header data requires an append structure to BAPE_VBAK and an enhancement to structure VBAKKOZ.
    VBAP : An enhancement to item data requires an append structure to BAPE_VBAP and an enhancment to structure VBAPKOZ.
    VBEP : An enhancement to schedule line data requires an append structure to BAPE_VBEP and an enhancement to structure VBEPKOZ.
    VBKD : If you are using an enhancement for header data, you must add an append structure to BAPE_VBAK. You also need to enhance structure VBAKKOZ. If it is for item data, you need to add an append structure to BAPE_VBAP. You must also enhance structure VBAPKOZ.
    If you also want to work with checkboxes, each X-structure must also contain an append structure.
    For example:
    A customer has created an order and wants to include the material long text (50 digits long).
    The EXTENSIONIN structure must be completed with BAPE_VBAP. Two fields have fixed definitions in this structure. These are in the VBAP host key (VBELN, POSNR). The customer sets up an append structure that contains field ZMAT50.
    Because the VBELN is normally blank when you create an order, the data can look like this:
    STRUCTURE   |BAPE_VBAP
    <b>2)</b> Create the Sales Document using the FM and when successfully craeted you will get the Sales Document No in the Export parameter <b>SALESDOCUMENT</b>.
    After its created and Committed using <b>BAPI_TRANSACTION_COMMIT</b> , do a <b>BDC</b> recording for the same to (<b>VA02</b> Change Sales Order) update the fields only and save the document.
    Regards,
    AS

  • Problem in lock Sales order create with BAPI BAPI_SALESORDER_CREATEFROMDAT2

    Hi All,
    i have the z program to create the sales order with reff  quotation in SD With BAPI BAPI_SALESORDER_CREATEFROMDAT2.
    this program will  excute every 30 mins .
    Problem: Some times if i excute the program in background it is taking morethan 30mins so second batch excution also gets starting to create the sales order for same quotation then it is creating 2 sales orders at atime with 1 quotation.
    here i am getting duplicate sales orders so i want to lock the creation of duplicate sales order.

    Some solutions
    - Just lock (ENQUEUE) any object at the start of the job(*), if not locked, you can exit or wait in a loop, will be released at end of job (use a _SCOPE '3' so commit work wont release the lock)
    -> This will insure the job runs only once at a time
    - Lock the quotation before calling the BAPI, will be released by the COMMIT_WORK (from where do you fetch the quotation, if it is a customer Z_table, you can use the lock object that you have surely created ?) (use a _scope '2')
    -> This will insure that at most one job will convert a quotation (i suppose you set a "done" flag or status  in the quotation record)
    Read [SAP Locks |http://help.sap.com/abapdocu_70/en/ABENSAP_LOCK.htm] if you are not familiar with the concept of lock in SAP.
    Regards,
    Raymond
    (*) E_TABLEE for table, E_TRDIR for program, anything not required by another process

Maybe you are looking for

  • Error message when importing data using Import and export wizard

    Getting below error message when importing data using IMPORT and EXPORT WIZARD Error 0xc0202009: Data Flow Task 1: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005. <dir> <dir> Messages Error 0xc0202009: Data Fl

  • Please help!! Adobe reader not working

    Hello, My Adobe Reader XI will not open all docs. It says (57) in the message. What can I do? I tried to uninstall all Adobe programs to start fresh but it keeps saying something about the "patch"? I'm doomed over here!! Thank you, Bill V

  • Why I cant use the MSN messenger in my mac?

    I just downloaded the newest version about MSN messenger 5.0. But I cant sign in my msn messenger. I try many times,but it always popup one window says:"Sign in to Microsoft Messenger failed because the service is not available or you ma not be conne

  • Using Spanish characters in CF

    I need help setting my coldfusion application tu show accents ans othe characters that are used in spanish but when I use them it shows a different character.

  • Elements Organizer crashes EVERY time on Macbook pro i7 with 8g ram.

    THis is my Third requst for help- the program doesn't work on my machine, but I meet the specs.. Program doesn't open.. get the splash creen then it crashes. Running a macbook pro, i7 Mavericks, blah blah blah