Sales order qty change.

Hello everyone...
can anyone give me idea for .......I am creating sales orders in BOM with userexit  MV45AFZZ code written in below....everything is working fine....example My requirement is the combination of materials must be 2 - 4 , 3-3, 4-2, and 5-1.... i made it everything is good......here the problem is if I give qty as 1 in sales order it is taking correctly as 2 with my code....but it is not accepting me to change....how can i change.....give me some idea,.....
tables : stas, stpo.
  data : begin of it_fg_xvbap occurs 0.
          include structure xvbap.
  data : end of it_fg_xvbap.
  data: begin of it_zfreegoods occurs 0.
          include structure zfreegoods.
  data: end of it_zfreegoods.
  data: v_lines(3) type c,
        v_stas(3) type c.
  data: begin of it_fg_stas occurs 0.
          include structure stas.
  data: end of it_fg_stas.
  data: begin of it_fg_stpo occurs 0.
          include structure stpo.
  data: end of it_fg_stpo.
  data: v_mitem1_qty like vbap-kwmeng,
        v_mitem2_qty like vbap-kwmeng,
        v_mixitem_qty like vbap-kwmeng,
        v_quantity like zfreegoods-quantity,
        v_newqty like zfreegoods-quantity.
  it_fg_xvbap[] = xvbap[].
  if not it_fg_xvbap[] is initial.
    read table it_fg_xvbap index 1.
    select * from zfreegoods into table it_zfreegoods
           for all entries in it_fg_xvbap
           where matnr eq it_fg_xvbap-matnr
           and zinteruse eq '04'.
Check if the BOM is completely exploded for mix-match.
    if not it_zfreegoods[] is initial.
      loop at it_fg_xvbap.
        read table it_zfreegoods with key matnr = it_fg_xvbap-matnr.
        if sy-subrc eq 0.
" This scenario triggers - min qty 2
          if it_fg_xvbap-kwmeng <= '1.000'.
          message i020(zsnd) with 'The Promotion Accepts min combine Qty
2 & 4'.
            it_fg_xvbap-kwmeng = '2.000'.
            it_fg_xvbap-lsmeng = it_fg_xvbap-kwmeng.
          endif.
          if it_fg_xvbap-kwmeng >= '6.000'.
          message i030(zsnd) with 'The Promotion Accepts max combine Qty
5 & 1'.
            it_fg_xvbap-kwmeng = '5.000'.
            it_fg_xvbap-lsmeng = it_fg_xvbap-kwmeng.
          endif.
          v_mitem1_qty = it_fg_xvbap-kwmeng.
          v_quantity = it_zfreegoods-quantity.
          modify it_fg_xvbap.
          clear v_lines.
          continue.
        endif.
        if it_zfreegoods-matnr ne it_fg_xvbap-matnr.
          it_fg_xvbap-kwmeng = it_fg_xvbap-kmpmg.
          it_fg_xvbap-lsmeng = it_fg_xvbap-kmpmg.
          modify it_fg_xvbap.
        endif.
        v_lines = v_lines + 1.
        if it_zfreegoods-zfreemodel eq it_fg_xvbap-matnr.
          if v_mitem1_qty <= v_quantity.
            v_newqty = v_quantity - v_mitem1_qty.
            it_fg_xvbap-kwmeng = v_newqty.
            it_fg_xvbap-lsmeng = v_newqty.
            modify it_fg_xvbap.
          else.
           if v_quantity ne it_zfreegoods-quantity.
          if v_mitem1_qty ge it_zfreegoods-quantity.
            if fcode eq 'SICH'.
              message e020(zsnd) with it_zfreegoods-quantity .
            else.
              message s020(zsnd) with it_zfreegoods-quantity .
            endif.
          endif.
        endif.
      endloop.
      xvbap[] = it_fg_xvbap[].
    endif.   "  it_zfreegoods table
  endif.

Hi Cathy
You require ABAPers help. This not possible through configuration.

