Creation of Batch number

Hi Experts,
I have a probelm with the Transaction MIGO to restrict the ignore the batchnumber entered by the user.
If the user is not enter the batch number, then i can generated the new number by using the following 2 UE's
EXIT_SAPLV01Z_001 (ZXVBZU01)  & EXIT_SAPLV01Z_002 (ZXVBZU02) and it is working fine.
If the user enters , then System first check that whether it is already exist in the Database . If it won't find then automatically it is considering the same number.Which needs to be stopped.
Any body has an idea about this requirement, to ignore the user entered value.
Actually, there are 2 more exists, EXIT_SAPLV01Z_011& EXIT_SAPLV01Z_012 there i can't change the value of the batch number.
Any suggestion or Any alternative way or Any idea Please......?
Warm Regards,
Vijay

Hi,
I think you can restrict by using FM EXIT_SAPLV01Z_001, this i copied the FM documentation for your reference. Just read the FM documentation you will get an idea
You can restirict by using automatic generation using number ranges
<<Function module Documentation>>
Functionality
You can use this customer function call (CFC) to replace the standard number range (object, subobject, number range, and year) with one of your own. This is used subsequently to determine a new batch number.
Number assignment is carried out using the central number assignment.
The communication structure X_BNCOM contains the application data known up to this time. You can extend this structure in the DDIC using structure BNCOMZ.
Using the parameter CUST_NO_INTERNAL, you can suppress the number assignment function. Then you can either generate a batch number in function module EXIT_SAPLV01Z_002 using your own criteria or suppress the entire number assignment function.
Using the parameter MESSAGE_WHEN_AUTO, you can decide if a dialog box is to appear before a new number is assigned. This only happens during online processing.
Example
You can define internal batch number assignment according to your requirements via the enhancement SAPLV01Z with the exits EXIT_SAPLV01Z_001 and EXIT_SAPLV01Z_002
SAP delivers a total of 6 examples for batch number assignment:
1. Copying the production order number to the batch number
2. Copying the sales order number to the batch number
3. Material-type-dependent batch number assignment
4. Material-number-dependent batch number assignment
5. Including the date in the batch number
6. Including the plant number in the batch number
For examples 1 and 2 you have to use the exits EXIT_SAPLV01Z_001 and EXIT_SAPLV01Z_002.
For examples 3 and 4 you have to use the exit EXIT_SAPLV01Z_001.
For examples 5 and 6 you have to use the exitEXIT_SAPLV01Z_002.
For a detailed description of the examples, see below.
Prerequisites
1. Internal batch number assignment via the customer exit is activated:
To do this, in Customizing, choose Logistics general -> Batch management -> Batch number assignment -> Activate internal batch number assignment.
2. Maintaining the number range object
Two number range objects are provided for batch number assignment:
Standard number range for batch number assignment BATCH_CLT
Number range for material-type-dependent or material-number-dependent batch number assignment BATCH_MAT
Activities
1. Use the SAP enhancement SAPLV01Z:
a) In transaction CMOD, create either a new project or use an existing project.
b) Add the SAP enhancement SAPLV01Z to the project.
2. Copying the example code:
a) Choose Component.
b) Choose Change.
c) Choose:
EXIT_SAPLV01Z_001 for examples 1-4
EXIT_SAPLV01Z_002 for examples 1-2 and 5-6
d) Choose Edit -> Copy SAP source text.
The example code is copied to the relevant table in the function module exit.
e) To copy the example, remove the comment symbol before the include it pertains to.
3. Activate the project.
When you activate the project, the enhancement with the function module exits EXIT_SAPLV01Z_001 and EXIT_SAPLV01Z_002 comes into effect.
Examples
Example 1
Copying the production order number to the batch number
When a batch is produced, the process order number or production order number is copied as the batch number. This type of assignment is only possible in connection with process orders or production orders.
Outwith an order, a number range is determined for batch number assignment. In this example, it is the standard number range BATCH_CLT.
If the order has not yet been saved (for example, when a number is assigned when the order is created), a temporary number is created. A message appears prompting you to save the order. The system then assigns an order number which is accepted as the batch number.
The system checks whether a batch already exists with this number. If this is the case, the system aborts internal batch number assignment with a corresponding error message.
Note:
In this example, note that the include LXVBZB21 in EXIT_SAPLV01Z_002 has to be activated at the same time, as actual batch numbers are not assigned until this is activated.
Example 2
Copying the sales order number to the batch number
If a batch number is assigned in connection with a sales order, the sales order number is accepted as the batch number.
If there are no sales orders, a number range object is defined with a number range from which the batch number is taken. If a batch already exists with this sales order number, the batch number is assigned externally.
Note:
In this example, note that the include LXVBZB22 in EXIT_SAPLV01Z_002 has to be activated at the same time before actual number assignment can take place.
Example 3
Material-type-dependent batch number assignment
In the number range object BATCH_MAT a separate sub-object is created for each material type. Note that the number range object is maintained accordingly or batch number assignment cannot take place.
For example, if the material "flour" belongs to raw materials, it is maintained in the sub-object ROH, and the batch number is taken from the same number range as the material "eggs" which also belongs to the raw materials group.
Example 4
Material-number-dependent batch number assignment
In material-number-dependent batch number assignment, materials that are handled in batches must be maintained in the table BNMAT, which specifies the assignment of the material to the number range.
If there is no assignment in the table, the system aborts batch number assignment. An error message appears informing you that batch number assignment is not possible and specifying the table that has to be maintained.
Each material number is assigned a number range object, a sub-object, and a number range in the table BNMAT. This is how each material receives its own batch number range.
The number range object BATCH_MAT is an example of this. The material numbers are divided into groups via their material type that match the sub-object. Each material number is then assigned its own number range by table BATCH_MAT. The number ranges used must be maintained in the number range object.
Examples 5 and 6
Including the date or plant number in the batch number
The number ranges for the batch numbers must be defined in a way that ensures that no characters are overwritten by the templates.
Parameters
X_BNCOM
CUST_NO_INTERNAL
NR_RANGE_NR
OBJECT
SUBOBJECT
TOYEAR
MESSAGE_WHEN_AUTO
MESSAGE_DONE
Exceptions
CANCELLED
Regardas
Krishna

