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

Similar Messages

  • 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

  • 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.

  • 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

  • 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

  • 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

    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

  • 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.

  • Block internal batch number at plant level

    Dear Experts,
    I have activated the internal batch number assignments at client level. But for some plants or one of the company code, I want to block the internal batch number creation during the goods receipt at production order confirmation(CO11N). Is it possible ? How? Can we restrict for some of the plants/comany code and allow for other plants/company code?

    Check this link:
    http://help.sap.com/saphelp_46c/helpdata/en/25/2838bf4f7811d18a150000e816ae6e/content.htm
    FF

  • Stock to Stock Transfer (Changing Batch Number)

    Occasionally we need to "correct" a batch number.  Most often because the user let the system assign an auto Batch Number instead of using our site procedure to create a "Smart" Batch Number (i.e. MMYYYYXXXXX).  We correct this by executing the MIGO Transfer Posting, Other, Movement Code 301.  This works for us, but is there some display screen that could be transacted, and them printed so it could be included in our Batch History Files?  This print out would need to show the "OLD" and "NEW" Batch Numbers.

    I m just wondering if this approach is a good one. or just a waste of time and resources.
    The problem starts with the fact that the user do not follow your procedures to assign "smart batch numbers" . And you want the same users to take a screenshot and attach it to some file.
    Will this really work or just create another gap to be monitored?
    Like for goods receipts and goods issues you can well have a material document printed for transfer postings. But I consider this as well as waste of environment since it has no more info than you have anyway in your system and you can find this evidence with MB51 whenever you want.
    MB56 Batch where used list should also be able to display the transition from one batch to another.
    I also wonder why you are using 301 movement, this is called plant to plant, I tend to use simple movements  where the users have not many options to do something wrong, hence I would do the batch to batch movement with 311.
    And last but not least I would use the user exits for batch number creation to create this smart number automatically instead of manually, further it will ensure that you do not get any other internal batch numbers if the user forgets about your process

  • Batch creation through ME21N, ME22N and MSC1N

    Hi All,
    Please note we are already using EXIT_SAPLV01Z_001, EXIT_SAPLV01Z_002, EXIT_SAPLV01Z_003, EXIT_SAPLCLFM_002, EXIT_SAPLV01Z_012, EXIT_SAPLV01Z_014 for Batch creation based on different logics for Material type, Plant and PO doc type and currently using these exits for logic it allows us to create new internal batch number during PO creation (ii) change already existing batch with some new number (of couse this number must not be used in some other PO) in PO change and (iii) create new internal batch number using MSC1N, by inputing plant, stor. loc etc. But currently i can create batch with 1 digit, 2 digit, and so on.
    The requirement is to allow user to create batches only with 10 digits during:
    (i)PO creation (ME21N)and PO change(ME22N) and also during
    (ii) transaction MSC1N
    currently in all three ME21N, ME22N or MSC1N it allows to create batch with 1 digit, 2 digit,3 digit and so on . i want to create batch with only 10 digit.
    Please tell this is possible through configuration steps or some changes are required to be done in above said user exit.
    Regards
    Rahul Shukla

    Hi Jurgen,
    Thanks for your reply.
    In ME21N i am able to assign batch in PO
    (1) By clicking on 'create' button appearing just side of Batch field in item Tab "Material". I think this create button is appearing due to user exit being applied here. Here it creates and assigns internal number automatically (from range 01in Batch_Clt) based on the Material type and Plant combination (Some logic defined in user exit)
    (2) By putting any random number manually (both numeric and alphanumeric)whether 1 digit, 2 digit,3 digit in Batch field in item Tab "Material" it will accept and in this case also po is saved.
    same way i can do changes in batch number in ME22N and able to save.
    In MSC1N also due to user exit applied if i give Material number alone  and enter, it assignes the internal batch number based on Material type and plant logic defined in user exit.here also if i input some random number manually in batch field it accepts and that random batch number is created for material.
    Now i want that i should be able to put random batch number manually but that number must be out of the number ranges defined in Batch_CLT object (Also the number must be exact 10 digits length as is there in defined number ranges) and not any random alphanumeric number . Also i am not able to understand how it is accepting random alphanumeric number (like ABC111)although all number ranges defined are numeric only.Also external number range is 0008000001 - 0089999999 which is numeric only.
    Regards
    Rahul

  • How to create the automatic serial Number through DIAPI

    Dear All,
          i Tried to do the Inventory Transaction through DIAPI with Automatic Serial Number creation ,its working fine but i have problem when i  choose another warehouse.Let me give an Example i have three ware house called W01,W02,W03 for the first ware house W01 i can  automatically create the serail from 1 to 100, the moment when i choose the second ware house (i.e.,) W02 my serial number should start from 1..  any one can help me this regards
    Thanks in advance
    G.shankar Ganesh

    Dear G.shankar Ganesh,
    The serial number is unique in all warehouse in B1 system. It means if one item has serial number '1', then
    you can not add the serial number '1' for all warehouse.
    The DIAPI implements same logic as B1 application so it can not implement in DIAPI also.
    Best Regards
    Jane Jing

  • 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

  • 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

  • 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

Maybe you are looking for

  • How do I paste a jpg larger than 150 dpi into Illustrator?

    I have Adobe Illustrator CS5 and run OSX 10.6.8 2.4 GHz Intel Core 2 Duo with 4GB of RAM and my question is this -- when I copy a jpg image from my Adobe Photoshop (Version 8.0) and bring it into Illustrator for a project and try to paste it in, it a

  • Translate Stored Procedure from MS SQL Server to ORACLE 9i

    Hi... I work usually with MS SQL Server, and now I need to migrate an application from MS SQL Server to ORACLE 9i. I think to preserve most of User Interface made actually in MS Visual Basic .NET 2003 and change or "translate" all the MS SQL Server s

  • Problem in integrating Dreamweaver MX with  SAP xMII

    hi all, i am using Dreamweaver MX and xMII 11.5 i have followed the steps for  <a href="http://help.sap.com/saphelp_xmii115/helpdata/en/Getting_Started/InstallationGuide.htm#Installing_the_Dreamweaver_Add_in">Installing the Dreamweaver Add-in</a> <b>

  • Upgrade or get a new one- Macbookpro. 15. 2.6Intel Core 2 or Mac mini

    At home I have my old MacBook Pro  15 inch - 2.6 Ghz Intel Core 2 Duo with 4Gb 667 MHZ DDR2 SDRAM. conected to an apple cinema dysplay  With system10,8,2 and 250GBof Disk. My most demanding usage is working with apperture pictures of about 12MB and l

  • J2EE Basic Authentication 설정 방법(inbound)

    BPEL PM Admin Guide를 따라 해봤는데 잘 안되서 글올립니다. 가이드 1-8 ~ 1-10에 있는 내용을 참고 하여 1. user 생성 java -Xbootclasspath/a:..\..\bpel\lib\orabpel-boot.jar -jar ..\home\jazn.jar -user oc4jadmin -password welcome1 -adduser jazn.com jsmith jsmith java -Xbootclasspath/a:.