Lock Insertion of new position in a Sales Order

Hi guru!
I've to lock the insertion of new position in a Sales Order from VA02 transaction, users can update only some fields of existing positions but thay can't insert a new position in order.
I have to lock the blank position in a position's table control so they can't insert data for a new position.
Is it possible to do?
Thanks!!

If you're talking about "new POSNR" (item), you could change the visibility of the insertion button, any menu drop downs, probably with user exit or (perhaps better) with screen variants (transaction SHD0) for transcode VA02....perhaps a combination of the two would get you the results you need.

Similar Messages

  • How to change Position Number in Sales Order?

    Hello Gurus,
    I have the requirement to renumber the positions in an existing sales order.
    For example position 000020 needs to be changed to position 000030.
    Unforunately BAPI_SALESORDER_CHANGE cant do this apparently.
    Anyone knows a way other than direct access to VBAP or deletion of position and after that inserting the new position?
    Regards,
    Vasco

    For heaven's sake, stop thinking about changing it programmatically. You will land yourself in deep trouble. Better delete the order and create a new one.
    Four years back , I was pitched in as an advisory consultant to design a solution to incorporate some IS-Retail feature in SD module .It gave me good exposure to study  standard sales process closely- how the standard program takes care of addition, insertion and modification operation. Basically, I had to do similar kind of thing via enhancement. There are so many scenarios and so many  tables like XVBAP, YVBAP, IVBAP, SVBAP to manipulate. If any table is filled incorrecly, data will be inconsistent and there will be short dumps. Other than that you also have to change the related tables like VBUK, VBUP, VBEP and the  tables that David Knittle mentioned. Some indexed tables like VAKPA & VAPMA are also updated along with VBAP.
    System basically knows whether it is an insertion , update or deletion by checking the value of UPDKZ field. Also, for some scenario, probably for deletion ( forgot, did it long back ), two line items are created, one at the original position and one at the end.

  • Table for position status in sales order?

    Hi veryone,
    I would be veru grateful if someone could help me to find a table in which I can find the status of a certain position in a sales order.
    Thanks in advance and best regards.
    Ben

    Hi
    Please check the tables...
    VBUK - for Header status
    VBUP - Item status.
    Thanks,
    Ravi

  • Inserting new line item in Sales order

    Hi,
    We are doing a feasibility check to find out whether a new line item can be successfully inserted into a sales order based on certain pricing conditions that is received through an ORDERS05 inbound idoc.
    I tried adding a new segment E1EDP01 to the existing idoc in the user exit EXIT_SAPLVEDA_011 assuming that the VA01 posting program would accept the new line item but that approach is not working.
    Looking at various posts in the forum, I gather that the best way is to use the function 'BAPI_SALESORDER_CHANGE'. Can anyone please let me know how exactly a new item can be inserted using this function module?
    Any help would be appreciated.
    Thanks

    Hi Sneha,
    Please use the FM 'BAPI_SALESORDER_CHANGE' to add a new line item as under:
    CALL 'BAPI_SALESORDER_CHANGE'
        EXPORTING
          salesdocument               = "Pass the Sales order no here"
          order_header_inx            =  "Pass the value of update flag as I as u need to "
                                                   "insert a new line item"
        TABLES
          return                             =  "Will contain the error/success messages"
                                                   "after the processing"
          ORDER_ITEM_IN            =  "Here pass the item info tht needs to be added"
    Also do a Commit Work after this FM call to reflect the changes in database.
    Regards,
    Chetan.
    PS: Reward points if this is helpful.
    Message was edited by:
            Chetan H. Dubey

  • How to insert new schedule line in Sales order using BAPI

    Hi All,
    I am using the below code to add a new line in the schedules line of a existing sales order.But i am not getting the extra line after running the report.
    Kindly guide me in how to achieve this.
    thanks and regards
    shilpa
    REPORT  Z_VA32_EDI1.
    data: v_vbeln type BAPIVBELN-VBELN,
          wa_order_header type BAPISDH1X,
          i_sch_line type standard table of BAPISCHDL with header line,
          i_sch  type standard table of BAPISCHDLX with header line,
          i_return type standard table of BAPIRET2 with header line.
    v_vbeln = '0030001227'.
    wa_order_header-UPDATEFLAG = 'U'.
    i_sch-ITM_NUMBER = '000010'.
    i_sch-UPDATEFLAG  = 'I'.
    i_sch-REQ_DATE  = 'X'.
    i_sch-REL_TYPE = 'X'.
    i_sch-PLAN_SCHED_TYPE = 'X'.
    i_sch-REQ_QTY     = 'X'.
    append i_Sch.
    i_sch_line-ITM_NUMBER = '000010'.
    i_sch_line-REQ_DATE  = '20080127'.
    i_sch_line-REL_TYPE = '2'.
    i_sch_line-PLAN_SCHED_TYPE = '2'.
    i_sch_line-REQ_QTY     = '65'.
    append i_Sch_line.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
      EXPORTING
        salesdocument               = v_vbeln
      ORDER_HEADER_IN             =
        order_header_inx            = wa_order_header
      SIMULATION                  =
      BEHAVE_WHEN_ERROR           = ' '
      INT_NUMBER_ASSIGNMENT       = ' '
      LOGIC_SWITCH                =
      NO_STATUS_BUF_INIT          = ' '
      tables
        return                      = i_Return
      ORDER_ITEM_IN               =
      ORDER_ITEM_INX              =
      PARTNERS                    =
      PARTNERCHANGES              =
      PARTNERADDRESSES            =
      ORDER_CFGS_REF              =
      ORDER_CFGS_INST             =
      ORDER_CFGS_PART_OF          =
      ORDER_CFGS_VALUE            =
      ORDER_CFGS_BLOB             =
      ORDER_CFGS_VK               =
      ORDER_CFGS_REFINST          =
       SCHEDULE_LINES              = i_sch_line[]
       SCHEDULE_LINESX             = i_sch[]
      ORDER_TEXT                  =
      ORDER_KEYS                  =
      CONDITIONS_IN               =
      CONDITIONS_INX              =
      EXTENSIONIN                 =
      NFMETALLITMS                =
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    wait = 'X'.
    write: 'Done'.

    hi,
    pass the values 'x' to the bellow structure for all the fields that u want use and provide the item no ,schedule line no.
    SCHEDULE_LINESX

  • Problem while creating new item in the sale order  in case of  Thirdparty

    Dear Gurus
    The following error is coming
    while adding the new item with quantity  in the sale order in case of third party  .
    Error Info...   00 671: ABAP/4 processor: SAPSQL_ARRAY_INSERT_DUPREC
    Update key...   482ACBD89C7D0067E10080000A8C681C
    Can give any idea abt this.
    Rgds
    Surya

    Hi
    This error comes up due to number range problem in the
    tables.
    As you have said this is a third party Sales order, just check if this is relevant to the PR being generated or the Sales order getting created.
    Check the Current number of the PR document type in the EBAN table & check if it is the same for the Number ranges in customizingin OMH7.
    If they are not the same... & the current number in OMH7 is smaller than the Number in the table EBAN , you need to change the current number  equal to the EBAN table.
    If this is the case fior sales orders similarly check for Sales order table & sales order number range object.
    reward points if useful
    Thanks & Regards
    Kishore

  • User exit - VA01 - Adding new line items while Sales Order Creation

    Hi All ,
    I have a requirement where : in VA01 , i have to add new line items using USER EXIT or BADI.
    The scenario is : we maintain Characteristics for Material. When we select a particular characteristics, Factor and length will be displayed in a Popup. we can specify the Factor and lenght.
    Here , if i specify Factor as 10 and lenght as 1000. the Material has to be cut / split into 10 items of 1000 mts each. and the ITEMs table control should get 10 ITEMS .
    How to add new items using User exit or Badi in VA01 while creating a sales order.
    i have identified the user exit . What code should be used to add new line items.
    kindly help me in solvng this.
    Waiting for your replies.
    Thanks in advance.
    Suki.

    hi
    wich user exit do you take for that ???

  • New settlement parameters  in   sales order  does not  work

    Hi
    I have a    sales order for  service material.    It is invoiced.    I  have to settle it.    The  existing  settlement rule  is  wrong. So  I have created a new allocation structure and   changed   settlement  parameter  in     the  sales order.   I save the  sales order.
    But in VA88 the settlement does not work. I get error message ' receiver cost element not defined and thet cat. PSG not defined.'
    But the same allocation structure work good for new sales order.
    Pl advise how  I  can  do the settlement for  old   sales orders,  subsequently changed for  settlement parameter ie allocation structure. 
    Thanks
    kamala

    Hello Kamala
    Not an expert on this subject, but here is what I suggest, Try and see if it works.
    1) Firstly retract the changes you did in sales order and settle first with the wrong settlement parameter (Old data).
    2) Now change the existing allocation structure, don't create NEW ONE. If you change an allocation structure, the changes only affect future settlements.
    3) Then reverse the settlement.
    4) Now re-do the settlement.
    Let me know how it goes. Take care.

  • Insert code in prgram to check sales order exits in your own program

    Hi Experts
    I want to insert a coding in IDOC , can anyone write in abap coding and show .....The program is to check if sales order for category PSTYV ( CATEGORY ) for items ...
    if found set flag true else set flag false...
    Eg
    clear flag
    insert code
    to check s/o for ZTAC item found
    if found
    set flag = true
    else
    set flag = false
    So how can I write a a code in ABAP
    Thanks in advanced
    Piroz

    Hi Fracis
    Thanks for your advice I did in this way ,  Is there any correction required
    form look_sap_saleord  using    p_in_string
                                    p_material_in          " Material No exits
                                    p_site_in              " plant
                           changing p_out_saleord_e        " sales order
                                    p_out_material_e       " Mat No
                                    p_out_order_e          " Prod Order
                                    p_out_wemng_e          " QTY goods received for order item
                                    p_out_psmng_e.         " Ordered Qty Item
      data: lva_prodord like afpo-aufnr,   " Production Order
            lva_prodmat like afpo-matnr,   " Material Number
            lva_saleord like vbkd-vbeln,   " Sales Order
            lva_pstyv   like vbap-pstyv,   " Category
            lva_wemng   like afpo-wemng,   " Quantity of goods received for the order item
            lva_psmng   like afpo-psmng,   " Ordered Qty Item
            lva_count   type i.            " counter validation
    CHECK FOR SALES ORDER IN VBAP IF EXITS
    GO TO DELIVERES
    ELSE CHECK REQUIRED PRODUCTION ORDER
           ihrez_e Ship to party
    check single if the sales order exits
      select vbeln from vbkd into vbkd-vbeln
        where ihrez_e eq p_in_string.
      Is the sales order exits for ZTAN Category ?
        select vbeln from vbap into vbap-vbeln
          where vbeln eq vbkd-vbeln and
                werks eq p_site_in and
                matnr eq p_material_in and
                pstyv = 'ZTAN'.
        The sales order is for the specified plant.
          lva_saleord = vbap-vbeln.
          lva_prodmat = vbap-matnr.
          exit.
        endselect.
      when an order for this plant has been found.
        if not lva_saleord is initial.
        exit.
        endif.
      endselect.
      check not lva_saleord is initial.
      select count(*) into lva_count from vbap
        where vbeln = lva_saleord.
      if lva_count eq 1.
        select vbeln matnr aufnr pstyv
        into (lva_saleord, lva_prodmat, lva_prodord, lva_pstyv) from vbap
          where vbeln = lva_saleord and
                matnr = p_material_in and
                pstyv = 'ZTAN'.
          exit.
        endselect.
      else.
        select vbeln matnr aufnr pstyv
        into (lva_saleord, lva_prodmat, lva_prodord, lva_pstyv) from vbap
          where vbeln = lva_saleord
          and matnr   = p_material_in.
          exit.
        endselect.
      endif.
       move: lva_saleord to p_out_saleord_e,           " sales order
             lva_prodord to p_out_order_e,             " production order
             lva_prodmat to p_out_material_e,          " material no
             lva_psmng   to p_out_psmng_e,             " QTY Ordered
             lva_wemng   to p_out_wemng_e.             " Qty Received goods
            lva_wemng   to p_out_wemng_e.             " Quantity of goods received for the order item
    endform.                    " look_sap_sales ord
    Regards

  • How to add a new output type in sales order header via ABAP program

    Hi All,
    I have to add new output type (ex Z001) in sales order header via an ABAP program. please let me know how to do this.
    Thank you all in advance.

    Hi,
    You can use the FM ..RV_MESSAGE_UPDATE..
    Thanks
    Naren

  • Create a new line item in sales order

    Hi,
    I have to create a new line item in a sales order. The scenario is that if we donot find the desired quantity from a plant. Then we have to go ahead and pick the remaining quantity from another plant and automatically create a new line item.The new plant is picked from a custom table so u need not worry about it.
    According to me I will have to use the BAPI for it but one constraint is that while creating a sales order the order number assignment is not done until saved. So what can be done in the case if its a new document.
    Kindly let me know if there is any appropriate user exit or if someone has worked on a similar requirement.
    thanks
    Varun

    Hi,
    Thanks for your response. I have tried to use these exits already but the problem dat comes here is dat when we try to use the BAPI we donot have any sales document created in the first instance(i.e. while creating an order) so the BAPI returns error and when i tried to populate the itabs in the program directly the new values just wont get processed.
    I think like: in case its a new document and we face this scenario I can just terminate the document creation and create a new document using the BAPI with proper plant assignments.But i am doubtful about the stability of this process.
    Kindly comment.
    Thanks
    Varun

  • New Message type for Sales orders

    Hi,
    We have the message type is ORDSRP(ORDERS05) and Function module IDOC_OUTPUT_ORDRSP for the sales orders.
    We have lot of custom fields to be added to the IDoc.
    Can any one suggst if it is better extending the current message of create a new one.
    Thanks.
    Rohita.

    Hi Rohita,
    Instead of changing the standard domain, You have to make the changes in the User Exit.
    Say Qualifier 001,002,003 were already there in the domain.
    001--Purchase Date
    002--Delivery Date
    003--Ordered Date
    In the user exit u have to just add the segment and the qualifier without making any changes to the Standard Domain.
    These Qualifiers are just like other variables and u can add whatever values to them that u want..
    You can add Qualifier 004 for Trnasportation Date or Goods issue date and have to communicate the MiddleWare informing that date with this Qualifier will be Transportation Date and they will do the mapping to the corresponding field in other syste.
    You can have as many message types as u want for the same IDoc type. There is no harm in having multiple message type. And u dont need to change the standard domain. It can be done without changing the domain.
    If u analyse the FM closely u will realise that they have done coding for those values in the domain.
    So instead of adding it to domain u just have to do the coding for this new qualifier.
    Revert back if u need any help on it.
    Thanks...
    Message was edited by:
            Utsah Garg

  • Change in Position Type In Sales Order.

    Hi All,
           My Customer has a Requirement at the Time of Creation and change of Sales Order if the Position Type of Item is ZTA1 and User Status is 'INDL' position type has to be changed to ZTA2.
           I tried that with all Exits in MV45AFZZ the Result is comming perfectly but the VBKD Table is not Being Updated and so the savings are only visible but IN Billing the changes are not applicble.
           Pls guide me the best way where i can Write the code.

    Hello Sebastian;
    It can be the relationship between the "completion rule" in the item category and the "Pos./neg. quantity" field in the copy
    control of the sales documents. It is blocked one way (if you try to change the field in the copy control when the completion rule is blank you get an error message) but it lets you go through when you remove the completion rule with a value already in the field "Pos./neg. quantity".         
    The rules that I mentioned above can be interfering when you make a changes in Requirement type.
    Regards
    Ruy Castro

  • VKM1 Triggers new price check on sales order

    When a user manually changes a pricing condition on a sales order and VMK1 is done at times the VKM1 will trigger a new price check like if doing 'Update' B - Carryout new pricing.   So it changes the pricing condition back to its condition record value and does not use the manually changed value.  It then shows in the SO change log as having been done via VKM1.  What was done was the credit status on the order was changed from B to A using VKM1.  Why would this trigger a new price check on the SO?

    The critical fields can be seen in t.code OVA8.
    You can also try to use Deviation % and Number of days fields in the same t.code and check the results.
    Regards,

  • How to add new condition record to sales order items

    Hello All,
    I have requirement to add to new condition record to get more discount on the item during sales order processing based on some conditions. In user exit SAVE_DOCUMENT_PREPARE , I am populating an internal with items for which additional discounts are required. So want to add condition record to those items to get additional discount.
    I know that in VOFM routines we can modify the existing condition record value but not sure what is the best place to append new condtion record to conditions table.
    Thanks,
    Suman

    Hi suman,
                   As which conditions you want or whatever logic you want for to write for applying the conditions you need to make changes at two includes and one FM by using Implicit Enhancement
    1) MV45AFZZ
    2)RV61AFZB
    3) FM name i am not remembering you can debug and find out.
    Regards,
    Shahezad

