Sales Orders line item quantity getting Zero after free good line item

Hi experts,
i am creating sales order using BAPI  BAPI_SALESORDER_CREATEFROMDAT2   sales order having some free goods material  and line item after free goods line item having quantity zero.
for example A B are  materials, A having free goods a1.  when SO  having 3 line items 10 for A ,line item  20 for a1 and line item 30 for B . But line item 30 having quantity zero.
find code below and advice .
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_rof_s-date_del.
*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_rof_s-lease.
    APPEND lwa_ord_partners TO lt_ord_partners.
    IF lwa_rof_s-del_addr IS INITIAL.
      lwa_ord_partners-partn_role  =  'WE'.
      lwa_ord_partners-partn_numb  =  lwa_rof_s-lease.
      APPEND lwa_ord_partners TO lt_ord_partners.
    ELSE.
      lwa_ord_partners-partn_role  =  'WE'.
      lwa_ord_partners-partn_numb  =  lwa_rof_s-lease.
      APPEND lwa_ord_partners TO lt_ord_partners.
    ENDIF.
    lt_rof_it_t = lwa_rof_s-zsd_rof_it_t.
    LOOP AT  lt_rof_it_t INTO lwa_rof_it_s.
      lwa_ord_items_in-material = lwa_rof_it_s-matnr.
      lwa_ord_items_in-plant = lwa_rof_s-plant.
      lwa_ord_items_in-target_qty = lwa_rof_it_s-qty.
      lwa_ord_items_in-comp_quant = lwa_rof_it_s-qty. "added on 12/29
     lwa_ord_items_in-target_qu = 'EA'.
     lwa_ord_items_in-t_unit_iso = 'EA'.
      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-target_qu = 'X'.
     lwa_ord_items_inx-t_unit_iso = 'X'.
      lwa_ord_items_inx-updateflag = 'I'. "'U'
      APPEND lwa_ord_items_inx TO lt_ord_items_inx.
     ** Schedule Line Information
      lwa_schedule_lines-itm_number = '000010'.
     lwa_schedule_lines-sched_line = '0003'.
      lwa_schedule_lines-sched_line = 'X'.
      lwa_schedule_lines-req_date   = lwa_rof_s-date_del.
      lwa_schedule_lines-date_type  = '1'.
      lwa_schedule_lines-req_qty    = lwa_rof_it_s-qty.
      APPEND lwa_schedule_lines TO lt_schedule_lines.
     lwa_schedule_lines_x-itm_number = '000010'.
     lwa_schedule_lines_x-sched_line = '0003'.
      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.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
      EXPORTING
  SALESDOCUMENTIN               =
        order_header_in               = lwa_ord_head_in
        order_header_inx              = lwa_ord_head_inx
  SENDER                        =
  BINARY_RELATIONSHIPTYPE       =
  INT_NUMBER_ASSIGNMENT         =
  BEHAVE_WHEN_ERROR             =
  LOGIC_SWITCH                  =
  TESTRUN                       =
  CONVERT                       = ' '
   IMPORTING
     salesdocument                 = lwa_saledocu
   TABLES
     return                        = lt_return
     order_items_in                = lt_ord_items_in
     order_items_inx               = lt_ord_items_inx
     order_partners                = lt_ord_partners
     order_schedules_in            = lt_schedule_lines
     order_schedules_inx           = lt_schedule_lines_x
  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              =
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' .

Hi experts,
I am still waiting for your response......
Thanks in advance
Deepanker

