Sub Line itmes are not copied out...

Hi all,
I am using BAPI ''BAPI_SALESORDER_CREATEFROMDAT2'' to create a sales order with refernce to Contract number. The creation of sales order is fine but the issue is when ever there are sub line items in the contract there are not copied into salesr order.
Is any one know the reason and solution to reslove this issue.
My code:
  DATA: lv_vbap  TYPE vbap.
  data: lv_inst_id(8) type n.
  wa_contract_header_in-refobjtype = gc_bus2032.
  wa_contract_header_in-refdoc_cat = 'G'.
  wa_contract_header_in-ref_doc    = wa_vbak-vbeln.
  wa_contract_header_in-refdoctype = wa_vbak-auart.
  wa_contract_header_in-doc_type   = gc_auart.
  wa_contract_header_in-sales_org  = wa_vbak-vkorg.
  wa_contract_header_in-distr_chan = wa_vbak-vtweg.
  wa_contract_header_in-division   = wa_vbak-spart.
Header data check list
  wa_contract_header_inx-updateflag = gc_var_i.
  wa_contract_header_inx-refdoc_cat = gc_var_x.
  wa_contract_header_inx-ref_doc    = gc_var_x.
  wa_contract_header_inx-doc_type   = gc_var_x.
  wa_contract_header_inx-sales_org  = gc_var_x.
  wa_contract_header_inx-distr_chan = gc_var_x.
  wa_contract_header_inx-division   = gc_var_x.
Fill Item details table
  LOOP AT t_vbap_copy INTO wa_vbap.
      wa_contract_items_in-itm_number   = wa_vbap-posnr.
      wa_contract_items_in-material     = wa_vbap-matnr.
      wa_contract_items_in-target_qty   = wa_vbap-kwmeng.
      wa_contract_items_in-target_val   = wa_vbap-netwr.
      wa_contract_items_in-refobjtype   = gc_bus2032.
      wa_contract_items_in-ref_doc      = wa_vbap-vbeln.
      wa_contract_items_in-ref_doc_it   = wa_vbap-posnr.
      wa_contract_items_in-ref_doc_ca   = 'G'.
     wa_contract_items_in-PO_ITM_NO    = wa_vbap-posnr.
     wa_contract_items_in-config_id    = '000001'.
     wa_contract_items_in-inst_id      = '00000001'.
      APPEND wa_contract_items_in TO t_contract_items_in.
  Fill item update table
      wa_contract_items_inx-itm_number  = wa_vbap-posnr.
      wa_contract_items_inx-material    = gc_var_x.
      wa_contract_items_inx-target_qty  = gc_var_x.
      wa_contract_items_inx-target_val  = gc_var_x.
      wa_contract_items_inx-refobjtype  = gc_var_x.
      wa_contract_items_inx-ref_doc     = gc_var_x.
      wa_contract_items_inx-ref_doc_it  = gc_var_x.
      wa_contract_items_inx-ref_doc_ca  = gc_var_x.
     wa_contract_items_inx-PO_ITM_NO   = gc_var_x.
     wa_contract_items_inx-config_id   = gc_var_x.
     wa_contract_items_inx-inst_id     = gc_var_x.
      APPEND wa_contract_items_inx TO t_contract_items_inx.
    Schedule Lines
      wa_contract_schedules_in-itm_number = wa_vbap-posnr.
      wa_contract_schedules_in-sched_line = sy-tabix.
      wa_contract_schedules_in-req_qty    = wa_vbap-kwmeng.
      append wa_contract_schedules_in to t_contract_schedules_in.
      wa_contract_schedules_inx-itm_number = wa_vbap-posnr.
      wa_contract_schedules_inx-sched_line = sy-tabix.
      wa_contract_schedules_inx-updateflag = 'X'.
      wa_contract_schedules_inx-req_qty    = wa_vbap-kwmeng.
      append wa_contract_schedules_inx to t_contract_schedules_inx.
    Configuration
      wa_contract_CFGS_REF-posex        = wa_vbap-posnr.
      wa_contract_CFGS_REF-CONFIG_ID    = '000001'.
      wa_contract_cfgs_ref-ROOT_ID      = '00000001'.
      wa_contract_cfgs_ref-sce          = '1'.
      wa_contract_cfgs_ref-kbname       = wa_vbap-matnr.
      wa_contract_cfgs_ref-kbversion    = '001'.
      append wa_contract_cfgs_ref to t_contract_cfgs_ref.
      wa_contract_CFGS_inst-config_id   = '000001'.
      wa_contract_cfgs_inst-inst_id     = '00000001'.
      wa_contract_cfgs_inst-OBJ_TYPE    = 'MARA'.
      wa_contract_cfgs_inst-class_type  = 300.
      wa_contract_cfgs_inst-obj_key     = wa_vbap-matnr.
      append wa_contract_cfgs_inst to t_contract_cfgs_inst.
    lv_inst_id = '00000001'.
    loop at t_vbap into lv_vbap where uepos = wa_vbap-posnr.
      add 1 to lv_inst_id.
      wa_contract_CFGS_inst-config_id   = '000001'.
      wa_contract_cfgs_inst-inst_id     = lv_inst_id.
      wa_contract_cfgs_inst-OBJ_TYPE    = 'MARA'.
      wa_contract_cfgs_inst-CLASS_TYPE  = 300.
      wa_contract_cfgs_inst-obj_key     = lv_vbap-matnr.
      append wa_contract_cfgs_inst to t_contract_cfgs_inst.
      wa_contract_cfgs_part_of-config_id = '000001'.
      wa_contract_cfgs_part_of-parent_id = '00000001'.
      wa_contract_cfgs_part_of-inst_id   = lv_inst_id.
      wa_contract_cfgs_part_of-part_of_no = wa_vbap-posnr.
      wa_contract_cfgs_part_of-obj_type  = 'MARA'.
      wa_contract_cfgs_part_of-CLASS_TYPE = 300.
      wa_contract_cfgs_part_of-obj_key   = lv_vbap-matnr.
      append wa_contract_cfgs_part_of to t_contract_cfgs_part_of.
    endloop.
    loop at t_zgd_v_vc_char into wa_zgd_v_vc_char
                           where instance = wa_vbap-cuobj.
      wa_contract_cfgs_value-config_id  = '000001'.
      wa_contract_cfgs_value-inst_id    = '00000001'.
      wa_contract_cfgs_value-CHARC      = wa_zgd_v_vc_char-atnam.
      wa_contract_cfgs_value-value      = wa_zgd_v_vc_char-atwrt.
      append wa_contract_cfgs_value to t_contract_cfgs_value.
    ENDLOOP.
  ENDLOOP.