Maybe you are looking for

  • Document type for J1IV..?

    Hi all Can anybody explain me were to find the document type used for return delivery to vendor process. For taking print of return excise invoice , were the document type wehave to maintain.. Thanks sap-mm

  • DVI port for connect Cintiq on pro tower ?

    I will buy soon a mac pro 8-core 2,44Ghz and I wanted to know if there was a dvi port on the tower because I must connect a Cintiq Wacom 21ux on it. If there isn't a dvi port, is there another solution to connect it ? Thx by advance for your help

  • WD JCO dest. error

    Hi, I am developing a WD applic to access the SAP sys and get PO details. I am unable to see the destinations defined in adaptive RFC model to maintain JCO dest. in the WD Content Admin.. Please let me know the  reason for it and how to go about it?

  • Picture & Slideshow error message...

    www.wrdinc.net or web.mac.com/wrdinc i have several pages of pictures on my iWeb site. on most of the pages ("captured" "europe circa 2002" "the empire state") the pictures and slideshows display normally. On one page ("the happiest place on earth")h

  • JCOPs Converter Usuage

    Hello, everyone! I have a very important question. I'm creating Ant's build.xml file to compile JavaCard classes and make CAP-files. I've reviewed one created by Microexpert, but it's old and some things are outdated. The problem is in CAP-file creat