BAPI_SALESORDER_CREATEFROMDAT2 line item assignment

Is there a way to use BAPI_SALESORDER_CREATEFROMDAT2 without having to predict internally assigned line item numbers by SAP?
E.g. creating an order with 2 line items, the 1st line item explodes into a sales BOM, so in order to tie sales order text or schedule line data in for a 2nd line item I need to know the line item number of the 2nd item in tables ORDER_TEXT or ORDER_SCHEDULES_IN.
External systems usually don't know how SAP will explode into items, so I can't believe there is no way to do this with the standard BAPI. Or is everyone out there just using a custom wrapper function that reads the sales BOMs and calculates SAP line item numbers?

Ravi,
No you misunderstood. If I want to send sales order text for a 2nd line item, which goes in the ORDER_TEXT table what line item number will I use in that table? If my 1st item explodes into 10 line items in the sales BOM, then SAP will use  something like line item 000120 for the 2nd line item. You will need to pass this SAP generated line item number in the ORDER_TEXT table. How can you avoid having to know that your line item number 2 is really line item 000120 in SAP when you send other data besides what's in the ORDER_ITEMS_IN table?
Peter

Similar Messages

  • Customer Number in line item assignment fiels for VF01  invoice documents

    Hi,
    how can I get the customer number in assignment field of FI document line item. 
    I have created a sort key with field customer KUNNR but this field will not be populated by invoice documents posted from sales orders via VF11?
    I am looking forward to your solution proposals.
    Thanks and Kind Regards
    Tarik

    Hi Dominique,
    many thanks for your reply.
    the customising for copy control in SD seems very confusing
    How can I arrange that it is aready populated with the customer number ?
    One example would be enogh for me to understand it.
    Can you provide me this example?
    Kind Regards
    Tarik Oznalcin

  • Incorrect Sales order line item assignment to the Planned order

    Hi,
    I am creating a sales order & then MRP run to get planned orders.
    The sales order has one assembly line item, which is a configurable material. Inside the configuration of the assembly, I maintain some components. After saving it explodes and the same components reflect below line items of the assebly in sales order.
    Now if I run MRP there is a requirement for the component and so the planned order is created for the component. But If I open the planned order & see inside its Assignment view, there is correct sales order number, but the line item its showing is that of Assembly and not of the component. Why ? Is there any wrong in configuration or any wrong in planning type ?
    I checked correct Item category is used.
    MRP Type - PD
    Correct requirement type is used in procurement view.
    I think what ever is comming is standard SAP functionality. But I am not sure.
    The client is saying, thie is wrong and because of this the warehouse guy is picking the wrong material (As the line number is wrong).
    Please suggest here.

    Hi Sambit,
                  We assign the Ordet type(Production order/ Planned order/ Network) to the requirment class to let the system know that for the material which has this requirment class , system chould create a Planned/ Procustion order. When you assign this normally system should create it automatically based on the settings. Requirment class comes from the requirment type which comes from the Item category and MRP type(*Genarally). Also check if there is any startegy Group assigned to the material in the material master and also the MRP group. Check the strtegy group defualts in the transaction "OPPS"(rEQUIRMENT TYPE /class FOR CUstome requirments). The best thing you could do is make the screen shots of the assembly header and the component's requirment classes and tell the business that based on this sytem is creating the planned order.And also check the plant parameters and the MRP group parameters in "OPPQ" and "OPPR" respectively. Kindly please let me know if you need any more infromation on this.
    Regards,
    Ram Pedarla

  • SD-ABAP:Create SO:BAPI_SALESORDER_CREATEFROMDAT2: Line Item Structure Tab

    Hi SD-ABAP,
    I'm currently creating SO using BAPI_SALESORDER_CREATEFROMDAT2.
    I'm populating the following:
    IMPORT:   SALESDOCUMENTIN, ORDER_HEADER_IN, ORDER_HEADER_INX
    TABLES:  ORDER_ITEMS_IN, ORDER_ITEMS_INX,
                    ORDER_PARTNERS,
                    ORDER_SCHEDULES_IN, ORDER_SCHEDULES_INX,
                    ORDER_CONDITIONS_IN, ORDER_CONDITIONS_INX,
                    ORDER_TEXT
    I have a BOM material A, with subMaterial A1, A2, A3.  By creating manually (VA01), this will automatically appear on the the Line Item of the BOM Material > Structure tab.  The structure tab will contain the subMaterial A1, A2, A3.
    What I need is to automatically populate the SubMaterial in the Structure Tab of the Line Item having a BOM material.
    Has anyone encountered this scenario?  I'm not sure if I need to populate: ORDER_CFGS_PART_OF?
    Thanks.
    FYI, already checked some SD-BOM related OSS notes.

    Hi Jamie,
                  It will not automatically populated in BAPi, but i think an user exit (Standard SAP code) is doing it for you. I will say not to change the program in the BAPI instead of that use MOVE FIELD TO VBAP userexit to solve this issue. This is quite common scenario and lot of posts are available over the net.
    Best Regards,
    Tapodipta Khan.

  • Sales order line item assign to cost center

    Hi Experts,
    I would like to know how can I assign a cost centre to a line item in a sales order? Currently we are assigning our line items to a profit centre.
    Thanks in advance for your help.
    Best regards,
    Catherine

    Dear Catherine,
    One way, to assign a cost center to a sales order, is based on Sales Org, Dist Channel, Division and Order Reason code.
    T. Code: OVF3, or
    Path: SPRO --> IMG --> Sales and Distribution --> Basic Functions --> Account Assignment --> Assign Cost Center
    For More, refer -
    [Assign a Cost Center manually in a Sales Order|http://www.sap-img.com/sd007.htm]
    Best Regards,
    Amit.
    Note: You must consult with FI-Counterpart, and check with:
    T. Code: OKB9
    Using this Transaction, you can determine a cost center, from profit center, maintained in to Material Master.

  • KO23 Object currency assigned  value not equal Line item assigned value

    Dear all:
                    I have one problem.  Some Internal Order budget  use KO23  view about Object currency assigned value not equal Standard Reprt
    S_ALR_87013019 - List: Budget/Actual/Commitments  assign value.
    I don't knew what happen ?
    So I wish someone can give me a hand. Tel me how to fix this problem.
    thank you !

    Hi Jason,
    First of all:
    The displayed account code must be translated into the internally used code ("_SYS...") when using segmentation - when not using segemntation it is just internal code = displayed code.
    The code displayed is just a sample to give you a hint in case you are already familiar with the SAP Business One application.
    Therefore the sample code does not talk about where you got e.g. the value for FormatCode from ("FormatCode" is e.g. a field in table OACT where the account name with segments is (redundantly) stored without separators).
    The user should know on which account he/she wants to book a line on; maybe you might want to give some help to the user by displaying a dialog with suitable - or preselected accounts?
    In addition I am sure you know how to assign a string value to a string property - without explicitly writing it, right?
    HTH,
    Frank

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

  • Revenue Recognition based on User Status of assigned Sales Order line item

    Dear Community members,
    We have requirement to recognize / de-recognize revenue posted to WBS for calculation of RA, based on the 'User status' of the assigned Sales Order line item.
    To elaborate requirement further -
    1) WBS Element - XXX - 10 ( with operative indicator - Plan/Bill/Account Assign)
    2) Sales Order(SO) Line Items assigned to the above WBS -
    - SO No -  123 Line Item 10 - Actual Rev - $ 300 - User Status - EXE (Meaning this work is in progress , partial payment received thus actual revenue for RA at WBS is 'Zero'
    - SO No -  124 Line Item 20 - Actual Rev - $ 400 - User Status - COMPL(Meaning this work is Complete , all payment received thus actual revenue for RA at WBS is $400
    - SO No -  125 Line Item 10 - Actual Rev - $ 800 - User Status - EXE (Meaning this work is in progress , partial payment received thus actual revenue for RA at WBS is 'Zero'
    As per WBS reports Actual Revenue posted to WBS XXX-10 is $ 1500 ( $300$400$800) , however since two SO line items ( SO 123 /line item 10 and SO 125 / line Item 10 ) are NOT having User status 'COMPLETE', the actual revenue posted by those line items $ 1100/- ($300 + 800)  should not be included as Actual Revenue for RA at WBS level.
    Thus Actual Revenue for RA at WBS XXX-10 should be $ 400 /- ( the revenue posted by SO 124/line item 20 which has user status as 'COMPLETE')
    How do above can be achieved?? Is there any standard solution for this?? Is any SAP Note available for this (I too am looking for one but not found any ) ?? do we need any enhancement , Customer exit etc
    Thanks in advance
    with regards

    Hi,
    Thanks. You are right that the 'Completed Contract Method' would defer revenue recognition. However, the status checked would be of the RA object (WBS Element in this case, as RA key is on WBS and RA is being calculated on the WBS).
    However, our requirement is to check the user status of the Sales Order Line items assigned to the WBS element and filter the revenues posted based on the active user status of individual Sales Order Line item.
    Please give you inputs.
    Thanks in advance
    With regards

  • Line item Assignments counter

    Hi
    How can i achieve the count of Line item assignments
    I had a DSO with Sales Order & Line Item No which is connected to a Cube
    In my report on cube my requirement is to display  count of Line item Assignment.
    (A line item can be assigned to no of Sales orders)
    I think i can't achieve this at report level,Because a counter can be based on single reference char in report
    My requ is to count no of line item assignments no the total no of line items
    But If i include a KG (Count) in DSO....Count...overwrite....constant 1
    What happens when a delta for the exisisting sale Order Line item enter to DSO...
    Please update how can i achieve

    Hi Superuser,
    Check the link below.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/business-intelligence/g-i/how%20to%20count%20the%20occurrences%20of%20a%20characteristic%20relative%20to%20one%20or%20more%20other%20characteristics.pdf
    Roy

  • Maximum allowed line items for sales order

    Hi All,
    I am creating sales order thru'  BAPI, I heard there is a constrain like only  999 line items allowed for one Sales Order.
    Is there any such constrain is there in SAP. (if yes.. Is there any way to resolve the problem...)
    I am working in SAP ECC 6.0 version.
    Thanks in advance.
    Regards

    I have not heard of any particular limit imposed by SAP. The field length for line item number (POSNR) is 6 digits, so technically it is limited to 999,999 line items.
    The item number assignment is, however, driven by the configuration. Some companies might choose to increase the number by, say, 10 (i.e. the line numbers will be 10, 20, 30, etc.), therefore limiting the total available lines. Note also that line item assignment is different on the billing document, so enough space should be allowed on the order to accomodate all the consequent documents.
    An obvious solution is to split the large orders into several smaller ones to avoid running over the limit.

  • BAPI_SALESORDER_CREATEFROMDAT2 Purchase order line item number

    Hi Freinds,
    I have small issue using the function module "BAPI_SALESORDER_CREATEFROMDAT2" , it is creating incomplete sales orders when the Saleorder line item number and POline item number are different.
    Example:
    If i assign the same value like "000010" for ptb_items-itm_number,ptb_items-po_itm_no it works fine and sales order doesn't have any incomplete log.
    but when i have different values like "000010" for   ptb_items-itm_number and "000123" for ptb_items-po_itm_no. both the cases all other information is same.
    Could anybody helps me to fix this problem so that i can avoid creating incomplete sales orders.
    Thanks for the quick reply and help.
    Regards,
    Praveen

    Hello Praveen
    The items structure BAPISDITM has a field <b>PO_ITM_NO</b> (Item Number of the Underlying Purchase Order) which most likely links the two numbers together.
    Regards
       Uwe

  • How to get Characteristic Values assigned to the line item of Sales Order?

    Hi,
    I want to get the Characteristic Values( Variant Configuration )assigned to First Line Item of Sales Order.
    I was using the Fn. Mod.: VC_I_GET_CONFIGURATION_IBASE,
    this fn. mod. giving all the Characters but not the assigned characteristic values.
    Is there any other way to find characteristic values of sales order.
    Thanks,
    vinayak.
    Message was edited by: vinayaga sundaram

    For example, please see this example program.
    It lists the characteristic names, the values, and the description of the values which are tied to a sales document.
    report zrich_0001.
    * Internal Table for Characteristic Data
    data: begin of i_char occurs 0.
            include structure comw.
    data: end of i_char.
    data: xcabn type cabn.
    data: begin of xcawn,
          atwtb type cawnt-atwtb,
          end of xcawn.
    data: xvbap type vbap.
    parameters: p_vbeln type vbap-vbeln,
                p_posnr type vbap-posnr.
    start-of-selection.
      select single * from vbap into xvbap
                 where vbeln = p_vbeln
                   and posnr = p_posnr.
      clear i_char.  refresh i_char.
    * Retrieve Characteristics.
      call function 'CUD0_GET_VAL_FROM_INSTANCE'
           exporting
                instance           = xvbap-cuobj
           tables
                attributes         = i_char
           exceptions
                instance_not_found = 1.
      loop at i_char.
        clear xcabn.
        select single * from cabn into xcabn
                 where atinn = i_char-atinn.
        clear xcawn.
        select single cawnt~atwtb into xcawn
                   from cawn
                     inner join cawnt
                       on cawn~atinn = cawnt~atinn
                      and cawn~atzhl = cawnt~atzhl
                          where cawn~atinn = i_char-atinn
                            and cawn~atwrt = i_char-atwrt.
        write:/ xcabn-atnam, i_char-atwrt, xcawn-atwtb.
      endloop.
    Regards,
    RIch Heilman

  • Update material doc.num in assignment field of GR/IR line item of a/c doc

    HI Experts,
    please tell me the solution for my problem
    My requirement : Transaction is : MIGO
    Before posting of material document, update material document number in assignment field of GR/IR line item of accounting document (WE) at number commitment stage
    Update MKPF-MBLNR (Material Document Number) in BSEG-ZUONR
    but already i tried AC_DOCUMENT i got a problem .
    What i did,
    first use MB_DOCUMENT_BADI with method
    mb_document_before_update.
    here i tried to get the material document and export into memory
    after use AC_DOCUMENT With method
    change_after_check.
    here Import the material document doc num and pass it to Assignment field in
    but it is not working
    when i debug first trigger the AC_DOCUMENT And then it goes to MB_DOCUMENT_BADI
    Plese help me regarding this.
    Moderator message: please open only one thread per issue.
    Edited by: Thomas Zloch on Feb 9, 2012

    Hi,
    Thanks, I will check the same. Well, I will be clearing the documents with reference to MIGO number itself. When I do my delivery chrgs migo, that number I need to be populated in my line item's assignment field. Not only that but I the same number should get populated in the delivery charges miro. Since my miro is with ref to PO it becomes difficult to fetch the field.
    Plz let me know if you can help me on this as well.
    Thanks,
    Priyanka.

  • Line Item Field "Assignment" not populating

    I am posting a KR doc. The assignment field in the line item is not populating with the date on the document is being posted in either of the line items, posting key 31 posting to Vendor and posting key 40 posting to an expense G/L account. The assignment field remains empty. I have checked some documents in the other company codes where this field is being populated with the date in the yyyymmdd.
    Please let me know what controls this and how can I make this field populate.

    Th Sory key for the GL for that company code should have the document date as the sort key.... check in FS00

  • Gr Ir Assignment Updation with PO and Line Item

    In the GL for GR IR Account the sort key was not  maintained with PO number due to which the assigment field in the line item was getting updated with the posting date and not with the PO & LIne Item details.
    We have made the requiste changes and new items are getting updated properly.
    But require assitance in updating the earlier line items.
    As of date total line items are more than  0.15 mn.
    Please suggest some method to automatically update the assigment field of the GR IR Line items with the PO Details.
    Regards
    Mukesh

    Hi,
    You can use a substitution to update the field through FI. Use GGB4 for wirting a substitution you may need some ABAP coding to substitute PO no and line items in the assignment field.  rule would be Co code =XXX and GL account =xxx and Posting date earlier than =xxxx  then concatenrate EBELN and EBELP in Assigment field Zounr.
    Then execute FBL3N and edit the assignment field by selecting all the documents and then save it you should see the PO line items populated. You can leave the substitution on or you can remove it after updating,
    Regards
    K.R

Maybe you are looking for