Fill Partner Table
  wa_contract_partners-partn_role    = gc_sp.
  wa_contract_partners-partn_numb    = wa_vbak-kunnr.
  APPEND wa_contract_partners TO t_contract_partners.
Call Bapi to create sales order
  CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
    EXPORTING
      order_header_in     = wa_contract_header_in
      order_header_inx    = wa_contract_header_inx
    IMPORTING
      salesdocument       = gv_sales_doc
    TABLES
      return              = t_return
      order_items_in      = t_contract_items_in
      order_items_inx     = t_contract_items_inx
      order_partners      = t_contract_partners
      ORDER_SCHEDULES_IN  = t_contract_schedules_in
      ORDER_SCHEDULES_INX = t_contract_schedules_inx
      ORDER_CFGS_REF      = t_contract_cfgs_ref
      ORDER_CFGS_INST     = t_contract_cfgs_inst
      ORDER_CFGS_PART_OF  = t_contract_cfgs_part_of
      ORDER_CFGS_VALUE    = t_contract_cfgs_value.
Thanks in advance...
Satya.

Hi,
Material document will get updated in reference field in FI by default.  If for any reason, want to get this updated in text field, you need to define a subsititution in GGB1.
Best Regards,
Madhu

Similar Messages

  • Price and Pricing conditions are not copied to PO for a line item !!

    Hi
    I have created a PO w.r.t a PR which has only one line item.
    Now, I add another line item to this existing PO, i get an error message that the Price and Pricing conditions are not copied.
    How do i rectify this error !!
    Where might be the link for this Price and Pricing conditions to get copied in to this PO ??
    MaruthiRam

    What kind of PR and in the PO same material you enter for new line or new material and do you have any funcitonal authorization assigned o your user id
    please reply

  • Hi sunil i used this code but showing error called (startingrow)compile time sub or function are not defined please

    i wanted to update data of excelsheet to mysql database  but displaying an compile time error as sub or functions are not defined           -------------->(startingrow)     please help me out 
    Dim cn As New ADODB.Connection
    Dim number, nRows, wds_id, production_data
      cn.ConnectionString = "Provider = MSDASQL.1; Persist Security Info = False;Data Source = mysql32; User ID = root;Password = bmx1; Initial Catalog = wds"
      cn.CursorLocation = adUseClient
      cn.Open
     Dim i As Integer, QryTxt As String
     i = StartingRow(wds_id) ---------->In this line
     Do Until i = Sheet1.Rows.count
      If Sheet1.Cells(i, 1) = "" Then
       nRows = i - 1
       Exit Do
      End If
      i = i + 1
     Loop
     For i = StartingRow(wds_id) To nRows
            QryTxt = QryTxt & "update tblprod_agr_006 set wds_id1 = '" & Replace(Sheet1.Cells(i, 1), "'", "''") & "'," & vbCrLf
                               QryTxt = QryTxt & "    column2 =  '" & Replace(Sheet1.Cells(i, 3), "'", "''") & "'," & vbCrLf
                               QryTxt = QryTxt & "    column3 =  '" & Sheet1.Cells(i, 4) & "'," & vbCrLf
            QryTxt = QryTxt & "where conditioncolumn =" & "'" & Sheet1.Cells(i, 2) & "'" & "" & vbCrLf
     Next
     cn.Execute (QryTxt)

    First off, is this relating to a Microsoft SQL Server database, or a MySQL database?  I see several references to MySQL in your example.
    Your code uses a function StartingRow() which isn't a built-in T-SQL function.  So, if it is a function you've defined, you need to make sure it's properly referenced in order to use it.  (may need a 2 or 3 part name if it isn't in the default
    schema or the same database.)
    Microsoft SQL Server Storage Engine PM

  • Few line items are not coming at the time of creation of delivery

    Dear Experts,
    When the user creating the delivery few line items are not picking in the delivery document
    the following checks i verified,
    Stock is available
    shpping condition is differ from sold to party and sales document
    Plants are same for all the line items
    why the few line items are not coming in the delivery document creation,
    please help me to sort out this issue
    Thanks and Best Regards,
    Muralidharan S

    Hi,
    Check below points.
    Point 1:
    When you create a delivery document, you create it for a Shipping Point.
    So whatever the line that came in to one delivery has determined same shipping point that you entered in VL01N screen.
    Others got a different shipping point and that's why it didn't come to the same delivery document.
    Shipping point determined based on below criteria
    - Shipping Condition - From customer master
    - Loading Group - Material
    - Plant  - Delivery Plant of the sales order line item
    You assign a proffered shipping point for above combination in configuration.
    If that combination is not find, those line items are not going in to the delivery.
    You can check the log of the delivery document for more information as well.
    Point 2:
    Check the line item Requested delivery date and the "Selection Date" you entered in the VL01N screen.
    Al  Requested delivery dates has to be on or before the  "Selection Date" you entered in the VL01N screen.
    Those line items which has a date more than that will dropped in the delivery.
    Best regards,
    Anupa

  • Line items are not appearing for some users

    Hi
    In one module pool program some line items are not appering for specific users. For Ex: Out of 5 line items user1 is able to see only 3 and user2 able to see all the line items. what might be the reason.
    Regards
    John.

    Hi,
    What do you mean by line items? Are you talking about screen fields in your module pool program or output of the program?
    Please clarify your issue.
    Regards,
    RS

  • SRM 7.0 PO Condition are not copied in ECC po

    Hi Experts!!!
    i am facing the problem SRM 7.0 PO Condition are not copied in ECC po, Net price is Coming instead of Gross price. & is there any BADI why which i can Fecth the Condition Data From SRM Quotation to ECC.
    pls help me it is go-live critical.
    regards
    vikas

    Hi Masa,
    1. Do the texts need to be mapped in the  node that you hjave mentioned. Sould not the SRM texts be mapped to ECC textx by default . After all , it shoud be standard predelivered feature . I have not done any mapping but still the SRM supplier text in shopping cart line item , flows into ECC Material Text in ECC PO line item.
    i.e by default SRM supplier text in shopping cart line item = ECC Material Text in ECC PO line item.
    No other text from SRM SC or PO ir flowing into ECC PO
    Rgds
    Sumendra

  • Asset Line items are not updating in table ANEP

    Hi friends,
    I found that asset line items are not getting updated in ANEP table,.
    This is my precedure for posting of depreciation.
    I'll create Asset through AS01, then i'll use the T.Code: F-90.. then i'll run the depreciation program thru t.Code: AFAB.
    In but i am unable to capture the values of Planned and Depreciated or Posted values in ANEP.. Is there is any other table for this...
    Where is the mistake in my process..
    thanks in advance..
    Naveen

    HI Naveen
    The FI-AA documents are stored in tables ANEK (document header), ANEP (document line items) and ANEA (proportional values). You can use FI-AA standard report RABEWG_ALV01 to list all transactions to an asset in one fiscal year, and report RAABGA_ALV01 to list only retirement postings.
    ANEA should be the solution you are looking for.
    Hope it helps!
    Cheers
    Z

  • Line items are not coming on next page in Bill of Lading

    When I am printing Bill of Lading, if it has around 8 line items then its printing on the first page, but if line items are more then its not printing the remaining line items on second page.
    I have one delivery with 10 line items, when I am printing it then on first page 7 line items are coming and for 8 line item only material is printing and on second page its description is printing but last two line items are not printing at all.
    Kindly help me to resolve the issue as it is very critical.

    Hi,
    Check below points.
    Point 1:
    When you create a delivery document, you create it for a Shipping Point.
    So whatever the line that came in to one delivery has determined same shipping point that you entered in VL01N screen.
    Others got a different shipping point and that's why it didn't come to the same delivery document.
    Shipping point determined based on below criteria
    - Shipping Condition - From customer master
    - Loading Group - Material
    - Plant  - Delivery Plant of the sales order line item
    You assign a proffered shipping point for above combination in configuration.
    If that combination is not find, those line items are not going in to the delivery.
    You can check the log of the delivery document for more information as well.
    Point 2:
    Check the line item Requested delivery date and the "Selection Date" you entered in the VL01N screen.
    Al  Requested delivery dates has to be on or before the  "Selection Date" you entered in the VL01N screen.
    Those line items which has a date more than that will dropped in the delivery.
    Best regards,
    Anupa

  • Why won't the copying action stop? How do i quit it so i can shut down? Items i tried to copy to either my hard drive or my USB memory are not copying - why? And now can't quit them either!

    I have a Western Digital My Book hard drive which i use to store my media/data/back up. I tried to transfer some files on my desk top to it yestrday and it was taking forever so decided to stop it. Now it just shows under the Copying box, stopping but it isn't? I tried then to down load the same images t my USB memory stick and now that is doing the same. I wonder if i is to do with upgrading to Mavericks as no problems before?
    I have check my WD My book on another computer and thankfully all mmedia is still in tack!
    How can i quit this copying so i can shut down my computer?
    Any ideas as to why items are not copying to external memories and what if anything can i do to get it copying correctly again?
    I really need to back up my work by tonight - help! Any suggestions there too?

    option discovered in preferences. Really this and any feature that moves deletes or edits a users data should as far as possible be OFF BY DEFAULT. It shouldn't by default and without the users specific say do this dangerous and unnecessary thing without even letting the user know what it's doing!!! And then cause me a few hours (as i'm new to mac) searching for the option so as to switch it off. If i hadn't noticed the status cage declaring that it was copying files then i might never have twigged that this insane thing was occurring. And if i hadn't of noticed i would have been left maintaining the contents of the folder i copied the files to, the folder which as far as i was informed and so believed was also the location of the music files i was playing. How does Apple justify this 'genius' piece of software non-design? Surely it will hurt no one if this was off by default for new users - overall at least i dare say it would cause a lot less distress in the future for the unsuspecting public at large. Thanks for the support.

  • Getting error in return order as free goods are not copying

    Hi
    We are facing error as free goods are not copying in return orders,We have done upto the billing and creating return order with the reference of billing
    Many Thanks
    Rakesh Naveen

    Hi,
    Kindly check the copying control at IMG->Sales and Distribution->Basic Functions->Free Goods->Maintain Copying Control.
    Thank You,
    RB

  • Serial numbers are not copied to new storage location for 311 mvt type

    Hi Guys
    I have 10 stock of material A in 001 Storage location ,which all the quantity is serial number managed
    I have transfered 10 quantity of Material A to 002 location from 001 location using 311 MIGO
    But serial numbers are not copied to 002 location after transfer posting
    001 and 002 are both are WM linked and belongs to same plant
    Can any body suggest good solution,how it can be done

    Hi
    1.Check in material master whether serial number management is active in Plant data/stor Tab and serial number profile is assigned
    2. Check while doing MIGO once if u enter the material and transfer qty you are getting the serial number tab or not
    3. If everything is ok, then after posting the document check the serial number status in IQ09, check the stock type and the storgae location in the serdata tab
    Regards
    Amuthan M

  • Out of Office Messages are Not Sent Out

    Hi there,
    I have an issue with Outlook's Out of Office feature. The Out of Office messages are not sent out (to both internal and external contacts) although it has been already turned on. Only one user is having this particular issue. 
    I've attempted these steps but the issue still persists.
    a) Turning on OOO via OWA
    b) Deleting the current profile and creating a new profile
    Could anybody help me in this?
    Regards,
    Vinod

    Hi Vinod,
    You issue might be related to this:
    "By default, the out-of-office reply to Internet recipients (external senders) is turned off. Many administrators do not allow out-of-office replies to be sent outside the Exchange Server organization, so that unauthorized people do not
    know when users are out of the office. "
    You might want to follow the steps in below KB article to turn on out-of-office replies to the Internet or contact your administrator to check so:
    http://support.microsoft.com/kb/323665/en-us
    Hope it helps and feel free to post back.
    Regards,
    Ethan Hua
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Hello After upgrading iPhoto 9.1.2 when you synchronize the iphone / iphoto ipad events are not copied correctly (this option checked all the photos on itunes).

    Hello
    After upgrading iPhoto 9.1.2 when you synchronize the iphone / iphoto ipad events are not copied correctly (this option checked all the photos on itunes).

    I found this other thread discussing this topic, no fix, I will revert to 9.1.1 from Time Machine and wait for a new update.
    https://discussions.apple.com/thread/3023160?

  • Sales order quantities are not copied to Delivery

    Hi Friends,
    The sales order quantities are not copied to the delivery document. The order type is OR & delivery type is LF.
    We are using the BoM, for which a dwelivery group is created in the sales order. The schedulelines are confirmed as there is ample stock in storage location. The scenario is MTS.
    The copy control in VTLA is :
    At Header level
    order req : 001
    combination req : 051
    header req : 001
    header data ext sys : 0
    At Item Level for TAP
    order req : 102
    item data : 101
    item data ext sys : 0
    business data : 2
    update doc flow ( X ) 
    positive/negative : +
    At Item Level for TAN
    order req : 101
    item data : 101
    item data ext sys : 0
    business data : 2
    update doc flow ( X )
    positive/negative : +
    Please tell the solution
    regards,
    Yuvaraj.

    Hi,
    When you do the setting for item category, you need to maintain that the item is relevant for delivery. Kindly check.
    Regards,
    Jn

  • G/L Accounts are not copied

    Hi Experts,
    I created a new company code and it is  copied from 1000.
    But the G/L Accounts are not copied from 1000 to new company code.
    i want to copy the existing G/L Accounts.
    Please guide me.
    Ramireddy

    Hi
    Although you would ask it in FI forums, have you used the tcode OBY2 without the test flag to copy GL acc. from one company to the other? Remember that in destiny company must not have any account,
    Regards
    Eduardo
    I copy the info from documentation in IMG:
    Copy Company Code
    In this activity you can copy G/L accounts from one company code to another.
    Requirements
    No G/L accounts may exist in the target company code.
    The chart of accounts for the target company code must be a copy of the source company code's chart of accounts.
    Note
    If no master data exists for G/L accounts in the chart of accounts area in the target company code, the system copies the master data from the source company code's chart of accounts.
    Activities
    Enter a target company code in the Company code field. In the Copy from company code field, enter the company code you want to copy.
    Edited by: E_Hinojosa on Oct 27, 2011 3:35 PM

