Problem qty BAPI_SALESORDER_CREATEFROMDAT2

Hello all,
I create a specific function to call BAPI_SALESORDER_CREATEFROMDAT2 via RFC and I have a problem to have a good qty if I view the sales orders via VA03 the qty is equal to 0 and that a good qty is 70,25.Why I don't see a good qty in a field qty KWMENG in VBAP table ?
I verify an debug and I see a good qty 70.25 in the field t_order_items-target_qty
Thanks

hI MADY
DO LIKE THIS
CODE ************************************** 
local data 
DATA: HEADER LIKE BAPISDHD1. 
DATA: I_PARTNERS LIKE BAPIPARNR OCCURS 1 WITH HEADER LINE. 
DATA: I_ITEM LIKE BAPISDITM OCCURS 10 WITH HEADER LINE. 
DATA: I_SCHEDULE LIKE BAPISCHDL OCCURS 10 WITH HEADER LINE. 
DATA: RETURN LIKE BAPIRET2 OCCURS 1 WITH HEADER LINE. 
order header values 
HEADER-DOC_TYPE = 'ZSED'. 
HEADER-SALES_ORG = ZCONSGAGRMWK-VKORG. 
HEADER-DISTR_CHAN = ZCONSGAGRMWK-VTWEG. 
HEADER-DIVISION = ZCONSGAGRMWK-SPART. 
HEADER-PURCH_DATE = ZCONSGACTVSV-TRNACTDAT. 
HEADER-PURCH_NO_C = ZCONSGACTVWK-PONUM. 
HEADER-REF_DOC = ZCONSGAGRMSV-SCHDAGRM. 
HEADER-REFDOC_CAT = 'E'. 
HEADER-***_NUMBER = ZCONSGACTVSV-HUBREFNUM. 
order item level data 
I_ITEM-ITM_NUMBER = '000010'. 
I_ITEM-MATERIAL = ZCONSGACTVSV-MLXPART. 
I_ITEM-ROUTE = CON-ROUTE. 
IF NOT ZCONSGAGRMSV-CHARG IS INITIAL. 
   I_ITEM-BATCH = ZCONSGAGRMSV-CHARG. 
ELSE. 
   I_ITEM-BATCH = '1'. 
ENDIF. 
<b>I_SCHEDULE-ITM_NUMBER = '000010'. 
I_SCHEDULE-REQ_QTY = ZCONSGACTVWK-QTY. 
I_PARTNERS-PARTN_ROLE = 'AG'. " Soldto 
I_PARTNERS-PARTN_NUMB = ZCONSGAGRMSV-SOLDTO.</b> 
APPEND: I_ITEM, 
        I_SCHEDULE, 
        I_PARTNERS. 
CLEAR: I_ITEM, 
       I_SCHEDULE, 
       I_PARTNERS. 
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2' 
     EXPORTING 
SALESDOCUMENTIN = 
             ORDER_HEADER_IN = HEADER 
ORDER_HEADER_INX = 
SENDER = 
BINARY_RELATIONSHIPTYPE = 
INT_NUMBER_ASSIGNMENT = 
BEHAVE_WHEN_ERROR = 
LOGIC_SWITCH = 
TESTRUN = 
CONVERT = ' ' 
     IMPORTING 
             SALESDOCUMENT = ORDER 
     TABLES 
<b>             RETURN = RETURN 
             ORDER_ITEMS_IN = I_ITEM 
ORDER_ITEMS_INX = 
             ORDER_PARTNERS = I_PARTNERS 
             ORDER_SCHEDULES_IN = I_SCHEDULE </b>
ORDER_SCHEDULES_INX = 
ORDER_CONDITIONS_IN = 
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 = 
REGARDS
KISHORE
REWARD IF HELPFUL