Similar Messages

  • MANUAL CREATION OF BATCH NUMBER(EXTERNALLY)    -   NOT TO BE ALLOWED

    MANUAL CREATION OF BATCH NUMBER(EXTERNALLY)   -  NOT TO BE ALLOWED while creation of Process Orders.

    Hi,
    Check t code OMCZ whether internal Batch no assignment is active or not.
    From F1 help
    In this step:
    you activate internal batch number assignment
    you define whether internal batch number assignment is allowed for goods receipts that have an account assignment
    Standard settings
    The standard version of the SAP system contains a predefined number range.
    Further notes
    Batch number assignment uses two function model exits with which you can define templates for batch numbers. You make the necessary settings in work step function module exits for internal batch number assignment.
    The system checks whether the assigned batch number already exists in the system. Should the number already exist, the function is terminated.
    When creating a client by copying another client, please note that internal number assignment is not active in the target client. You must activate it manually.
    Regards
    Anupam Sharma

  • No New Batch number creation at the time of Material Transfer Movement(309)

    We are upgarding from 4.6C to ECC6.0. We have an issue in regards with the material movement type 309. At the time of creating the material tranfer using the same material as issuer and receiver, the same plant and storage location ( this process is used by the business to diferentiate batches).
    In 4.6C a new batch number is created automatically when 309 movement is posted; stock and characteristics transfered are allocated at the new batch created automatically.
    The same case in ECC6.0 does not create a new batch as done in 4.6C. We have looked for any SAP note or forum discussion without success.
    If anybody has an answer for this issue, let us know.

    As a matter of fact these configuration has been checked before, additionally we compare configuration at 4.6C and ECC6.0 and it is the same but the new batch creation (for this specific case) is working at 4.6C, not at ECC6.0.

  • Inspection type 01 - inspection lot creation based on vendor batch number

    Hi Guys,
    this topic has been discussed several times here, but I was not able to find a suitable answer for my question.
    I am facing the folowing requirement:
    I have activated inspection type 01 for a raw material.
    I am receiving a firs goods receipt from vendor A with vendor batch number 0001.
    The system creates its own goods receipt batch number 0546 based on internal numbering.
    A new inspection lot is created.
    I am posting a second goods receipt from vendor a with vendor batch 0001.
    The system creates a new batch number 0547 based on internal numbering.
    A new inspection lot is created.
    I do not want to get the second inspection lot, because I received vendor batch 0001 before and I am assuming it has been inspected or is in inspection.
    Option 1: Post the second goods receipt against the first internal batch number created.
    I am aware of this need at the moment, but a user is not always checking if there is an internal batch with the same vendor received before.
    Can I customize the system to create inspection lots based on the fact that the vendor batch number was received before?
    Or do I have to use an exit and some ABAP code to get the wanted result?
    Thanks for your advice in advance.

    You need to use one of the enhancements that Do-Wook has suggested.  There is no standard SAP way to suppress the inspection based on the vendor batch number.
    With the first enhancement you use the system to check for a previously received vendor batch and if one is found, then that batch number is proposed and not the next one from the numbering series.  In this case, the lot isn't created than due to the inspection lot control of the inspection type.
    With the second enhancement you check the vendor batch number and if it's been received you suppress the inspection lot creation and the stock goes right to unrestricted.
    You'll probably need to do one or the other.  Myself, I prefer the first enhancement.
    Craig

  • Process Order Batch number generation at the time of order creation

    Dear All,
    I m facing some issue at the time process order creation:
    Current Settings:
    1. Batch Number Creation at the time of order create.
    Reason for this setting: Release of order is done  by releasing operations one by one, therfore batch number will be generated on the final operation release, thats why we set up batch creation at the time of order create.
    2. For FG batch number generation there is a program that copy the SFG(in Order BOM) Batch number to FG. ITs a industry requirement.
    Problem:
    when we create FG order system generate the error message at the time of order creation tht No batch could be determine.
    Please suggest the solution
    Thanks,

    Hi
    Hope you have cretaed Batch serch strategy in COB1
    U need to maintain it as per your strategy type.

  • Updating Batch Number while delivery creation from sales document

    Hi Experts,
         I have to write code inside user exit MV50AFZZ which updates batch number during delivery creation. Suppose I have a sales having more than one line items. Each line item have different material numbers, and one material number may have more than 1 batch number. And all these batch numbers have to be updated for their corresponding material numbers. Batch  number corresponds to LIPS-CHARG. So how we can maintain values for this field more than once for a particular material number?

    Hi Pankaj,
    Were you able to update the Batch Number?
    What is the function Module that you used? and where exactly did you code in the logic?
    Thanks,
    RV

  • Duplicate Batch number creation during MIGO wrt PO

    Dear al SAP
    We have activated batch management at material level and set external number range. During MIGO say for the first line item, I have entered external batch number as 123. If I give the same batch number for the second line item of the same material code, system should throw an error message.
    Pls explain in detail SPRO setting required for this.

    In Logistics General -> Batch Management -> Creation of New Batches -> Define Batch Creation for Goods Movements select the option "E" Manual and check against external number range

  • Automatic Batch Number Creation

    Dear All,
      is it possible to create automatic batch number creation through DI API..? tell the me the solution to create Automatic batch number..
    Thanks in Advance

    Shankar,
    If you have SDK samples, you will be able to find the 04.SerialAndBatch sample that explains what you want.(usually located at \Program Files\SAP\SAP Business One SDK\Samples\COM DI\VB.NET\)
    still have doubts, post back.
    Binita

  • Auto batch number creation on CO15 GR

    Hi experts,
    Can you guide me how to setup CO15, where during confirmation and auto GR of FG, system can supply a Batch Number (via specific logic in exit) automatically?
    Thank you!

    CO15 is the production order confirmation screen  and  if you acitvated AUTO GR for the order and if the material is batch managed ,  you should have configured  batch internal number active,  system will create a batch number automatically.
    Based on where you have created user-exit  ( if it is part of batch creation  BADI),  that should also kick in.
    You can also look in creation of batch at the production order level itself when the order is released. 
    cheers
    Rav
    Edited by: Rav on Jan 6, 2011 11:24 PM

  • Batch number format setup and auto batch creation during first GR

    Dear all,
    This is a batch question.
    I know that both the master batch and the stock data for the batch are created automatically during the first goods receipt. Thus, I do not need to create this data manually.
    My question are following:
    1 - what is the machnism that trigger this auto-batch creation in the system during the first goods receipt? is it from some kind of configuration?
    2 - If I want my batch number to appear in certain format, for example, first four digit is customer code, middle two code is country code (i.e. US, UK), and the remaining as goods receipt date. How do I setup this in the SAP system.
    3 - If batch classification is active, one can assign characteristic values to the batch when entering the goods receipt. HOwever, normally when I perform a goods receipt in MIGO, after putting in the production date and the batch number, I will hits the checkbox and if no problem, I will post the 101 document. WHERE in the MIGO screen I can assign the characteristic value to the batch?
    Thanks.

    My question are following:
    1 - what is the machnism that trigger this auto-batch creation in the system during the first goods receipt? is it from some kind of configuration?
    ==> Yes - See IMG activity 'Define batch creation for Goods Movements'
    2 - If I want my batch number to appear in certain format, for example, first four digit is customer code, middle two code is country code (i.e. US, UK), and the remaining as goods receipt date. How do I setup this in the SAP system.
    ==> See exit EXIT_SAPLV01Z_003
    3 - If batch classification is active, one can assign characteristic values to the batch when entering the goods receipt. HOwever, normally when I perform a goods receipt in MIGO, after putting in the production date and the batch number, I will hits the checkbox and if no problem, I will post the 101 document. WHERE in the MIGO screen I can assign the characteristic value to the batch?
    [[> See IMG activity 'Activate Batch Classification for Goods Movements in IM"

  • PP : BATCH number creation

    Hi All,
       I am assigning batch number externally during the production order creation by using user exit. In my case i have to do
    "The same batch number generated for the Main co-product should be assigned to the other co-products at the same time".
         Please suggest how to achieve the same.
    With regards,
    Pravin

    Hi Pravin,
    These exits will help you change the batch number to specific i.e. sales order number or production order number or date or plant etc. as in the function module documentation. But if you want to assign any batch which you've created using MSC1N or BAPI_BATCH_CREATE, then I feel that probably you've to use some other user-exit, these are not the ones which are going to help.
    Try these BADI's:
    WORKORDER_CONFIRM
    WORKORDER_GOODSMVT
    WORKORDER_UPDATE 
    Hope this helps.
    Regards,
    Satya

  • Batch Number creation through DIAPI

    Dear all,
         i tried batch number creation through DIAPI.. but its shows error message [WTR1.Whscode][Line:1],'No matching Records found(ODBC-2028)' any body helpme  in this regard..
    thanks in advance.. here i have attached my coding..
    Dim objLines As SAPbobsCOM.StockTransfer_Lines
            objForm = objAddOn.objApplication.Forms.Item(FormUID)
            Dim objStockTransfer As SAPbobsCOM.StockTransfer
            objStockTransfer =    objAddOn.objCompany.GetBusinessObjectSAPbobsCOM.BoObjectTypes.oStockTransfer)    
            objStockTransfer.DocDate = System.DateTime.Today
            objStockTransfer.TaxDate = System.DateTime.Today
            objStockTransfer.FromWarehouse = "01"
            objStockTransfer.PriceList = 1
            objStockTransfer.Lines.ItemCode = "B000001"
            objStockTransfer.Lines.Quantity = "1"
            objStockTransfer.Lines.WarehouseCode = "BAP"
            objStockTransfer.Lines.BatchNumbers.BatchNumber = "B10"
            objStockTransfer.Lines.BatchNumbers.Quantity = "1"
                  objStockTransfer.Lines.BatchNumbers.Add()
                If objStockTransfer.Add <> 0 Then
                objAddOn.objApplication.SetStatusBarMessage(objAddOn.objCompany.GetLastErrorDescription, SAPbouiCOM.BoMessageTime.bmt_Short, True)
                objAddOn.objApplication.MessageBox(objAddOn.objCompany.GetLastErrorDescription)
            Else
                objAddOn.objApplication.SetStatusBarMessage("Inventory Transfered Successfully", SAPbouiCOM.BoMessageTime.bmt_Short, False)
            End If
    With Regards
    G.shankar Ganesh

    Shankar,
    your code looks fine. just ensure that the warehouse code and batch you are specifying , do exist in owhs and oibt tables respectively, with the specified quantity. ( and the best way to check it is, try stock transfer from UI with the same parameters.)
    also, may be off topic, but, before specifying batch lines, you need to ensure that items are managed by batch or not )
    regards,
    Binita

  • Production Order Number and Batch Number same during order creation

    Hi All,
    I wanted to keep the Production Order number and Batch Number same during creation.
    How I can do that during creation of order only. So during creation same number to be get assigned automatically in the background.
    One thing I can maintain ; the same number range for both.
    But how to activate other functionality.
    Regards,
    Amit

    Hi SAP2511,
    For Production order-
    1.You can define a Order type  and  Mantain the number range same as batch number range (in  OPJH transction)
    For Batch
    1.Activate Automatic internal batch assignment - (OMCZ)
    2.Number range for batch - for object - BATCH_CLT - (OMAD)
    For batch creation at time of Order creation -
    You can create Automatic batch at the time of order creation or order release
    1 Create Production scheduler Profile(OPKP) and assign in Work scheduling view of material master for which you want to create batch at the time of order creation or release.(Select automatic batch creation at the time of release or creation in OPKP)
    Things to be taken care -
    1 . What if you set deleation flag for order?
    Regards
    Girish
    Edited by: girish khobare on Aug 20, 2010 9:31 AM

  • Creation and increment of batch number

    Hi,
    Very urgent please.
    I have one reuirement in my bdc for uploading AR OPEN ITEMS Using bdc ,
         batch(4)     bukrs(4)     kunnr(10)        hkont(10)     
         01     4000      D1000504          4010
         01     4000          165410     4010
    for debit and credit we have one batch number and it has to be incremented according to document posted
    1  dr      document number1
    1 cr  
    2 dr
    2  cr   document number2
    U know this has to be incremented and not updated in sap its only batch grouping the custmer .
    Regards
    subba
    Edited by: KODAMANCHILI SUBBARAO on Sep 25, 2008 3:27 AM

    SAP does not stop you from re-using an existing batch number. The message that you get is in a SAP standard delivery just a warning, as it is from a business process unusual that the same batch can be received multiple times.
    If it is an error in your case, then somebody in your organization has changed the message attributes. so you should talk to them (see the change log in your DEV system) to know why this was done and  what the solution for your case could be

  • Batch Number Creation

    One of our requirements is:
    We need to assign batch no to the materials procured from an external vendor and for the materials procured internally from a different company code - use the same batch no.
    How to do this configuration and what are its implications.

    Hi,
    You mean to say that purchase order receipt and production order receipt should have the same batch number for the material.
    I think you can have a reserve batch by creating in MSC1N for this material and can assign the batch when you take goods receipt instead of allowing the system to suggest batch
    But what will be business requirement for keeping the same batch if you are procuring from two different places as the characteristics of both may differ.
    Cheers,
    Sridhar