Maybe you are looking for

  • LinkedHashMap problem (Same key but different value)

    Dear Friends, There is problem in LinkedHashMap for same key but different values. I want both values of same key as Output. Plz help me from an example code & it's output LinkedHashMap<Object, LinkedList<Object>> linkhash = new LinkedHashMap<Object,

  • JSP : create variable dynamic variable name and get his value.

    //HI forums.sun.com ! //What I want to do is above : //out.println("<td style=\"width: "+col_width_+h+" \">") //Variable Declaration String col_width_1 = "100px"; String col_width_2 = "150px"; //etc String col_width_N = "XXXpx"; //loop for (int h = 0

  • Exporting to Encore Interlacing Problem

    Hi,      I am finishing up my project and am working on getting DVDs burned and have run into a problem.       My computer came with Final Cut Pro and some of the Studio applications on it, but not DVD Pro.  I decided to build my menu in Adobe Encore

  • Calling a BOR method

    Hi All, There is a particular method in a BOR object (T-Code SWO1)which needs to be invoked from a report program . Please tell the method of declaring the same in the program and calling the same in the report program. Urgently needed .... Thanks in

  • STR's with an S Loc

    Hi All, We are using one of our WH's as a storage location in SAP & would like to deal with it in terms of STR's for the supply & receipt of products. While I know that we can create STR's using MRP Area concept, in APO (SCM 7.0) the SAP documentatio