How to assign batch to BOM line item when creating PO

Hi Experts,
              Programmatically i am creating PO using BAPI_PO_CREATE, for the line item  material of PO their is BOM, i am able to get the BOM for each material, but  struggling to find where can i assign Batch to the BOM line item material.
Thanks in advance
Thanks,
Nitesh

Even though the ORDCHG message contains all three line items, it should also contain qualifiers that tell you Supplier whether the line is new, changed, deleted etc. If your Supplier has SAP, it should just work.
Cheers, Paul.

Similar Messages

  • Documentary Batch Field for Line item when calling BAPI_GOODSMVT_CREATE

    hi all,
    Iam unable to locate the Documentary Batch Field for each line item while posting a Goods Issue using BAPI BAPI_GOODSMVT_CREATE.
    BAPI2017_GM_ITEM_CREATE structure has got no field to enter the DB number against each line item. Although its not a mandatory field while posting a goods issue when calling the BAPI, but there shud be a input field for the same. When doing a similar posting in SAP using MIGO transaction it's mandatory to enter a Documentary Batch number(SAP Field name DOCUBATCH_CHARG). Does anyone have come across this situation. Is there a field with different name in the  BAPI2017_GM_ITEM_CREATE structure ? Appreciate your thoughts !
    Regards,
    Gilmour

    Hi Vindy,
    bapi2017_gm_item_create-batch is the field for the Batch.
    However Iam looking for a field called DB No which is basically a Documentary batch ensure the traceability of a material, without it being necessary for the stock of the material to be managed in batches. If you look at the Item section in MIGO you would have Batch and DB No for each line item and Iam looking for the DB no and not the primary Batch.
    Thanks,
    Gilmour

  • ME21N add new line item when creating a PO

    Hi guys,
    I am new to badi & oop.
    I want to add a PO line item after clicking the save button in ME21n.
    I found the BADI IF_PURCHASE_ORDER_MM.
    I have coded in the method POST by using method create_item.
    However, it still does not work? Any ideas how to use this method to create the new line item or any sample code?
    Please help! points will be rewarded.
    Many thanks...

    Hi Sen,
    You mean by executing the BAPI call? Maybe you did understand my question wrongly.
    What my requirement is that, user will be keying in details for PO and its line item in ME21N.
    And upon saving, need to auto add in an additional line to the PO. Eg user key in 3 line items, the BADI/userexit suppose to add a new line item to it.
    The bapi that you proposed, creates PO from d scratch right?
    I guess it can't just create an PO item with that bapi unfortunately.
    Any other help? I need a help in coding this create_item method in interface class IF_PURCHASE_ORDER_MM.
    Please help.. I have an urgent requirements.
    Many thanks in advance.

  • Zero quantity in line item when creating a sales order

    How to avoid the error when the quantity is entered as zero during sales order creation

    Praveen's idea worked great!  This snippet of code in the BADI supressed the error message for me.  I was getting it when a lead was converted to an opportunity, and the quantitiy was 0.  We didn't need a warning message for that.
    METHOD if_ex_crm_schedlin_badi~crm_schedlin_check.
      DATA: lt_msgidno             TYPE bal_r_idno,
            ls_msgidno             TYPE bal_s_idno.
    * Set up selection table to include message CRM_SCHEDLIN 303
      REFRESH lt_msgidno.
      ls_msgidno-sign      = 'I'.
      ls_msgidno-option    = 'EQ'.
      ls_msgidno-low-msgid = 'CRM_SCHEDLIN'.
      ls_msgidno-low-msgno = '303'.
      APPEND ls_msgidno TO lt_msgidno.
    * Call standard FM to delete the message
      CALL FUNCTION 'CRM_MESSAGES_DELETE'
        EXPORTING
          it_r_msgidno   = lt_msgidno
        EXCEPTIONS
          appl_log_error = 1
          OTHERS         = 2.
    ENDMETHOD.

  • How to load long text in BOM line item

    Hello Experts
    How do i load Long text in BOM Line item using LSMW
    Thanks
    S
    Edited by: Alvaro Tejada Galindo on Jan 31, 2008 5:11 PM

    Use Read_text function module.
    you need to pass
    ID
    LANGUAGE
    NAME
    OBJECT   to the function moduel
    To find the Text id name language and object these are the following steps. Example: FB02
    1. goto FB02, Enter Document number
    2. from menuselect Goto>Header-->header Text..... New window will be displayed 
    3. select the Header Text. here you can see all the text. 
    4. click on the TEXT (which you want to know the Text id) , then press log ICON (you can find in bottom right of the text window) it looks like a rolled paper. 
    5. in the Next window you will find Text Name. Text ID, Language. etc...
    Regards,
    Lalit Mohan Gupta.

  • BOM header qty change if BOM line item qty delivered more in previous deliv

    Dear team
    BOM is as follows:
    Finished product
          Material1   100 Units
          Material2   100 Units
    Lets say i create a sales order with 2 units of finished products
    then my sales order will look like:
    Finished Product 2 units
          Material1   100 Units
          Material2   100 Units
    Now i am trying to create a delivery for 1 unit of finished product
    Finished Product 1 units
          Material1   150 Units
          Material2   100 Units
    Here i change the Material1 quantity from 100 to 150 Units and create delivery.
    Now i am creating a second delivery
    In the delivery order i am getting as:
    Finished Product 0.5 Units
         Material1   50 Units
         materail2  50 Units
    But i want
    Finished Product 1 units  (as my finished product open quantity is 1M3)
        Material1   50 Units
        material2  100 units
    Can this be achieved.  Because of more despatch of BOM line items my header BOM item should not change.  It should be same as my open quantity in delivery.

    Hi,
    It depends upon how u are maintaining the BOM. The components calculated is based on the BOM base qty.
    Regards,
    V. Suresh

  • Assignment Field on Customer Line Items

    The customer line items  (FBL5N) are sorted by assignment number which is 4 digit. Same assignment number I can see in the assignment field of the billing document from which the accounting document is created. I want to figure out where that assignment number is coming from. I mean is it a purchase order or a purchase requisition number etc? How can I find what that number is?

    Krishna,
    Thanks for taking the time to answer my query. But it does not solve my issue.
    Forgot to mention, I had already checked the sort field at the customer master level. It has sort key 009 which is for external document number, but when I display the customer line items Assignment field which is 4 digit is being used for Sorting.At the Sort Field config setting for Account Type Customers Field ZUONR or Assignment is used for Line Item Display Sort Customer. I am talking about settings under Tcode O7F6.
    I am interested in finding from where the system is populating the 4 digit number in the assignment field.How can I find what that 4 digit assignment number is?

  • How to set delv. completed in 2nd line item which created in PO by default

    Dear guru,
    When creating 1st line item by default the 2nd line item has been created. I understand that the 2nd line item is free because no net price has been stated but free good check box in not ticket. Further more the 2nd line is grayed out including all tab in item details. Meaning we can't do any changes in this line item.
    User set delivery completed in 1st line item but couldn't set in 2nd line item. This caused to this PO show still pending for delievery when run the report. How we can set this 2nd line item has delivery completed eventhough GR haven't done fully.
    rgds,
    nantha

    Dear Mahesh,
    The 2nd line is free good that assign with 1st line item. This has been set in purchasing info record under condition view. Thus when I create PO for 1st line item, system created 2nd line item as auto default. The issue here is the 2nd line item & all the field that in item details in PO become grayed out eventhough I go to ME22N. I cant do any changes on 2nd line item. I believe there would be some control maintain for free good. Please advice. Thank you.
    rgds,
    nantha

  • Assignment field in expense line item  FB60 missing

    Hi
    I got a problem like, in  Quality client, TCODE:FB60 has "assignment field" for expense line item(not in vendor line item). But in Development client this field is missing. How to get the field in development.
    VVR

    Hi murali,
    Thanks for the reply.....But, this is not the problem after i entered the GL . Before giving any GL, on just opened screen, iam not able to see the assignment field at all .......is there any variant needs to be select for that.
    As you said for checking the FSG...but that is only for the particular GL which you have entered...but before entering the GL iam not able to see the field...
    Hope you got clear about the probelm.....
    (in Menu...options...screen variant is there but it is so confusing )
    VVR

  • How to delete the Cost center line item data

    How to delete the cost center line item data of particular cost center and only one cost center is exisiting for that company code.
    Is there any way to delete the line items in that cost center.
    Can data archiving & deleting can help us..........
    does it have any effect over other cost center data....
    any input needed.........
    regards
    rajesh

    Hi,
    i found 2 reports for you:
    1) CO_TOTAL_WRI - Archiving CO Totals Records   
    2) RKCOITW1     - Archiving CO Line Items: Write Program        
    from 2) is a linlk to customize archiv-parameters
    -> start it with transaction se38 / sa38
    A.

  • How to Count Number of completed line items in past 6 months / 12 months ?

    How to Count Number of completed line items in past 6 months / 12 months ?
    Hi,
    I am trying to count "Number of Completed Line Items in Purchase Order Document" for my Key Figure ZPO_CNT.
    Purchase Order document = ZEBELN
    Line Item = ZEBELP.
    I need to find and count if the Line Item has been received in the past 6 months from today and similarly in the past 12 months.
    I have "Delivery Completed" field, ELIKZ.
    So, based on this would I be able to calculate it in Query Designer?
    If so, Please let me know how

    Hello Deva
    If youe want to calculate the completed line item for last 6 or 12 month then i think u will be displaying the query data for these montrhs...create a customer exit to give you date range and restric it in filter area....
    Now Choose any of the below option
    1. I would suggest to implement an additional key figure "counter" in cube and fill values with one for which delivery is completed.
    Now use calculated key figure in Query Designer based on logic
    IF counter = 1 THEN counter ELSE 0
    OR
    2. create a formula variable based on ELIKZ and use replacement path variable, it will display you no. of docs for which delivery is completed....
    Award points if it solves your problem
    Revert back in case of further assistance...
    Thanks
    Tripple k

  • How can I add a new line item for production order?

    HI all,
    How can I add a new line item for production order through BAPI/FM? Thanks in advance.

    Hi Mil,
      Unfortunetly SAP is not in front of me.
    But if possible go to BAPI transaction , check for any production order's bapi for CHANGE purpose. Where you will be able to add your new line.
    Reward if useful!

  • Adding a batch to a line item in an Order with B1WS

    Hi,
    I am trying to create code which can update a batch in a line item in an order.  The updating works great, if the batch is already attached to the line item.  However, I am unable to add a batch if one doesn't already exist.
    Can you please have a look at this code and let me know what is wrong?
    I've tried various things, though am still unable to get it to work.
    Thank you very much!
    Mike
    using System;
    using System.Configuration;
    using System.Data;
    using System.Linq;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Xml.Linq;
    using orderWebRef;
    using System.Text;
    public partial class _Default : System.Web.UI.Page
        protected void Page_Load(object sender, EventArgs e)
            // B1BATCH performs batch operations on SAP via DISERVER and B1WS
            // The inputs are:
            // o = Order Number (this is the DocEntry value, NOT the DocNum value)
            // b = Batch Number
            // q = Quantity
            // i = Item Code
            // p = Project
            // debug = 1 or true if you want to see output messages
            // For some security, we will encode some values at the client,
            // and verify them here for consistency.
            // The "Secret Formula" is these variables, which will be passed to the URL
            // 1 = Order Number * 2 (encoded at the client)
            // 2 = Batch Number * 2 (encoded at the client)
            // To decode, we do this:
            // Correct decoding if ((1 = (o/2)) AND (2 = (b/2))
            string o = "";
            string b = "";
            string q = "";
            string i = "";
            string p = "";
            string v1 = "";
            string v2 = "";
            int orderNumber = 0; // This is the DocEntry value, NOT the DocNum value
            int batchNumber = 0;
            int quantity = 0;
            int v1int = 0;
            int v2int = 0;
            bool debugMode = false;
            bool allVarsPresent = true;
            bool allVarsValid = true;
            try
                o = Request.QueryString["o"].ToString();
            catch
                allVarsPresent = false;
            try
                b = Request.QueryString["b"].ToString();
            catch
                allVarsPresent = false;
            try
                q = Request.QueryString["q"].ToString();
            catch
                allVarsPresent = false;
            try
                i = Request.QueryString["i"].ToString().ToUpper();
            catch
                allVarsPresent = false;
            try
                p = Request.QueryString["p"].ToString().ToUpper();
            catch
                allVarsPresent = false;
            try
                v1 = Request.QueryString["1"].ToString();
            catch
                allVarsPresent = false;
            try
                v2 = Request.QueryString["2"].ToString();
            catch
                allVarsPresent = false;
            try
                string debug = Request.QueryString["debug"].ToString();
                if ((debug == "1") || (debug.ToLower() == "true"))
                    debugMode = true;
            catch
                debugMode = false;
            if (!allVarsPresent)
                WriteDebugMessage(debugMode, "All required variables are not in the request.");
                return;
            else
                // All variables are present, now check that they are valid.
                // First, check the v1 and v2 variables are correct
                // Then check that the order exists
                // Then check that the batch exists and has the appropraite quantity available
                try
                    orderNumber = Convert.ToInt32(o);
                    batchNumber = Convert.ToInt32(b);
                    quantity = Convert.ToInt32(q);
                    v1int = Convert.ToInt32(v1);
                    v2int = Convert.ToInt32(v2);
                    if ((v1int / 2) != orderNumber)
                        allVarsValid = false;
                    if ((v2int / 2) != batchNumber)
                        allVarsValid = false;
                catch
                    WriteDebugMessage(debugMode, "Error in processing variables.");
                    return;
                if (!allVarsValid)
                    WriteDebugMessage(debugMode, "Error in validating checksum.");
                    return;
                // All variables are present and valid!
                WriteDebugMessage(debugMode, "All variables are present and valid.");
            try
                loginWebRef.LoginService ls = new loginWebRef.LoginService();
                string sessionID = ls.Login("DBSERVER", "DBNAME", loginWebRef.LoginDatabaseType.dst_MSSQL2005, true, "sa", "PASSWORD", "manager", "managerPass", loginWebRef.LoginLanguage.ln_English, true, "LICENSE:30000");
                WriteDebugMessage(debugMode, "<BR><BR>SessionId: " + sessionID + "<BR><BR>");
                orderWebRef.MsgHeader msgHeader = new orderWebRef.MsgHeader();
                msgHeader.SessionID = sessionID;
                msgHeader.ServiceName = MsgHeaderServiceName.OrdersService;
                msgHeader.ServiceNameSpecified = true;
                orderWebRef.OrdersService order = new OrdersService();
                order.MsgHeaderValue = msgHeader;
                DocumentParams param = new DocumentParams();
                param.DocEntry = orderNumber;
                param.DocEntrySpecified = true;
                orderWebRef.Document document = new orderWebRef.Document();
                document = order.GetByParams(param);
                StringBuilder orderSb = new StringBuilder();
                orderSb.Append("Order " + document.DocNum.ToString() + "<BR><BR>");
                foreach (DocumentDocumentLine docLine in document.DocumentLines)
                    if ((docLine.ProjectCode == p) && (docLine.ItemCode == i))
                        orderSb.Append("Line Num:      " + docLine.LineNum + "<BR>");
                        orderSb.Append("Item Code:     " + docLine.ItemCode + "<BR>");
                        orderSb.Append("Project Code:  " + docLine.ProjectCode + "<BR>");
                        orderSb.Append("Description:   " + docLine.ItemDescription + "<BR>");
                        // Find the batch if it exists and update the quantity
                        // Add the batch if it doesn't exist
                        bool batchExistsInLineItem = false;
                        int batchCount = 0;
                        foreach (DocumentDocumentLineBatchNumber batch in docLine.BatchNumbers)
                            batchCount++;
                            if (batch.BatchNumber == b)
                                batchExistsInLineItem = true;
                                orderSb.Append("<BR>");
                                orderSb.Append("+++++ Batch exists in line item.  Updating.<BR><BR>");
                                orderSb.Append("+++++ Batch Line:   " + batchCount.ToString() + "<BR>");
                                orderSb.Append("+++++ Batch Num:    " + batchNumber + "<BR>");
                                orderSb.Append("+++++ Quantity:     " + quantity + "<BR>");
                                batch.Quantity = quantity;
                        if (!batchExistsInLineItem)
                            docLine.BatchNumbers = new DocumentDocumentLineBatchNumber[1];
                            DocumentDocumentLineBatchNumber batch = new DocumentDocumentLineBatchNumber();
                            batch.BatchNumber = b;
                            batch.Quantity = quantity;
                            docLine.BatchNumbers[0] = batch;
                            orderSb.Append("<BR>");
                            orderSb.Append("+++++ Batch does not exist in line item.  Adding.<BR><BR>");
                            orderSb.Append("+++++ Batch Line:   " + batchCount.ToString() + "<BR>");
                            orderSb.Append("+++++ Batch Num:    " + batchNumber + "<BR>");
                            orderSb.Append("+++++ Quantity:     " + quantity + "<BR>");
                try
                    order.Update(document);
                catch (Exception ex)
                    WriteDebugMessage(debugMode, "SAP Exception:  " + ex.Message.ToString());
                    return;
                WriteDebugMessage(debugMode, orderSb.ToString());
            catch (Exception ex)
                WriteDebugMessage(debugMode, "Error in processing the request.  Exception:<BR><BR>" + ex.Message);
                return;
        private void WriteDebugMessage(bool debugMode, string exitMessage)
            if (debugMode)
                Response.Write(exitMessage);

    Hi Everyone,
    I found the answer, you can find the code here: [B1WS Batch Manipulations with Orders|http://paste-it.net/public/dbbcea0/]
    Cheers,
    Mike

  • How to view ACCNTS payble reconaccount Line Item wise after cheking tick

    I want to see the ACCOUNTS Payble RECONCILITION acoount LINE ITEM wise.
    I had seen the GL Master and their I found that The LINE ITEM was not Checked.
    later I had checked the Line Item Display, but Iam not able view the previous transactions Line Item Wise For that GL Account.
    1. Kindly suggest me how I can see the Previous Line Items after cheking the Line Item Disply.
    2. kindly Tell Me if I can Run any Programme.
    3.If its so what programme I can run and how.
    4. Is there any problem by checking the line item display to the GL account.
    Thanks In Advance
    I will definately reward the points
    Akash Narayana

    Hi,
    1. Enable Line Item Display in GL master.
    2. Block the GL for Posting in Company Code.
    3. Run the Program RFSEPA01.
    4. Check whether Line item details are available and then unblock the GL.
    Regards
    Hari

  • Function Module to Change / Update BOM Line Items

    Hi,
    I need a Function Module to Change / Update BOM Line Items.
    Please help.
    Thanks.

    Try this FM - CSAP_MAT_BOM_MAINTAIN

Maybe you are looking for

  • Printing blank lines in IE 8, 9, 10 and 11 differs

    We have Credit Reports that are put in Iframe (and hidden fields) and when the users checks which ones they want to print, we take the hidden fields an populate one Iframe to print them all from. Problem is, IE 8 prints fine, IE 9 removes many of the

  • ECC 6.0 and ECC 5.0 runing in the same Machine.

    Hi Guys, I have a challenge: Install a ECC 6.0 with HR and an ERP 5.0 on the same Machine and Operational System. Do you know some documentation, link or tips for this type of case? Do I need run something different than a normal installation? Best R

  • Nokia E75 does not support sis files

    I've been trying to upgrade the Ovi maps on my E75, because navigation has kept me saying that I need to renew the license. I went to Nokia web site and found out that I need to upgrade Ovi maps in order to get the free navigation. I have a 202.12.01

  • How to handle special characters such as apostrophe, ampersant

    Hello All, Tools: JSP, JSDK 2 Oracle 8 Issue: If the user supplies a String value inside a text box which has special characters such as apostrophe, while we try to compare that string with some value in the database, the sql error comes up as the sq

  • BPEL PM 10.1.2 olite corrupted after installation of BPEL PM 10.1.3

    Hi All, After installing BPEL PM 10.1.3 on machine already having BPEL PM 10.1.2, I am now unable to access the olite database through connection which I made in Oracle Jdev. Any idea whether the new olite database have overridden the previous versio