Checking the duplication of batch number

hi expert
       I m using the Stored procedure (SP_TranscationNotification) for checking the duplication for Batch Number ie when a alreasy existing batch number is given an error message should be shown.
      declare @ItemCode nvarchar(64)
      declare @batchNumber nvarchar(64)
      if @transaction_type in ('U','A') and (@object_type='106')
         begin
            set @itemCode = LEFT(@list_of_cols_val_tab_del, CHARINDEX(CHAR(9),  @list_of_cols_val_tab_del,1)-1)
               set @batchNumber=substring(@list_of_cols_val_tab_del,charindex(char(9),@item)+1,len(@list_of_cols_val_tab_del))
             if exists(select @itemcode,@batchnum from OIBT where BatchNum=@batchNumber and ItemCode=@Item)
                begin
                    select  @error = 1, @error_message ='batch number already exists'
                end
        end
     Here in the above SP , i cant able to get the batch number,Please anyone give me the solution of getting batch number or suggest a method to get the value between first and second tab of a row.

Please check this answered link. Your level of batch would be defined on plant, thats why you are getting duplicate batches. Batch definition at Client level has unique batch numbers.
Change the Batch Level
Edited by: Afshad Irani on May 22, 2010 10:54 AM

Similar Messages

  • In the packing list, batch number and expiry date is not appearing for a ma

    Dear Friends,
    I have an issue in the packinglist.
    In the packing list, batch number and expiry date is not appearing for a material.
    But in the delivery the batch number and expiry date is appearing.
    Why this has triggered and how to solve this?
    With regards

    Hi Vamsi,
              Please go through the output type Smart form or script programe of the packing list and check with the abaper If is there any Bug.
    Regard's
    Murali.

  • How do i check the serial and model number of my iphone 4s

    how do i check the serial and model number of my iphone 4s

    Check them for what, exactly?
    You can check the warranty status here: https://selfsolve.apple.com/agreementWarrantyDynamic.do
    If you don't know the model / serial number, you can find it in Settings>General>About.

  • How to check the InDesign cs6 serial number on my office iMac? I am no the one who download it.

    Hi,
    How to check the InDesign cs6 serial number on my office iMac? I am no the one who download it.
    My InDesign cs6 keeps crashing, so my boss ask me to reinstall back. But the problem is, how do I check the serial number? Someone else has already installed it, and we cant track who.
    Please help.
    Regards,
    Cita

    >Someone else has already installed it, and we cant track who
    Not very good office/employee management... but if you DID know who, and you had his/her Adobe ID, you could go to https://www.adobe.com/account.html for a list of activated programs

  • Duplication of Batch Number.

    Hi ,
      I have done GRN (101 Mvt type ) for a material on 05/05/2010 and the system has automatically generated a batch Number 000051820 and i have done the GRN for different on 10/05/2010 and the system has taken the same batch number 000051820, why is this happening , how the duplication of the batch numbers are getting generated , what may be the reason for this ?
    regards
    Rakesh

    Please check this answered link. Your level of batch would be defined on plant, thats why you are getting duplicate batches. Batch definition at Client level has unique batch numbers.
    Change the Batch Level
    Edited by: Afshad Irani on May 22, 2010 10:54 AM

  • Check a UDF of batch number when I create Goods Issue or Delivery

    Hello,
    I manage my items with batch number and I want to block the creation of all  Goods Issue or Delivery in function of the value of a UDF (created the OIBT table).
    I think I can achieve this by using the stored procedure SBO_SP_TransactionNotification, but I never used it and I don't know if (and how) I can retrieve the selected batchnumbers of my documents.
    Is it possible to do so, or do you have any better suggestions???
    Thank You,
    Xavier.

    Hi Xavier,
    You can find some additional information about the SBO_SP_TransactionNotification stored procedure here:
    [https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e991e2b9-0901-0010-0395-ef5268b00aaf]
    The stored procedure only returns the following;
    - Object type
    - Transaction type
    - Num_of_cols_key (number of columns in the primary key of the object)
    - List_of_key_cols_tab_del (the list of the columns in the primary key)
    - List_of_cols_val_tab_del (the values of these columns)
    So the stored procedure doesn't directly return the information you want. You would have to link this with a DI application to access the document in question using the value of the primary key returned by the stored procedure. (Or through using an SQL query also using the primary key returned by the SP).
    Please note however, that SBO_SP_TransactionNotification is designed for notification purposes only. SAP can only support any issues arising out of use as a notification mechanism; the use of this stored procedure to block transactions or work as an authentication step are not supported. Please see SAP note 1011154 for more information.
    Regards,
    Niall

  • What are the Methods to check the Relation between BP Number and User ID ?

    Hi Colleagues,
    Requirement
    Hi, i need to generate a report to Management for approx 1400+ Partners and am facing some diffculties.
    While i have the BP number of the partners and their email ID's, i am unable to find the USer ID (ABAP ID) that these are mapped to. 
    Is there any Tcode or Table(s) that i can use to find this relationship ?
    Note:
    I have tried Tcode BP in CRP, but am unable to find the ABAP ID in 'Identification Tab' for any Role for these partner Id's.    The same can be found for Non-Partner Id's though.
    I have Tried relationship between ADR6 & USR21 tables too, but it gives me output only for 500 or so users.
    Rgds
    Ganesh.S

    Hi,
    Use FM BUP_PARTNER_GET.
    Regards,
    Caíque Escaler

  • Batch number coming automatically at the time of Process order release

    Hi All,
    I want the system generated batch number for header material to come automatically at the time of process order release.
    At present ,the batch number is entered manualy dering process order creation.
    Can anyone pls guide abt the settings required for the same

    Dear,
    Define the  production scheduling profile CORY then
    Auto Batch Creation = 2 On release.
    Then assign this to your FG or SFG materials in work scheduling view in material msater MM02. Then create new order and check.
    Now for automatic generation i have to set internal number asignment for batches.
    Batch will create for movement type say 101 SPROLogistics - GeneralBatch mangment--Creation of New Batches --Define Batch Creation for Goods Movements. so it will have same logic in MM for 101 GR against PO will be internal number range but no effect in SD.
    Regards,
    R.Brahmankar
    Edited by: R Brahmankar on Mar 12, 2010 12:40 PM

  • Available Serial/Batch Number under the bin location

    Hi Expert,
    When applying bin location in SBO 9. Each line need to select particular bin location for counting. Now, i encounter a problem to list out the available serial/batch number under the bin location.
    i am able to get the list of serial number but lacking the bin location filter.
    SELECT ROW_NUMBER() OVER (ORDER BY T2.ItemCode) AS 'RowHeader', T2.ItemCode, T0.BinEntry ,
    UPPER(T2.DistNumber) AS 'MnfSerial', T2.InDate, T1.WhsCode FROM OSRQ T1 INNER JOIN OSRN T2
      ON T1.SysNumber = T2.SysNumber AND T1.ItemCode = T2.ItemCode
      INNER JOIN INC1 T0 ON T0.DocEntry = 1
    WHERE T1.Quantity > 0 AND T1.ItemCode IN (SELECT ItemCode from
    INC1 WHERE DocEntry =1)

    Hi,
    Check these tables :
    OSBQ
    OBBQ
    Regards
    Edy

  • Cost of batch number in the past

    hello
    is there a way to see what the cost of a batch number was at a specific date(in the past) as well as the quantity on hand in the past?
    The client wants the following information :
    Batch Number
    WHS
    Item Code
    Description
          Quantity
    Weight
             Tonnage
    Cost
    CJ77974
    A01
    CC 0.70X1300 04
    CC 0.70X1300 EN10268 HC 260
    23 260.00
    1
    23260
    CJ78006
    A01
    CC 0.70X1300 04
    CC 0.70X1300 EN10268 HC 260
    20 530.00
    1
    20530
    CJ77925
    A01
    CC 0.70X1300 04
    CC 0.70X1300 EN10268 HC 260
    6 790.00
    1
    6790
    CZ80386
    A01
    CC 1.00x1400 F65
    CC 1.00X1400 G3135 SPFC 440
    23 170.00
    1
    23170
    They this want to see the cost and quantity on hand for e.g. 30/05/2014(a date in the past).
    Any advise will really help.
    thanks
    Janice

    Worked for me too. options->options->privacy->remember download history

  • How to generate the batch number for group of records

    Hi All,
    requirement: i have created one sequence to generate the batch numbers.i have to get the nextval of the sequence for batch number (this column is not part of the table. its dynamic column/alias column) only for every 50000 records of a table.
    detail description:
    for example, if i have 10 records in a table. And, if i want to generate the batch number for every 2 records, then the output should look like belo.
    batch-number qty
    1 10
    1 20
    2 30
    2 40
    3 50
    3 60
    4 70
    4 80
    5 90
    5 100
    Please help me on this. Please let me know if you need more info.

    one more update on the above request. this has to be done using SQL query only.

  • 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

  • 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

  • Automatic Batch Number Generation in tcode MIGO...

    Hi Experts,
                     There is automatic Batch Number is generated  after clicking on Pushbutton  "Check" in transaction code MIGO. Instead of that user want Batch Number Generation after clicking on Pushbutton "Post" . Can anybody tell me the procedure for the same..
                    Thanks in advance.
    Best Regards,
    Vinayak

    HI Vianayak,
    You can implement a Badi for your logic.
    You can implement Badi :MB_MIGO_BADI and write your logic in method CHECK_ITEM .
    Here you can restrict the Batch number based on Fcode for the Check and Post buttons.
    Like if the user click on Check button: based on the fcode for the check button u can restrict it and similarly if the user click on Post button you can pass the value for Batch number. This method get called in both the cases.
    Hope this solves your problem.
    Regards,
    Satyam

  • Verification field for Batch number - Transaction LM05

    Hi Experts,
    Can some one help on the issue of adding a verification field for BATCH NUMBER on the screen 2502 and make it work.
    Requirement : Add Verification field for batch number and build the logic to verify the batch number -  as the SAP standard does for other fields.
    I have proceeded to some extent and seems like I am not winning.
    Steps done :
    1. Copied physical screen 2502 (SAPLLMOB)  to screen 9502(SAPLXLRF)
    2. Changed the screen to subscreen and removed the OK_CODE from the element list.
    3. Created the project ZMWMRF502 and assigned user exit MWMRF502 to this project.
    4. In the components of the project assigned 9502(SAPLXLRF) to 1502((SAPLLMOB).
    5. Assigned the screen 9502 to logical screen 0502 in the config.
    6. In the transaction LRFMD given the username and variant '1'.
    Now When I execute the transaction LM05 and give the TO number, the system calls my screen 9502 with new field seen in that.
    But the screen is completely greyed out with no data in that.
    I checked PBO and PAI of my new copied screen.
    In all the modules which I received from the copy of SAP standard screen there is no code except name.
    I mean to say that names of all modules exist but when I double click on any module it ask me to create a new object.
    If I have to create module similar to SAP there is a lot of coding in side. How do I proceed further.
    Can some help me.
    Thanks and regards
    Joshi

    Hi Dez,
    If you go in to transaction LM05 and input a number of TRANSFER ORDER, it will take you to a screen where the system will populate the fields pertaining to that particular transfer order.  In that screen we have normal fields as well as verification fields for that particular field. These screens are used on scanners. When the scanner scans the material slip, the corresponding value such as material number, storage bin number etc will be get populated in the verification field.  When the user selects next then the system will perform a check for the two values and pops up an error message if required.
    So there are verification fields for material number, storage type, quantity etc but not for batch.  Our user requirement is to put a verification field just by the side of batch number field and perform same operation as it does for other fields.
    Hope you understood.
    Thanks and regards
    Joshi

Maybe you are looking for