Similar Messages

  • Sales order can not delete if it is free goods inclusive qty.

    Dear sir,
    I am unable to delete the sales order in the system.
    This sales order has Free Goods items. Total order qty is 100 pcs.  Main item has 98 pcs and sub item 2 pcs are free sending to customer with 0.00 net value.
    When I deleted sales order only main item with qty 98 can be deleted. but sub item for 2 pcs can not deleted and below msg. appears.
    Item 000021 may not be deleted (free goods inclusive quantity)
         Message no. V1724
    Can anyone please help in this regard. How to deleted sales order with free goods inclusing qty. Any copy control setting.
    Please advise
    nain b chand

    Dear Durga Sana
    No sir, I have deleted first main item. then  second time tried to delete together and third time tried to delete from sales document then delete both  but could not delete  and same  msg. is appearing.
    Further please note this is return order created with reference of billing document.
    We have created return order but now not need to further process.
    Hence we want to delete this return order. In this case sub item as free goods can not delete and msg as marked above is appearing.
    Any solution for this free goods item please SAP experts?
    regards/nain b chand

  • Getting pricing for free goods also

    Hi guys
        can u Please help me out
    i have configured free good Concept am getting free goods while creating Sales order but i am getting pricing for free goods also.
    EX: 100 (quantity)
            20 (free goods)
    Pricing has done for 120 items .. what need to be done ?
    Regards
    Amar

    hi,
    check this configuation steps.
    1. define the condition type from NA00 to Za00.
    2. define access sequence by selecting new entries as Zaoo and maintian the tables and fields.
    3. linK the access seq to ur condition type.
    condition type   (created)                    access sequence (created)
    ZA00                                                     ZA00
    4. Maintain the free goods determination procedure from the std. one NA0000 and copy it as Za0000. and maintain ur condition type in the procedure.
    5. after all maintain these free goods procedure to ur sales area.
    ex: in normal scenario u will be assigning ur sales area to ur standard pricing procedure as
    S.orgD.ChDivA1 + Pr00. but for the free goods u have to maintain as it is to ur std. pricing procedure except document pricing procedure as C - denotes free goods.
    6. finally maintain condition records thru VBN1. (there would be a option as inclusive and exclusive). u opt it according to ur requirements.
    definetely if you follow those steps, 100% error will not throw while u r creating the sales order.
    reward points if it is useful.
    regards
    KR

  • Open Sale Order Value (FD33) not getting diminished even after closing SO?

    Hi,
    Upon Executing FD33 and clicking the status view for a Customer say XYZ , and then choosing EXTRAS-Open Sale Order . Say the value of open sale orders being shown is 75000. Even after closing the open sale orders (By Selecting VA05 and Putting reason for Rejection), and then also the Open Sales Order value is not getting diminished.
    What could be the reason ?
    Pls help.
    Regrds,
    Binayak

    Hi Binayak,
    As mentioned by you, running of Credit re-org program 'RVKRED77' is the only solution for this problem and it is known problem in SAP.
    Some precautions
    1. Always run the program in background by scheduling a job.
    2. The idle time is around midnight when no user is working on SAP.
    3. Some time the job fails as some other program may be updating same tables as this program. In such cases re-schedule the job at different time.
    4. You may run the program 'RVKRED88' which will simulate without actual updation of credit values.
    Hope this clarifies..
    Regards,
    Madhu.

  • OM Sales Order Header should be Closed Immediately after Lines are closed

    Hi,
    OM Sales Order Header should be Closed Immediately after Lines are closed.
    Could you tell me how to modify the header workflow, if anyone has done this...could you please share.
    Thanks

    Thanks Mano, it worked.
    I have one question in workflow, let me create new thread.
    Could you please check my other question at below.
    OM Notable able to capture Approver Rejected comments from the Note field in WF
    OM Notable able to capture Approver Rejected comments from the Note field in WF

  • Order Component quantity gets changed after operation confirmation

    Order Component quantity gets changed after operation confirmation.
    We are using CO27 to issue the Material to the Order.
    When we do the confirmation of  operation. Component quantity attached to operation get changed.
    Any solution for this.

    Dear
    Please Follow the Steps
    1. Go into Co02 there u do production order with qty select the Component overview u find the Materials there please check hhow much is the qty of that particular material
    EX: Production order qty for Header Material is 10 ea
    then ur Compannets Qty is 10 or 20
    depends on the Componet Qty the Operation takes place that is because u have maintatined a base qty in Routing and BOM
    With Regards
    Pushpalas

  • Sales Order for Bulk quantity

    Hi,
    My client has a scenario like Order is created for bulk quantity, say 1000 MT for whole year for one sold to party. Now they create DI (Despatch Instruction) with reference to order for bulk quantity say 100 MT for particular one Ship to Party. Now 10 invoices are created against this DI.
    Now Ship to party is decided at the time of DI creation only and there are more than 100 ship to parties for one sold to party.
    Requiremnt is
    1. While creation of sales order of 1000 MT, I don't want to specify Ship to Party.
    2. I want to enter ship to party manually while creation of Delivery of 100 MT.
    3. I want to create 10 billing documents of 10 MT each with reference to same delivery.
    Challanges are:
    1. As there are more than 100 ship to parties for one sold to party it is not feasible to specify ship to party in sales order. If I create multiple line items then it is possible to specify different SH for each line item, but it would not be feasible beacuse I have more than 5 products in same sales order. Then it would be 100 * 5 = 500 line items in sales order.
    2. How to enter SH at the time of delivery creation.?
    3. Having single line item of 100 MT in delivery document, how can I create multiple invoices of 10 MT each using delivery.?
    Can anyone please guide on this..?
    Regards,
    Falgun

    Hi,
    I had worked on this scenario
    Solution for changing SHIP to PARTY in delivery
    Enter multiple ship to parties in customer master and in delivery header go to PARTNER tab and click on ICON propose alternative then select respective ship to party
    OR ELSE
    Go to SE16N
    Put table TPAER
    Tick mark to maintain entry (if in display mode put command &sap_edit and just enter tick mark will come auto)
    Then put partner determination procedure LF (LF is partner detrmination procedure for delivery)
    Put partner SH
    Execute
    Remove X indicator from not changable coloumn and save now you will be able to change Ship to party in delivery
    After this block t-code VOPA so no one can change it if some one run this t-code indicator will be reset as it is program writen so block it.
    For billing split manual option
    VF01
    Click on selection list
    Maintain open quantity as 10 and click on copy and then excute and save invoice
    If you want it automatically for fixed 10 qty then write data transfer routine by VOFM
    Assign it in copy control delivery to invoice at item level for VBRK/VBRP Data
    Kapil

  • No Incompletion Log for Sales Order with net value as zero

    Hi all,
    There is an Inbound IDOC which creates a Sales Order.
    When we check the IDOC, we find that it has got 4 line items (E1EDP01). However, for all the items except the third one (for example), the segment E1EDP05 is filled. In the segment E1EDP05 the field KRATE contains the corresponding net value for the respective line items.
    Then when we check Sales Order which is created, we find that the third line item (for example) has the net value as zero. In this case, ideally there should have been an entry in the Incompletion Log. However, it does not happen so.
    I suppose the issue is with the third line item in the IDOC for which the segment E1EDP05 is not present. I have debugged the corresponding FM is IDOC_INPUT_ORDERS, but was unable to find any clue.
    Please let me know the reason for this.
    Thanks and regards,
    Anishur

    In routine interpret_idoc_orders the item conditions are filled by calling
    WHEN 'E1EDP05'.
           MOVE IDOC_DATA-SDATA TO E1EDP05.
           PERFORM ZUORDNEN_ORDERS_E1EDP05.
    In case KRATE is empty no values are transferred to the order
        IF NOT E1EDP05-KRATE IS INITIAL.
          PERFORM IDOC_CUR_MOVE USING E1EDP05-KRATE XKOMV-CURRDEC
                                      XKOMV-KOEIN
                                      XKOMV-KBETR D_FLAG_P-PKON.
        ENDIF.
    If that is a valid scenario, you need to adjust your incompletion procedure in customizing to include the net value on item level so any missing value is reported.
    If this is not supposed to happen you might want to hook into one of the user exits in the idoc and in case KRATE is missing let the idoc fail.
    Hope that helps,
    Michael

  • Sales order debit memo quantity.

    Posted on behalf of a colleague - I had created a sales order of quantity 25, and then create the partial  delivery and invoice of 24 . When I create the debit memo req w.r.t to the sales order it is also getting created for quantity 24.
    Now I have created the delivery & invoice of remaining quantity (i.e. Qty = 1).
    When I create the debit memo req w.r.t to sales order it is showing me the quantity as 49.
    (i.e. 25 + 24 ) instead of subtracting the quantity is getting added .
    Please advice.
    Edited by: Sandeep Gambhir on Nov 29, 2010 8:02 AM

    Hello,
    Please check the field 'Pos/Neg qty' field in field copy control.
    Regards,
    Raghavendra

  • No. of sales order with open quantity in a month

    Hello experts,
    I have a requirement to calculate open sales order quantity and
    the number of sales order with open quantity for current month.
    Please advise which tables can give this logic. I have the idea
    of calculating open SO quantity from VBAP and LIPS table but how
    to compile the number of sales order with the open quantity
    Thanks
    Rahul

    HI
    can you please try in VBUK table.
    Hope this helps
    Thanks
    Madhav

  • BAPI For Create Goods Issue for Sales order with picked quantity

    Hi friends,
            Is there any BAPI available to create Goods issue For sales order with picked quantity...............?
    we hv used BAPI_OUTB_DELIVERY_CREATE_SLS
    with sales order .......its creating delivery order but not doing goods issue with piked quantity........

    pls,reply its argent

  • Pending sales order with open quantity

    Hai gurus
    Please help me with any table or t.code to find pending sales order with open quantity
    With regards

    Dear,
    Please use transaction code V.02 to view all the incomplete sales order.
    If you have any concerns please revert back the same to me.
    Amjath

  • Free Goods sub item split in two line items

    Sir,
    I give free good along with  sale item ,but i want free goods quantity split in two lines ,so how I do  that?
    Please help .

    Hi,
    Free goods has the following limitations:
    - Free goods can only be supported on a 1:1 ratio. This means that an order item can lead to a free goods item. Agreements in the following form are not supported: u2018With material 1, material 2 and material 3 are free of chargeu2018 or u2018If material 1 and material 2 are ordered at the same time, then material 3 is free of chargeu2018.
    - Free goods are not supported in combinations with material structures (for example, product selection, BOM, variants with BOM explosion).
    - Free goods are only supported for sales orders with document category C (for example, not quotations).
    - Free goods are not supported for deliveries without reference to a sales order.
    - Free goods cannot be used in make-to-order production, third-party order processing and scheduling agreements.
    - If you defined a free goods for variants in a generic article (only SAP Retail), you can only process the variants in the purchase order and goods receipt individually (as single articles). In other words, you cannot process them using the generic article matrix.
    Not all Sales Order can be used for free goods determination.  You have to check the SD document category if it does not work.  Only category 'C' are supported.  Check transaction VOV8.
    Assume that you want to configure an inclusive FREE goods routine.  Customers must order a minumum quantity of 5 before any free goods can be assign.  For every quantity of 3, the customer will be given 1 free goods.
    WC07 - Maintain Number Range Intervals
    e.g.
    No   From number       To number
    01    0000010000         0000099999
    IMG -> Sales and Distribution -> Basic Functions -> Free Goods ->
    Maintain Access Sequences
    New Entries
    Acsq
    NA00
    Save
    Maintain Condition Types
    New Entries
    Ctyp   Name             AcSq
    FREE  Free Goods    NA00
    Save
    Maintain Pricing Procedures
    Procedures
    New Entries
    Procedure   Description
    FREE           Free Goods
    Select Procedure FREE then click Control data
    Step   Cntr   Ctyp
    10       10      FREE
    V/N6 - Activate Free Goods Determination
    Assign Order Type OR with Document Procedure A with Procedure FREE
    VBN1 - Create free goods determination
    e.g.  FREE inclusive
    Material  Min qty   From   are free good   Calc Rule   Free Goods
                           5           3                1                      1                1
    In this example, if you create a Sales Order for a quantity of 10, SAP will prompt you 7 as the customer order qty and 3 will be free.  Customer only pay for the 7 quantity
    Hopefully this will help to resolve the answer.
    Thanks & regards,
    Pankaj Mahajan
    Edited by: PM on Apr 13, 2010 10:28 AM

  • Sales order (SOBKZ = &1) is not provided for this goods movement the messag

    Dear Friends,
    I have created one subcontracting PO based on a sales order, so the order is belonging to special stock...
    Now i got a below error when i transfer the stock to subcontractor against this PO through MB1B but it likes as warning msg(in Yellow) but i can't post this transaction.
    Sales order (SOBKZ = &1) is not provided for this goods movement the message no is M7374
    Kindly help me how to over come from this? 
    please note that as per the system suggesion i go to Define Attributes of System Messages  for changing the message type from E to W. But i can't find this kind of message type in that list.
    regards,
    sathes

    Hi,
    Subcontracting for Sales Order Stock: -
    Purpose: - Subcontracting is also possible in conjunction with sales order stocks. The subcontracting orders are account-assigned to a sales order. Thus, the components are not transferred (using a transfer posting) to the "stock of material provided to vendor" but are directly withdrawn from the sales order stock the time of the goods receipt. The material manufactured is also posted to the sales order stock.
    The cost of subcontracting is then debited to the sales order.
    Since the components are not transferred to the "stock of material provided to vendor", it is recommend that you use a transfer posting to transfer the provided components to a new storage location (for example, 9999). This enables you to obtain an overview of those stocks that are physically located at the subcontractor. This information is particularly important when you carry out a physical inventory of the sales order stocks.
    Features: -
    Withdrawal from Stock of Mat. Provided or Sales Order: -
    For components that are managed in sales order stock, you can define whether the components are to be withdrawn directly from each sales order or from the stock of material provided to vendor. You manage this via the dependent requirements indicator for individual customer requirements and collective requirements (MARC-SBDKZ).
    You can maintain this indicator in the following places:
    In the MRP view of the material master record (MRP 4)
    In the explosion types for the BOM item (in Customizing for Production in the step Basic Data -> Bill of Material -> Item Data -> Define explosion types )
    Configuring the explosion types has priority over the configuration in Inventory Management.
    If the indicator is set at Collective requirements only (2), the materials are withdrawn from the stock of material provided to vendor. If this indicator is set any other way, the system withdraws materials from sales order stock.
    Refer following link;
    [Subcontracting for Sales Order Stock and Project Stock|http://help.sap.com/saphelp_erp60_sp/helpdata/en/4d/4b9036dfe4b703e10000009b38f889/frameset.htm]

  • How to find that a sales order for which there is  delivery but no goods

    Hi
    How to find that a sales order for which there is  delivery but no goods issue has been done i.e we have an open delivery for a sales order.
    How in VBUK table can we find  out with the sales order no .
    Thanks in advance

    make use of table VBFA.
    Regards
    Peram

Maybe you are looking for

  • PopcornTime starts with a black screen and does not load

    I installed PopcornTime from the AUR and it does not seem to load. When I launch the application, it simply loads a black screen and does not move from there.  When I launch the application from the terminal, I get this output. [923:0617/080553:INFO:

  • Acrobat X has stopped working

    Acrobat X (which I have on Windows 7 as part of CS6) stopped working after being updated by Adobe Application Manager yesterday - it just won't open. I uninstalled and reinstalled it; it opened once and then stopped working again. I've also started g

  • Updated to 5.0 is -now- constantly "not responding"

    updated to 5.0 >MOZILLA > help/about Firefox says "up to date"> now MOZILLA is "not responding and "freezes/screen goes gray" every 4 clicks or so... it's gotten so bad I have to restart compute just get it to act at all. Firewall not an issue- MOZIL

  • Why is InDesign CC freezing while trying to perform various tasks?

    I am on Windows 7 - 64 bit Whenever I try to change the doc setup or delete a color swatch, or other various tasks, INDD CC is freezing and then I have to do a control-alt-delete and "end task" - shut it down. Same problem occurs when I re-open the p

  • I kept having advert pop up on my web browser, is that virus?

    I kept having advert pop up on my web browser, is that virus? Don't know what I did and don't know how to get rid off them.