Similar Messages

  • Problem on BAPI_SALESORDER_CREATEFROMDAT2

    Hi ,
    I want to populate FISTL ( Fund Centre )  field  of vbap in fm BAPI_SALESORDER_CREATEFROMDAT2.
    How I can do that.

    Hi,
    Here you can add new import parameter by using enhencement point and end of every function module there is one implicit enhencement point where you can write the code for updating the field FISTL.This is possible in ECC6.0.
    Please read below para.
    All application function modules can be enhanced by adding parameters to the standard function module interface. These parameters must be u2018optionalu2019 in nature, since adding a mandatory parameter will require all calls to be changed. Additionally any function module that is part of the Central Basis can not be enhanced (for example: function module u2018POPUP_TO_CONFIRMu2019). From the menu, choose u2018Function module -> Enhance interfaceu2019 to add optional parameters to a function module.
    Thanks,
    radha.

  • Problems with BAPI_SALESORDER_CREATEFROMDAT2

    Hi friends,
    I'm using Function Module --> Test --> Test Sequences and I enter the following sequence:
    BAPI_SALESORDER_CREATEFROMDAT2
    BAPI_TRANSACTION_COMMIT
    Next I run this sequence with any data and I obtain the following result:
    S V4 233 SALES_HEADER_IN has benn processed succesfully
    S V4 233 SALES_ITEM_IN has been processed succesfully
    W V1 555 The sales document is not yet complet: Edit
    S V1 311 Standard order 808 has been saved
    However, if I use transaction V.01 to see incomplete orders this order doesn´t appear. What is wrong in my sequence?
    Thanks.
    Edited by: Jairo Cortes on Feb 24, 2010 2:04 PM

    Hi,
    Pass WAIT = 'X' to BAPI_TRANSACTION_COMMIT and check.
    Regards,
    Ganga

  • Problem with BAPI_SALESORDER_CREATEFROMDAT2

    Hi I have an issues:
    While I am loading Partner function in Patners structure.
    everythign happens fine.
    Even when I am not populating the partner  Customer Contract (ZD). It is being created in my sales order.
    What am I doing wrong.
    Regards,

    Hi,
    Please share the BAPI Call

  • Create sales order with BAPI_SALESORDER_CREATEFROMDAT2 example

    Hi, does anyone have a working example of how to create a sales order using BAPI_SALESORDER_CREATEFROMDAT2?
    Thanks

    hi Robert,
    Check this code...try to map.
    one order with total sum of effort
    clear: l_order_header,
    l_salesdocument,
    l_order_partners,
    l_order_items,
    l_order_schdl.
    refresh: it_order_items,
    it_order_partners,
    it_order_schdl,
    it_return.
    ???????? get from material ...
    Order header
    l_order_header-doc_type = 'ZQBV'.
    l_order_header-distr_chan = '10'.
    l_order_header-division = '00'.
    if g_qals-werk eq '1100'.
    l_order_header-sales_org = '1000'.
    else.
    if g_qals-werk eq '3100'.
    l_order_header-sales_org = '3000'.
    else.
    message i001(00) with text-005.
    endif.
    endif.
    l_order_header-purch_no_c = g_qals-prueflos. " <= lot
    Partner data
    l_order_partners-partn_role = 'AG'.
    l_order_partners-partn_numb = g_qals-kunnr.
    append l_order_partners to it_order_partners.
    Order items => only one
    l_order_items-itm_number = 10.
    l_order_items-material = g_qals-matnr.
    l_order_items-target_qty = 1.
    append l_order_items to it_order_items.
    Schedules for quantity
    l_order_schdl-itm_number = 10.
    l_order_schdl-req_qty = 1. " <= only 1 !
    append l_order_schdl to it_order_schdl.
    Conditions for value
    l_order_conditions-itm_number = 10.
    l_order_conditions-cond_type = 'PR00'.
    l_order_conditions-cond_value = g_effort_sum.
    l_order_conditions-currency = g_effort_unit.
    append l_order_conditions to it_order_conditions.
    BAPI to create sales order
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
    EXPORTING
    SALESDOCUMENTIN =
    ORDER_HEADER_IN = l_order_header
    ORDER_HEADER_INX =
    SENDER =
    BINARY_RELATIONSHIPTYPE =
    INT_NUMBER_ASSIGNMENT =
    BEHAVE_WHEN_ERROR =
    LOGIC_SWITCH =
    TESTRUN =
    CONVERT = ' '
    IMPORTING
    SALESDOCUMENT = l_salesdocument
    TABLES
    RETURN = it_return
    ORDER_ITEMS_IN = it_order_items
    ORDER_ITEMS_INX =
    ORDER_PARTNERS = it_order_partners
    ORDER_SCHEDULES_IN = it_order_schdl
    ORDER_SCHEDULES_INX =
    ORDER_CONDITIONS_IN = it_order_conditions
    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 =
    if not l_salesdocument is initial.
    order successfully created
    message i001(00) with text-001 l_salesdocument.
    endif.
    endif.
    for more info check the below link also
    Problem with BAPI_SALESORDER_CREATEFROMDAT2
    Regards,
    Naveen

  • BAPI_SALESORDER_CREATEFROMDAT2 is not updating the ITEM Qty after Free ITEM

    Hi,
    I am using BAPI_SALESORDER_CREATEFROMDAT2 to create a order.We have customization for populating a FREE ITEM for a Order ITEM.
    Now the Problem is that .....if I am passing more then one Material as ITEM it is not updating the next ITEM Qty and also not populating FREE ITEM afterwords first one.
    Please help me.
    Regards
    Ricky

    Hi,
    Find below the code :
      read table i_table_t into lwa_table_s index 1.
      if sy-subrc eq 0.
    *Order Header
        lwa_ord_head_in-doc_type          = 'ZSO'.
        lwa_ord_head_in-sales_org         = '1000'.
        lwa_ord_head_in-distr_chan        = '10'.
        lwa_ord_head_in-division          = '10'.
        lwa_ord_head_in-req_date_h        = lwa_table_s-delivery.
    *Order Header Update
        lwa_ord_head_inx-doc_type         = 'X'.
        lwa_ord_head_inx-sales_org        = 'X'.
        lwa_ord_head_inx-distr_chan       = 'X'.
        lwa_ord_head_inx-division         = 'X'.
        lwa_ord_head_inx-req_date_h       = 'X'.
        lwa_ord_partners-partn_role       =  'AG'.
        lwa_ord_partners-partn_numb       =  lwa_table_s-sold_to.
        append lwa_ord_partners to lt_ord_partners.
        if lwa_table_s-ship_to is initial.
          lwa_ord_partners-partn_role     =  'WE'.
          lwa_ord_partners-partn_numb     =  lwa_table_s-sold_to.
          append lwa_ord_partners to lt_ord_partners.
        else.
          lwa_ord_partners-partn_role     =  'WE'.
          lwa_ord_partners-partn_numb     =  lwa_table_s-ship_to.
          append lwa_ord_partners to lt_ord_partners.
        endif.
        lt_table_it_t = lwa_table_s-zsd_table_it_t.
        loop at   lt_table_it_t into lwa_table_it_s.
          lwa_ord_items_in-material      = lwa_table_it_s-matnr.
          lwa_ord_items_in-plant         = wa_table_s-plant.
          lwa_ord_items_in-target_qty    = lwa_table_it_s-qty.
          lwa_ord_items_in-comp_quant    = lwa_table_it_s-qty.
          append lwa_ord_items_in to lt_ord_items_in.
          lwa_ord_items_inx-material     = 'X'.
          lwa_ord_items_inx-plant        = 'X'.
          lwa_ord_items_inx-target_qty   = 'X'.
          lwa_ord_items_inx-comp_quant   = 'X'.
          lwa_ord_items_inx-updateflag   = 'I'.
          append lwa_ord_items_inx to lt_ord_items_inx.
    Schedule Line Information
          lwa_schedule_lines-sched_line  = 'X'.
          lwa_schedule_lines-req_date    = lwa_table_s-date_del.
          lwa_schedule_lines-date_type   = '1'.
          lwa_schedule_lines-req_qty     = lwa_table_it_s-qty.
          append lwa_schedule_lines to lt_schedule_lines.
          lwa_schedule_lines_x-updateflag = 'I'.
          lwa_schedule_lines_x-sched_line = 'X'.
          lwa_schedule_lines_x-req_date   = 'X'.
          lwa_schedule_lines_x-date_type  = 'X'.
          lwa_schedule_lines_x-req_qty    = 'X'.
          append lwa_schedule_lines_x to lt_schedule_lines_x.
        endloop.
    Here I am getting First Item and it's free configured Item perfectly for the Qty 1.
    But when I pass more then 1 Qty or Multiple ITEMS it is not populating other respective free configured ITEMS with them.Also IT is not updating the other ITEM Qty other the first one.
    For Example:
    Item  No      ITEM            Qty           .......
    10             ITEM1           1 EA        ..........
    20             FREE1          1 DAY     ..........
    30             ITEM2            0             ..........
    40             ITEM3            0             .........
    In above example After 30 and 40 two Free ITEM should be generated with 1 Day and for Qty 1 EA
    Regards
    Ricky

  • Problem with STORE_LOC in BAPI_SALESORDER_CREATEFROMDAT2

    Hi gurus.
    I'm using BAPI_SALESORDER_CREATEFROMDAT2 to create sales orders and it works almost fine ...
    I've only one problem: is it possible to get automatically the storage?
    If I set the field STORE_LOC in the item, I get that storage in my order, otherwise the storage in the row order is empty.
    But if I insert rows by the transactionVA01/02 I get automatically the storage, I don't need to force it.
    Thanks for your help ...

    Hi
    If Storage Location is assigned against the particular Plant and Shipping point functionally, then using VA01 transaction, it will
    pick the storage location automatically. So when using your BAPI try with passing PLANT or SHIPPING POINT and see whether
    storage location getting populated or not.
    Regards,
    Murali

  • MB5B Report Qty Problem

    Hi All,
            I have some material Qty Problem while selecting different view in MB5B report.
    While in Storage Location view opening & closing stock is same as in valuated Stock,but Issue & recived Qty is doubled in Storage loaction view.i don't have PP & Qm Module.so we are doing PP Entry Thru 521 MVT.
    What is the possiable reaso for this.
    Regards
    Pavan

    Hi,
    MB5B is a standard report in which you will get the stock on particular date.You cna see the stock of previous or previous week.
    If you trying to execute the report with todays date as posting date,then system will consider all teh material movements happened today,so thats y system is showing 2 different stocks at different timings.
    to check what and all material movements happened today  for that material ,go to SE16 ,input table MSEG and check the material documents.take date and timings on which material document is created. then compare this with MB5B report
    Hope it helps

  • BAPI_SALESORDER_CREATEFROMDAT2 & Confirmed Qty NOT being set

    Good day!
    Creating orders via BAPI_SALESORDER_CREATEFROMDAT2.  Orders are being created successfully. However, CONFIRMED QTY is set to 0, and NOT triggering.
    The following settings have been confirmed.
    - Majority of all communication field settings are set to "X" at Header, Item, schedule, and condition.
    - All itm_number are set accordingly to respective posnr
    - All updateflag are set accordingly
    - Set comp_dlv and part_dlv to ' '.
    From a functional perspective, what configurations HAVE to be completed to ensure Deliveries are triggered via respective BAPI?  I understand, availability check is performed in background so screens cannot be performed--thus, no partial or full delivery can be filled.
    Any pointers will be appreciative. Thanks in advance.

    I seem to remember having that issue before.  I believe the fix in that particular case was that the storage location was not specified in the BAPI call for items that were ATP-relevant.  Of course, if your ATP check is at the shipping point level, if you don't specify the shipping point, you won't get a confirmation either.  As usual, I believe I tracked it down with the good old debugger.

  • Problem in total PO qty in print out of PO

    Hi Gurus,
    I'm creating a PO with discount for example i use HB01 (header discount) the original PO qty is 10 pcs after saving and printing of PO the PO qty only show 1 pc only, can u tell me why these happen? can you suggest a solution to fixed these issue?
    when there's no discount in PO the total PO qty in print output it's ok, there's no problem.
    Hoping to your answer.
    Thanks,
    Marina

    HI sujeet,
    Thanks for ur response. i had already checked the printer settings.. i think there is no problem with this. Can u Please suggest something else. thanks
    Hiii jyojit..
    Thanks for reply. I had already checked the said check box in spool admin. but the problem still exists. Please suggest something to get rid of the problem.

  • 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

  • Problem when creating a sales order using BAPI_SALESORDER_CREATEFROMDAT2

    Hello All,
    I am working on a requirement where i  need to create a new sales order from old sales order (Not all the items of the old sales order are to be copied) i am doing this by getting the data using BAPISDORDER_GETDETAILEDLIST to get the old sales order details and send them to BAPI_SALESORDER_CREATEFROMDAT2.
    My problem is that i when i send the condition also the system in addition to the conditions sent to the BAPI is also automatically proposing the condition types . So the final result is that the sales order ends up having the condition types twice .
    For example VPRS AZWR are visible twice in the sales order.
    Any inputs to solve the problem will be definitely rewarded.
    Thanks in advance.
    Regards,
    Sowmya.

    Hello All,
    I am working on a requirement where i  need to create a new sales order from old sales order (Not all the items of the old sales order are to be copied) i am doing this by getting the data using BAPISDORDER_GETDETAILEDLIST to get the old sales order details and send them to BAPI_SALESORDER_CREATEFROMDAT2.
    My problem is that i when i send the condition also the system in addition to the conditions sent to the BAPI is also automatically proposing the condition types . So the final result is that the sales order ends up having the condition types twice .
    For example VPRS AZWR are visible twice in the sales order.
    Any inputs to solve the problem will be definitely rewarded.
    Thanks in advance.
    Regards,
    Sowmya.

  • Update sales order qty through BAPI_SALESORDER_CREATEFROMDAT2

    HI
    Can anybody help me out.  I have the requirement for creating sales order through BAPI_SALESORDER_CREATEFROMDAT2. The sales order is created but with 0 quantity.
    I am using fields RNDDLV_QTY and TARGET_QTY and REQ_QTY in schedule lines & also setting the update indicator to 'X'  in the corresponding itemx structures.
    In fact it used to work earlier and has stopped now. I am also checking if there could be any change in configuration but don't think this should be the reason.
    Can someone guide me as to which quantity fields of the BAPI are the right ones to update sales order qty?
    thanks

    Hi,
    You are using the correct fields i.e. TARGET_QTY and REQ_QTY. Just check if you are passing the same Item Number in both the tables.
    Hope it helps...
    Lokesh

  • BAPI_SALESORDER_CREATEFROMDAT2 - Problem with price

    Hi
      I'm trying to create a Sales Document with the BAPI_SALESORDER_CREATEFROMDAT2 with SE37, i don't know what is missing, because it gives me the order number but when i call the BAPI_TRANSACTION_COMMIT,  it doesn't create the document, the result of the BAPI_SALESORDER_CREATEFROMDAT2 is next:
    S V4233SALES_HEADER_IN has been processed successfully   
    S V4233SALES_ITEM_IN has been processed successfully     
    W V1555The sales document is not yet complete: Edit data 
    S V1311Pedido Nacional 0000281711 has been saved         
    I feel the problem is in the parameters i'm sending, because i'm creating a sales order with VA01, and when debugging the BAPI and VA01, comparing table XVBAP at BAPI and VA01, i have difference at XVBAP-KWMENG and XVBAP-NETWR, at the BAPI'S table i don't have data, and at the VA01 transaction i have it, i give the parameters i'm sending so maybe somebody can help me.
    <b>ORDER_HEADER_IN</b>
    DOC_TYPE
    SALES_ORG
    DISTR_CHAN
    DIVISION
    REQ_DATE_H
    PURCH_DATE
    INCOTERMS1
    PMNTTRMS
    PRICE_DATE
    PURCH_NO_C
    <b>ORDER_ITEMS_IN</b>
    MATERIAL
    PLANT
    TARGET_QTY
    TARGET_QU
    INCOTERMS1
    ROUTE
    <b>ORDER_PARTNERS</b>
    PARTN_ROLE       
    PARTN_NUMB  
    And that's all.
    Thanks
    Best Regards.
    Soraya Cervantes

    Soraya,
    You need to pass in the Pricing COnditions via the ORDER_CONDITIONS_IN and ORDER_CONDITIONS_INX parameters.
    eg.
    tbl_bapicond-itm_number = '000010'.
    tbl_bapicond-cond_type  = 'ZP01'.
    tbl_bapicond-cond_value = '100'.
    append tbl_bapicond.
    tbl_bapicondx-itm_number  = '000010'.
    tbl_bapicondx-cond_type   = 'ZP01'.
    tbl_bapicondx-update_flag = 'U'.
    tbl_bapicondx-cond_value  = 'X'.
    append tbl_bapicondx.
    Hope this helps.
    Cheers,
    Pat.
    PS. Kindly assign Reward Points to the posts you find helpful.

  • Bapi_salesorder_createfromdat2 problem with filling Configuration values

    Hi All,
    I am trying to create a sales order using "bapi_salesorder_createfromdat2". Good part is I am able to create the sales order with item details, schedule line info and partners. However the BAPI did not fill the characteristic values.
    Here I am giving the code snippet and request you to help me in identifying what I am missing or where i am doing wrong.
    we checked in config and the material has perfectly configured for characteristics.
    LOOP AT it_soitem_dtls INTO lwa_soitem_dtls.
        wa_soitem_dtls = lwa_soitem_dtls.
        lv_posnr       = lv_posnr + 10.
        lv_configid    = lv_configid + 1.
        CONDENSE lv_configid.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = lv_configid
          IMPORTING
            output = lv_configid.
    * Fill the Item Configuration Characteristics
          wa_order_cfgs_ref-posex      = lv_posnr.
          wa_order_cfgs_ref-config_id  = wa_curef_out-config_id.
          wa_order_cfgs_ref-root_id    = wa_curef_out-inst_id.
          APPEND wa_order_cfgs_ref TO it_order_cfgs_ref.
          wa_order_cfgs_inst-config_id     = wa_cuinst_out-config_id. "lv_configid.
          wa_order_cfgs_inst-inst_id       = wa_cuinst_out-inst_id.
          wa_order_cfgs_inst-obj_type      = 'MARA'.
          wa_order_cfgs_inst-class_type    = '300'.
          wa_order_cfgs_inst-obj_key       = wa_soitem_dtls-material.
          wa_order_cfgs_inst-quantity      = wa_soitem_dtls-qty * 1000.
          CONDENSE wa_order_cfgs_inst-quantity.
          wa_order_cfgs_inst-quantity_unit = 'KG'.
          wa_order_cfgs_inst-complete      = 'T'.
          wa_order_cfgs_inst-consistent    = 'T'.
          wa_order_cfgs_inst-persist_id_type = 'G'.
          APPEND wa_order_cfgs_inst TO it_order_cfgs_inst.
          wa_order_cfgs_part_of-config_id  = wa_cuinst_out-config_id. "lv_configid.
          wa_order_cfgs_part_of-parent_id  = wa_cuinst_out-inst_id.
          wa_order_cfgs_part_of-inst_id    = '00000001'.
          wa_order_cfgs_part_of-obj_type   = 'MARA'.
          wa_order_cfgs_part_of-class_type = '300'.
          wa_order_cfgs_part_of-obj_key    = wa_soitem_dtls-material.
          APPEND wa_order_cfgs_part_of TO it_order_cfgs_part_of.
        wa_curef_in-posex     = wa_soitem_dtls-contractitem. "lv_posnr.
        wa_curef_in-config_id = wa_cuinst_out-config_id. "lv_configid.
        wa_curef_in-inst_id   = wa_cuinst_out-inst_id.
        APPEND wa_curef_in TO it_curef_in.
      wa_order_cfgs_value-config_id   = p_configid.
      wa_order_cfgs_value-inst_id     = p_instanceid.
      wa_order_cfgs_value-charc       = p_char.
      wa_order_cfgs_value-value       = p_val.
      APPEND wa_order_cfgs_value TO it_order_cfgs_value.
    ENDLOOP.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
        EXPORTING
          order_header_in         = wa_so_header_in
          convert                 = 'X'
        IMPORTING
          salesdocument           = gv_vbeln
        TABLES
          return                  = it_return
          order_items_in          = it_order_item_in
          order_schedules_in      = it_order_schedules_in
          order_partners          = it_so_partners
          order_cfgs_ref          = it_order_cfgs_ref
          order_cfgs_inst         = it_order_cfgs_inst
          order_cfgs_part_of      = it_order_cfgs_part_of
          order_cfgs_value        = it_order_cfgs_value
          order_cfgs_refinst      = it_curef_in
          order_text              = it_so_texts.
    * Roll back LUW if any error returned by BAPI otherwise commit
      READ TABLE it_return WITH KEY type = 'E'
                           TRANSPORTING NO FIELDS.
      IF sy-subrc = 0.
        CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
      ELSE.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait = c_x.
      ENDIF.
    Thanks in advance for all your help.
    Rgds,
    Lakshmi
    Please use code tags to make your code easier to read
    Edited by: Rob Burbank on Dec 6, 2010 2:31 PM

    Soraya,
    You need to pass in the Pricing COnditions via the ORDER_CONDITIONS_IN and ORDER_CONDITIONS_INX parameters.
    eg.
    tbl_bapicond-itm_number = '000010'.
    tbl_bapicond-cond_type  = 'ZP01'.
    tbl_bapicond-cond_value = '100'.
    append tbl_bapicond.
    tbl_bapicondx-itm_number  = '000010'.
    tbl_bapicondx-cond_type   = 'ZP01'.
    tbl_bapicondx-update_flag = 'U'.
    tbl_bapicondx-cond_value  = 'X'.
    append tbl_bapicondx.
    Hope this helps.
    Cheers,
    Pat.
    PS. Kindly assign Reward Points to the posts you find helpful.

Maybe you are looking for

  • Select options in module pool

    Hi all, I have created a select options, for a screen field in a module pool. When the user enters more than one value in this field, the icon multiple selection options should turn green , as happens in selection screen field. Kindly help me regardi

  • Date Formatting Not Updating

    Hello, Has anyone else run into the issue of updating a field's format to MM/DD/YYYY.  The information is populated from our ATS system which pulls information from the user/onboarding process.  The PDF field's date format is set to MM/DD/YYYY but on

  • Ejb lookup and oc4j container startup

    I have a servlet that is set to auto start on container startup that does a lookup on a ejb in another container. jndi locates the ejbhome but fails to load the class for the ejb home. It knows the name of the class but the classloader cannot find it

  • Help on customized TableModel please !!!!!!

    hi there i need to add a row at runtime, some people suggested me extend abstractTableModel to accomplish this. here is my tableModel: class CustomTableModel extends AbstractTableModel Vector rowData, columnNames; public CustomTableModel(Vector rowDa

  • 'Notes' field within the Address Book is greyed out

    The 'Notes' field within the Address Book is greyed out. The resolution seems simple enough yet this does not work: "Select the person in the Name column in Address Book, then click the Note field in the card." It's still grey after doing so and data