Similar Messages

  • User exit for sale order qty change

    Hi all,
    In our industry we are creating Sale Order for MTO Scenario by using T.Code VA01 . Most of the time after taking the MRP run and raising PO for BOM components, Users are changing the qty in the sale order . eg. and due to that it is becoming difficult to make necessary change in production programe. .Now please give me solution/ userexit  so that anybody cannot change the sale  order qty and it must be check the authorised userid to do necessary change in sale order.
    I am waiting for your valuable suggestion.
    Thanks & Regards

    Hi LIMAYE,
      You can use user exit include 'MV45AFZZ'.
    Make necessary changes in FORM USEREXIT_MOVE_FIELD_TO_VBAP.
    XVBAP will contain the old values before making the changes. You can comapare the quantity wtih VBAP field.

  • Sales order qty not possible to change.

    hi experts
    i have created a sales order with suppersession material  for 2 qty and we deliver only 1 qty to customer.
    now i want change the sales order qty 1 so that status gets completed.
    but in VA02 material qty is in hidden mode cant possible to make changes. this is happening with suppersession material only.
    need your support
    thank you

    hi dear
    thanks for the reply again
    schedule line is also in grey mode. cant possible to make changes.
    let me add on this
    when we create order suppersession material entered with item cat. TAPA which generate automated second line item cat TAN. when we make delivery TAN gets copied in the DO and Billing afterthat.
    but issue is once delivery created. in VA02 order oty field (KWMENG)  become in grey mode. cant possible make any changes ?
    i have checked both the item categories completion rule which is (not relevent for completion)

  • Change in Sales Order Qty in a MTO scenario

    Hi,
    We had confirmed 5 Qty for the Production Order created with reference to Sales ORder(MTO scenario), now after confirmation of 5 qty, sales order qty is reduced to 3., then in this situation, what we need to do for the already confirmed extra Quantity 2 for this sales order. I think we need to cancel the confirmation for the extra qty 2?. Please clarify and explain what we need to do this for this extra Qty 2 in detail.
    Case 2) If the Sales Order qty is changed to 7, then we will be creating a new Production Order for this new quantity 2 with reference to the same sales order.  Am i correct?.IF wrong, please suggest how should we balance the extra requirement of 2 EA.
    Thanks in advance.

    Is your query being posted even before you actually tried the 2 cases which you refer to in your system?
    If so, then first do the simulation in your sandbox, check how system behaves when you do that. Also check by clicking on ATP check for the material within SO.
    Once you do the above your query will be self answered, if you still face any issue then revert with the specific details.

  • Sales order qty display

    On my sales order qty only 'four digit' numbers show up.
    For example, 1000 will show up on the print out.
    However, 10000 will not show up and will be desplayed as *000 with an *
    How do i get all digits to display?
    Edited by: ManjeetSingh on Mar 16, 2010 1:42 AM

    Ask your ABAPer to do the changes in the Smart Form of Sales Order.It is due to settings maintained in the Smart Form which allow to show only 4 digit for Sales Order Quantity.
    Best Regards,
    Ankur

  • Va05 open sales order qty

    Hi,
    When we run the VA05 Transaction it is not showing the open sales order qty as out put.
    Please help me how can achieve it.
    we are using 4.7
    Thank you.

    Hello ,
    you'll find the documentation via customizing (Transaction SPRO) : Path
    Sales -> System modification -> create new fields ( without condition technique) -> New fields for lists.
    You can change V05TZZMO and structure VBMTVZ from there or use SE38 / SE11.
    For both you'll need an object registration in OSS.
    Regards Wolfgang

  • How to ATP check when sold to party in sales order is changed?..

    Dear SD Gurus,
       I have one issue with ATP check in my current project where I need to change the the Sold to party of the sales order for a valid business case. We are using production allocation method for ATP check which reduces the Open PA qty once the sales order is saved.
    In the above scenario, once the Sold to party in sales order is changed, it redetermines everything and also goes through a ATP check which is cusing as an issue as it would again reduce the open PA qty for the same items in sales order for which are already taken into account. It would either reduce the open qty or propose the next date if it is no more available on that day.
    This is a big issue for us. Also it deleted the texts that are maintained.
    Does anyone know how to stop the ATP check in this (main issue) and also if possilble stop the deleteion of texts?
    Thank you very much for your help in advance..
    BR/
    Ashutosh

    Hello SAJU,
      The ATP check is done automatically when sold to party is changed..the issue is how to stop it? beacause of production allocation , it would be incorrect to reduce the open PA qty once more for the sales order when sold to party is changed. So I would like to stop it. Is there any exit or paramater by which we can stop ATP check?
    Thanks for your reply..
    BR/
    Ashutosh

  • 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

  • Delivery Qty Greater than Sales order Qty

    Dear All,
    I want to do delivery against a Sales order,but system is allowing me to do PGI more than the Sales order qty,please advice where i can restict my PGI agisnt the Sales order qty.
    Regards,
    Muzamil

    Dear Prashanth,
    Thanks for your quick reply and resolution
    We have a problem when there is a delivery from projects(CNS0).When we are running the transaction CNS0 and entering  Qty 7, and creates delivery, system generates a Delivery Number and takes us to VL02N where we enter batch,picked qty and storage location.Here we find delivery quantity 7 by default and if we change the quantity from 7 to 10 even then system accepts more quantity as it checks the project stock.
    We want system should not allow the delivery quantity more than the quantity specified in the CNS0.
    We are not creating sales order as we directly delivering from projects.
    In the previous case,as you suggested we made the changes in delivery item category,but the same logic is not working here as it is without sales order.
    We are using item category DLP and Delivery type is LP.
    Request you to provide your valuable inputs
    Thanks in advance
    Regards
    Muzamil

  • FiX lot size & minimum sale order qty .

    hi all
    We maintained minimum order quantity  for material ; can we put massage sale oraganization wise
    ie for SO IN01 Massage type is 'E"
    & for IN02 massage type is 'W"
    If my minimum order qty. is 10 then SAP will accept the sale order qty. with multiple of 10 .
    Eg. If customer placed order qty. 15 Nos. Dose SAP convert  it into 20 automatically ?
    PL. suggest me how to configure this scnerio

    Hello,
    Min sales order qty is controlled through MMR Sales Org 1 - if you want it to round up or down to the correct order quantity then you will need to create a rounding profile (see below).
    Otherwise to change your message from a info or warning to an error goto transaction OVAH message V4 082 and change to E = error.
    Rounding Profile
    Key that the system uses to adjust the order proposal quantity to deliverable units.
    Procedure
    In Customizing, enter a threshold value from which the system should round up to the next value per deliverable unit:
    If the requirements value exceeds the first threshold value, the system always rounds up to the next multiple of the level found
    If the requirements value falls below the first threshold value, the system copies the original requirements value.
    Two other types of rounding exist:
    Dynamic rounding profile:
    These profiles are used to round up quantities to logistical units of measure (for example, layers). The contents of a logistical unit of measure does not have to be know when creating the rounding profile. It is determined by the master data from the material master.
    Rounding profile with quantity to be added/subtracted
    With these profiles, the given quantity is changed either by adding a percentage or subtracting a percentage.
    Only static rounding profiles are taken into account in requirements planning. Neither dynamic rounding profiles not quantity addition/ subtraction are taken into account.
    Examples
    A material's base unit of measure is 1 unit; the purchase order is to be delivered in layers (1 layer corresponds to 5 units) or in pallets (1 pallet corresponds to 8 layers which contains 40 units).
    You maintain the profile as follows:
    From a requirements of 2 units, the system is to round up to 5; from a requirement of 32 units, the system is to round up to 40.
    This results in the following order proposal quantities:
    Requirement from 1 -> 1 requirement from 31 -> 30
    Requirement from 2 -> 5 requirement from 32 -> 40
    Requirement from 6 -> 10 requirement from 74 -> 80
    Requirement from 7 -> 10
    Dependencies
    If no rounding profile has been entered, the system uses the rounding value entered in the material master record for the planning run
    Kind regards
    Sue

  • Logic for Open Sales order qty

    What should be the logic given to determine "open sales order qty" during designing a report.
    Note the criterias are as under:
    1) Open sales order qty is the confirmed qty less the delivery qty.
    2) The delivery qty should be delivery order qty (The delivery should not necessarily be pick, packed & PGI)

    sorry it doesn't work for services, since they do not create requirements.
    in this case you can use VBFA table, subracting all the delivered quantities VBFA-RFMNG with VBFA-VBTYP_N = J and VBFA-VBELV/VBFA-POSNV = to your order/item from the ordered quantities
    hope  this help you.
    Roberto

  • How to change pricing Conditions in Sales order in change sales order bapi

    Hi Experts,
    How to change pricing Conditions in Sales order in change sales order bapi.
    I have used the 2 function modules bapi-changesalesorder and sd salesdocument change, But it is creating the new record , instead of changing the existing one, Could please assist regarding the same
    Thanks in Advance .
    NLN

    HI NLN
      I have just tried on my system and managed to overwrite the existing price by passing the following parameters.
      <b>Import Paramters:</b>
         SALESDOCUMENT - Sales Document Number
         ORDER_HEADER_INX - UPDATEFLAG as <b>'U'</b>.
         LOGIC_SWITCH - Import Structure - Pass 'X' to LOGIC_SWITCH-COND_HANDL.
      <b>Tables:</b>
         CONDITIONS_IN - ITM_NUMBER,
                         COND_COUNT, -> Condition counter same as KONV-ZAEHK generally it is <b>'01'</b>
                         COND_TYPE,
                         COND_VALUE,
                         CURRENCY.
         CONDITIONS_INX - ITM_NUMBER,
                          COND_COUNT,
                          COND_TYPE,
                          UPDATEFLAG as <b>'U'</b>,
                          CURRENCY.
       Hope i have clarified your query.
    Kind Regards
    Eswar

  • Sales order qty not updated in copa

    Hi Gurus,
    My client has activated Costing based COPA.
    We have activated Incoming sales orders with option
    Transfer with date of deliery/scheduled billing date.
    When We are posting sales order we are able to see a copa document with record type A.
    In that document we want to see the Sales order quantity or delivery quantity, delivery date fileds.Please let me know what all the value fields We need to assign.
    Do I need to write any derivation rule for incoming sales arders also.
    we are able to capture the  total price, material etc from the sales order in COPA document.We need only sales order qty or Delivery qty or delivery date to be updated in COPA document.
    Please suggest me
    Regards
    Chaitanya

    Hi Chait,
    Pl check whether your client has assigned SD Qty Fields to COPA Quantity fields in KE4M. Sd quantity fields are FKIMG- Billed Quantity, KWMENG-Order Quantity and the same shall be assigned to ABSMG-Sales Quantity. If not, please maintain the same. Otherwise, we need to look for some other work around solution.
    Trust this resolve your problem!
    Cheers!

  • Sales order qty not confirmed when delivery done with partial qty

    Hi Guru's
    Need your help............
    We have issue in drop shipment scenario process. Sales order created with 10 line items from CRM and order released from CRM and replicated order to ECC and backend created PR also. After that user set reject status for all items so that PR line items also deleted, again user released rejection status for all items and line items updated in the same PR with different line item number for materials then PO & GR also done in ECC and stock also allocated for sales order line items but still sales order qty not confirmed in CRM sales order. 
    I checked all configurations regarding availability check but could not found.
    Example:
         Sales order line item qty: 4            -      2 qty confirmed (delivered).
         For remaining qty (2 items)I have done GR. After GR It is allocated to sales order but it is not confirming the order quantity.
    plz help me to fix this issue?
    regards
    sai

    Hi,
    Please check In ERP transaction OVZJ, for the sales org, distribution channel, and division that is being used in the affected sales orders, set the Avail. Check Rule to 'E'. Then retest the issue, as this might help.
    Regards
    Gavin

  • Confirmation of the production order qty equal to sales order qty

    Hi Experts,
    I need to control the confirmation of the production order should be equal to sales order qty.
    I'm having the scenario as follows
    If sale order qty for X material = 3
    while running the MRP, system will plan the order qty as 8 because of we maintained rounding profile in the Material master and enhancement we used for this.
    Rounding Profile Qty=5
    Total Production Order Qty=8.
    But, finally they will do the GRN for sales order qty only, remaining will be used for testing purpose.
    So, the confirmation also has to happen for only sales order qty. There, we need to control the qty based on the sales order.
    Is there any exit or Enhancement is available for this.
    Please help me.
    Naren

    Hi,
    Exit for confirmation check is CONFPP04.
    However, opening orders for quantities higher than demand and leaving pieces undelivered and unconfirmed in production orders does not make sense. I could not get the requirement of incresing production quantity by adding rounding value? Moreover, if rounding is to be used for test purposes, why not do you receive them into stock? Why don't you receive 8 pieces into stock, deliver 3 pieces to sales order and transfer 5 pieces to related department?
    If it is because of MRP and you really do not want to produce extra 5 piece immediately, you may use material reservation or any other form of demand for 5 pieces, use EX for lot size calculation and have MRP create two planned orders for sales order and testing requirement, then you can convert planned order for sales order requirement into production order and continue processing.
    Regards.

Maybe you are looking for

  • Doubt in transient and volatile

    Hi, I have doubt in using transient n volatile modifiers   class Test       public static final  transient  int i=1;       public static final  volatile int i=1;  //line 1 }If i use final n volatile ,having a comp err like illegal combination of fina

  • Can I access English movies and TV, living in Germany using the Apple TV

    Can I access English movies and TV, living in Germany using the Apple TV or maybe something else? I live since short in Germany and would like to have access to English TV and English movies using my internet connection. Looking at for example the Ap

  • PHP Form in Spry Tabbed Content Div

    I have placed some PHP forms inside some Spry Tabbed Content divs. When the forms are submitted, the page reloads with the default tabbed content displayed instead of the tab where the form is. If I click to the tab with the form, I can see the infor

  • Help. I can't restore my photo library

    I recently had a residential burglary in which my iMac was stolen. It's since been retrieved, but the thief erased every single photo in my library. However, I did have an external hard drive with the library saved on it. While i was without the iMac

  • Premiere cs 6 refuses to download

    In order to  use Encore, I need to install Premiere CS 6, but every time I click on "Download AP CS6" ...I get a message " waiting on creative.adobe.com"   Its been waiting for over a day..... How can I download Encore ???? Why Encore is not a part o