Maybe you are looking for

  • Home Sharing not working between wireless PC's / devices and ethernet wired PC's on the same router.

    Home Sharing is not working between wireless PC's / devices and ethernet wired PC's on the same router.  I installed a new Verizon FIOS ActionTec  MI424WR GigE wireless / ethernet router, replacing the original FIOS router.  With the old router Home

  • How to create an object using sql*plus?

    Hi, I have tried to create an object , but after pressing enter key I could not get SQL command prompt or errors. How to come out from this? Could you help me to find what's wrong. SQL> create type course as object( 2 course_no number(4), 3 title var

  • Manipulations with physical and logical names

    Hello ppl, Is there any way to see/change phisical and logical names of object in one place/screen? I mean I want to set them to different values and see that change, but without fuzzu, complex way of changing naming and propagate modes. TIA, Alex

  • Unexplained code in "Classroom in a Book" on AS3

    I'm slowly going through the Adobe "Classroom in a Book" on ActionScript. Every now and then the sample code includes what appears to be a property "e" as in "function doThis ( e:mouseEvent)" or "var rbg:RadioButtonGroup = e.target as RadioButtonGrou

  • Spinning beach ball - iMovie project hangs.  Help!

    iMovie starts OK and appears to be working on other projects, but I've got one project that appears to hang iM whenever I try to preview ("play") it. I'm at a loss and need help! I'll croak if all my work is damaged. The problem started not long afte