Unable to add line item to a Service Ticket!

Hi Expets,
I am facing some difficulty in adding a line item to a service ticket. The service ticket is not getting saved.I think I am missing some parameter to be passed to CRM_ORDER_MAINTIAN.Please find below my coding:
  lv_product_i-ref_handle = '0000000002'.
  lv_product_i-process_qty_unit = 'EA'.
  INSERT lv_product_i INTO TABLE lt_product_i.
  ls_orderadm_i-header = lv_header_guid.
  ls_orderadm_i-ordered_prod = 'SERVICEITEM_SG5'.
  ls_orderadm_i-handle = '0000000002'.
  ls_orderadm_i-mode = 'A'.
  INSERT ls_orderadm_i INTO TABLE lt_orderadm_i.
  ls_input_fields-ref_handle = '0000000001'.
  ls_input_fields-objectname = 'ORDERADM_I'.
  CLEAR ls_field_names.
  ls_field_names-fieldname = 'MODE'.
  APPEND ls_field_names TO ls_input_fields-field_names.
  ls_field_names-fieldname = 'ORDERED_PROD'.
  APPEND ls_field_names TO ls_input_fields-field_names.
  INSERT ls_input_fields INTO TABLE lt_input_fields.
  CALL FUNCTION 'CRM_ORDER_MAINTAIN'
    EXPORTING
      it_product_i      = lt_product_i
    CHANGING
      ct_orderadm_i     = lt_orderadm_i
      ct_input_fields   = lt_input_fields
    EXCEPTIONS
      error_occurred    = 1
      document_locked   = 2
      no_change_allowed = 3
      no_authority      = 4
      OTHERS            = 5.
I am also calling the save and commit BADI's after this, but somehow its not working for me.
Can anyone please help me out on this or provide some pointers?
Thanks and Regards,
Rohit

Hi,
I have tried everything, still its not working.
First I tried creating a Service Ticket and adding the line item at one go.Then I was getting status error:
System error: An attempt has been made to create a status object
with the object number DE20131333937DF180C5001372F65D25.  However,
a status object with this number exists already.
Code sample given below:
  CALL FUNCTION 'BAPI_BUSPROCESSND_CREATEMULTI'
    TABLES
      header          = itab_header
      item            = itab_item
      partner         = itab_partner
      status          = itab_status
      text            = itab_text
      return          = itab_return
      service_os      = itab_service
      input_fields    = itab_input_fields
      created_process = itab_created_process.
Then I tried creating a service ticket first and adding item later.Then there was no dump, but item details are not getting saved. Code sample given below:
  CALL FUNCTION 'CRM_ORDER_MAINTAIN'
    EXPORTING
      it_product_i      = lt_product_i
    CHANGING
      ct_orderadm_i     = lt_orderadm_i
      ct_input_fields   = lt_input_fields
    EXCEPTIONS
      error_occurred    = 1
      document_locked   = 2
      no_change_allowed = 3
      no_authority      = 4
      OTHERS            = 5.
Can anybody please help me out on this? What is the correct approach?
Thanks and Regards,
Rohit

Similar Messages

  • New line item in the service contract

    Hi Gurus,
    I have requirement to add the new line item in the service contract. Details are as follows.
    as per the requirment, manually we are entering the outbound category via web Ui (service -> service contract).Now I have to develope a badi/method  in standard badi exec_methodcall_ppf which will insert a new line item with the same material as of outbout category but with the item category as inboud.
    could you please help in how can I maintain the new line time. I know we have to use the crm_order_maintain FM but I'm confused what all parameter we need to pass to maintain this.
    can someone please share the code to do that. TIA

    Hi Paul,
    It seems there is no option in changing the condition records at the billing plan item level.
    Please try the following.. see if it helps. To execute the invoices with new condition record values directly, make the settings at the billing item category level goto -- the billing document frame -- under serivces frame -- pricing type select option Carryout new pricing (Option B). This option updates the billing document at the time of invoicing with new price calculation.
    please see if this can help you out.
    Have a good day!!!
    Nandu

  • Urjent-how to add line items in tcode-FBL3N

    Hi Experts,
      How to add line items customer, customer name,  vendor and vendor name in FBL3N.
    Thanks in advance.
    mahe
    Moderator message - Please do not use words like "urjent". Please ask a specific question. Please search the forum. This question has been asked and answered before. Post locked
    Edited by: Rob Burbank on Apr 29, 2009 11:27 AM
    Edited by: Rob Burbank on Apr 29, 2009 11:28 AM

    Hi,
    Check the BTE's:
    00001020     POST DOCUMENT:       Prior to final checks             SAMPLE_INTERFACE_00001020
    00001025     POST DOCUMENT:       Final checks completed       SAMPLE_INTERFACE_00001025
    00001030     POST DOCUMENT:       Posting of standard data     SAMPLE_INTERFACE_00001030
    00001050     POST DOCUMENT:       Accounting interface           SAMPLE_INTERFACE_00001050
    Thanks & Regards,
    Harish

  • To make service entry sheet for multiple line items of the service PO.

    Hello MM Gurus,
    Please help me for the following
    I create a service PO with say 10 line items. Then while doing the service entry sheet the system automatically picks the line item 10 by default. When I try to enter the other items it throws an error" unplanned services cannot be entered"
    So how to make a service entry sheet which shall include all the line items of the service PO at the same time.
    So if I have 100 items in the PO do we make the service entry sheet 100 times against each item? Is there any seeting/solution on this?
    Please help.
    Regards,
    Prasanna.

    Dear,
    I have two solution for u.
    1) Create different service entry sheet -ML81N for each line item and create single invoice verification for all service entry sheet - MIRO
    2) Create service purchase order - ME21N for only one line item.
    And include all services in service tab available at item detail level of service purchase order. Enter it's quantity and rate.
    Than create one service entry sheet for purchase order.
    So you can create one service entry sheet for all line item of services.
    Note: - Use option 2 for easy process.
    Regards,
    Mahesh Wagh.

  • EXIT to change / add line items during STO PO creation in T.Code ME21N

    Hi
    Can somebody suggest me a EXIT or a BADI  to change / add line items during STO PO creation in T.Code ME21N.
    The requirement is as below.
    When the user enters a material no ( which has a BOM created in CS01), and presses enter or saves the PO, i need to get the sub components of the BOM and populate them as the next line items.
    This is because the user needs to create the delivery with reference to the PO. In the delivery, the BOM material needs to be populated with all the sub components of the BOM.
    I tried to do it using EXIT_SAPMM06E_013 in which i am able to change / add the line items in the XEKPO and YEKPO internal tables. The entries are available in the internal table when the EXIT is executed.
    But when the PO is posted internally, the item is not changed/added.
    Thanks in advance.
    Guna.

    Hi,
    Try BADI "ME_PROCESS_PO_CUST".
    cheers,

  • RWIN to automatically add line items in FI document

    Hi all!
    I wish to know if is possible to automatically add line items in a FI document via RWIN and how.
    My final goal is the following:
    A user try to create an FI document with FB01 transaction.
    He/She insert the appropriate line items manually.
    He/She press the "Simulation" button
    In simulation screen there are user's line items, PLUS some more that are necessary in some circumstances.
    Is it possible to achieve this scenario?

    Hi Marinos,
    i think it's  possible via table <b>TRWPR</b> and an
    appropriate function module but it's hold for a modification by SAP.
    other possible solutions:
    - user exit ?
    - interface ( e.g. Intranet-appl. / excel)
      and posting via RFBIBL00 / BAPI
    regards Andreas

  • Automatically add line-items to Sales order

    Hello,
    Our client needs us to add line items to sales orders. The requirement is such that, when the users enter a material on a line item, they wish to see few more materials automatically added as new line items -- item category to be maintained as "Free" items. This appears similar to automatically getting BOM-sub-items for materials which have BOMs maintained. The client is not willing to maintain BOMs for materials in question. They instead have asked us to maintain sub-item materials in a Z-table and then fetch those to populate the subsequent line-items on the sales order.
    So far, we have tried to fiddle around with the XVBAK and XVBAP internal tables in sales exit (MV45AFZZ) and also tried to use BAPI within the same exit. Both methods do not work.
    Could you please guide us ? Thank you.
    Regards,

    Hi,
    I think you can try with product proposal(Item Proposal). T.Code:VA51.
    Using this one can create list of items to be proposed at the time sales order processing.
    Item proposal contains list of items with or without default quantities those were frequently ordered by the customer. You can create any no of items in an Item proposal.Like wise you can create any no.of item proposals.
    But,You can assign only one item proposal per customer in sales tab of the CMR.So that when ever you are creating order for that customer you can access those materials which are listed in an Item proposal completely or selectively,with or without default quantities.
    The items which are proposed from an Item proposal are always changeable.
    Item proposal makes sales order processing simple and fast.
    Only the thing here is it will not automatically explode like in case of BOM.You have to manually select those items from an item proposal.
    Regards,
    Revan
    Edited by: REVAN on Dec 23, 2008 10:55 AM

  • Automatically add line-items to sales orders

    Hello,
    Our client needs us to add line items to sales orders. The requirement is such that, when the users enter a material on a line item, they wish to see few more materials automatically added as new line items -- item category to be maintained as "Free" items. This appears similar to automatically getting BOM-sub-items for materials which have BOMs maintained. The client is not willing to maintain BOMs for materials in question. They instead have asked us to maintain sub-item materials in a Z-table and then fetch those to populate the subsequent line-items on the sales order.
    So far, we have tried to fiddle around with the XVBAK and XVBAP internal tables in sales exit (MV45AFZZ) and also tried to use BAPI within the same exit. Both methods do not work.
    Could you please guide us ? Thank you.
    Regards,

    Ist method:
    Maintain one Ztable with the fields of Material and sub materials.
    write BDC to create order,before entering the material  number check if material is existed in Ztable or not.
    If it exist take that material and added as a another line item.
    if not exist create like normal line item.
    2 nd method:
    Ask your MM functional consultant to maintain supression of materials concept.

  • How to add line item to sales order item table?

    Kindly help me the with the below requirement .
    Add line item to sales order(va01) dynamically on click of button. The button is also custom created push button.
    In the above requirement I have added the pushbutton to va01 tcode. But when I click on that button I need to add line item to sales order item table.
    I tried a lot but I am not successful. If possible can u please help on this.
    Regards,
    Rachel

    Hi!
    It's quite easy even in the standard SAP to add a line item for a customer order, I don't think it worth to develop a new button for this.
    However if you wanted to add a line automatically, the you can do the following in the program MV45AFZZ, FORM USEREXIT_SAVE_DOCUMENT.
    You can use similar code, but with some modifications.
    DATA: lv_posnr.
    LOOP AT xvbap.
    MOVE xvbap-posnr TO lv_posnr.   "get the last posnr
    ENDLOOP.
    ADD 10 TO lv_posnr.
    MOVE 'XYZ' TO xvbap-matnr.   "enter your material number here
    MOVE lv_posnr TO xvbap-posnr.
    * fill additinal field data in XVBAP if necessary
    MOVE 'I' TO xvbap-updkz.                  "Insert line
    APPEND xvbap.
    Regards
    Tamá

  • System should not allow to add line items in delivery

    Hi,
    1) system should not allow to add line items in delivery( in reference to sales order or STO)
    2) sales order/STO should not be changed if delivery exists
    how to control the above
    Alec

    Hi Lakxmi,
           I found answer for 1st point from you are old answers.
          can you throw somelight on 2nd point.
    Thanks
    Anil

  • BAPI_PR_CHANGE : Add line items

    I've read some contradicting posts regarding bapi: BAPI_PR_CHANGE. I was under the impression you could add line items to a requisition using this BAPI? Can it be said for certain it can not be done? The documentation is rather lacking.
    Thanks!
    Enrique Leon

    it's very easy to do this with this BAPI.
    If you have experiences with BAPI_PO_CHANGE you have done this within some minutes.
    Here's some sample-coding. Maybe this will help you:
    LOOP AT it_change_pr INTO wa_change_pr.
        ADD 10 TO lv_pr_counter.
        wa_pritem-preq_item      = lv_pr_counter.                "Item Number of Purchase Requisition
        wa_pritem-material       = wa_change_pr-orig_matnr.  "Materialnumber
        wa_pritem-plant          = lv_plant.                 "Plant
        wa_pritem-pur_group      = lv_pur_group.             "Purchasing Group
        wa_pritem-store_loc      = lv_store_loc.             "Storage Location
        wa_pritem-quantity       = wa_change_pr-menge.       "Purchase Requisition Quantity
        wa_pritem-unit           = wa_change_pr-meins.       "Purchase Requisition Unit of Measure
        wa_pritem-del_datcat_ext = lv_del_datcat.            "Date type (day, week, month, interval)
        wa_pritem-deliv_date     = lv_deliv_date.            "Item Delivery Date
        wa_pritem-fixed_vend     = wa_change_pr-lifnr.       "Fixed Vendor
        CLEAR: temp_matnr.
        CONCATENATE '0000000000' wa_change_pr-matnr INTO temp_matnr.
        SELECT SINGLE * FROM mbew
          WHERE matnr = temp_matnr
          AND   bwkey = wa_change_pr-werks.
        IF sy-subrc = 0.
          wa_pritem-preq_price   = mbew-stprs.                "Price in purchase requisition
          wa_pritem-price_unit   = mbew-peinh.                "Price Unit
        ENDIF.
        wa_pritem-purch_org  = lv_purch_org.                "Purchasing Organization
    **    wa_pritem-po_unit    = wa_change_pr-meins.        "Purchase Order Unit of Measure
        wa_pritem-vend_mat   = wa_change_pr-matnr.          "Material number used by vendor
        wa_pritemx-preq_item      = lv_pr_counter.
        wa_pritemx-preq_itemx     = 'X'.
        wa_pritemx-material       = 'X'.
        wa_pritemx-plant          = 'X'.
        wa_pritemx-store_loc      = 'X'.
        wa_pritemx-pur_group      = 'X'.
        wa_pritemx-quantity       = 'X'.
        wa_pritemx-unit           = 'X'.
        wa_pritemx-del_datcat_ext = 'X'.
        wa_pritemx-deliv_date     = 'X'.
        wa_pritemx-fixed_vend     = 'X'.
        wa_pritemx-preq_price     = 'X'.
        wa_pritemx-price_unit     = 'X'.
        wa_pritemx-purch_org      = 'X'.
        wa_pritemx-vend_mat       = 'X'.
        APPEND wa_pritemx TO it_pritemx.
        APPEND wa_pritem TO it_pritem.
      ENDLOOP.
      CALL FUNCTION 'BAPI_PR_CHANGE'
        EXPORTING
          number                      = lv_banfn
    *   PRHEADER                    =
    *   PRHEADERX                   =
    *   TESTRUN                     =
    * IMPORTING
    *   PRHEADEREXP                 =
    TABLES
         return                      = it_change_return
         pritem                      = it_pritem
         pritemx                     = it_pritemx
    *   PRITEMEXP                   =
    *   PRITEMSOURCE                =
    *   PRACCOUNT                   =
    *   PRACCOUNTPROITSEGMENT       =
    *   PRACCOUNTX                  =
    *   PRADDRDELIVERY              =
    *   PRITEMTEXT                  =
    *   PRHEADERTEXT                =
    *   EXTENSIONIN                 =
    *   EXTENSIONOUT                =
    *   PRVERSION                   =
    *   PRVERSIONX                  =
    *   ALLVERSIONS                 =
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    * EXPORTING
    *   WAIT          =
    * IMPORTING
    *   RETURN        =

  • To add line items to sales order using User exit.

    Hi ,
    I have to add line items to sales order .
    I have tried adding the code in usr exit move field _VBAP // Check VBAP and in savedocument _prepare . But in all the places I dont see it in VA01 . I can see it in the VA02 and VA03 . But I am not able to save the order as they have made the flooring term as mandatory field, and I am supposed to populate the XVBKD structure for this.
    Pls tell me whts the procedure like say , should I popluate the XVBKD / XVBAP / and should i use the bapi_SALES_ITEM_CHECK to populate the structures at the save_document prepare.

    Hi,
    1. It is not possible to delete records using DTW, only importing new records or updating existing ones are supported. These are the only valid operations via DTW.
    2. It is possible to delete the contents of an edit text field by using the character / or -1. However it is not possible to clear an entire row/line using this notation.
    Thanks & Regards,
    Nagarajan

  • How to reject Line Items in a Service Contract?

    Hello friends,
    Can anyone help me understand how do we reject items in a Service Contract? I don't see any Reject field. Is it one of the Status I need to configure for Item Level Status Profile? Even if I add a 'Reject' status, how do I link it to Rejection Reason codes? (I know how to add Reason codes in customizing, but how they are linked to a Transaction type is something I am not finding...).
    Please provide any inputs.
    Thanks.

    HI Navaneethan,
    please try following code.
    make  PEKKO should be internal table with appropraite structure..
    Loop at ZBTXT.
          MOVE ZBTXT-LINE TO PEKKO-ZBTXT.
          append  PEKKO.
         clear  PEKKO.
    ENDLOOP.
    loop at pekko.
    write : / PEKKO-zbtxt.
    endloop.
    if above code is helpful, REWARD POINTS.
    Regards,
    Ranjith

  • Unable to see line items in segment clearing account

    Friends,
    Why we are unable to see the line items in intersegment clearing account/zero balance clearing account, eventhough the master is maintained as open item  and line item display.

    Hi,
    I have received the following error message.
    Account 1999990, company code xxxx is clearing account
    Message no. MSITEM111
    Diagnosis
    You have stored account 1999990 in company code xxxx as a clearing account. At the same time, you use line item management with this account.
    System Response
    Error message issued because line item display cannot read data for an account in a ledger if line items exist partially in the entry view together with clearing items for which there are no line items. In such cases, only the data with line items would be selected.
    Procedure
    Check the Customizing settings or account control. Change the settings so that only automatic postings without line items can be made to the account, or select a different account as the clearing account.

  • How to copy line item details in Service PO from service contract

    Hi Team,
    i am using service contract with account assignment U and when i am creating a PO with reference of contract then in PO at Item Overview is coming data ok, but at item details in services there is not picking data automatically from contract.
    whats wrong in my scenario.

    Hi,
    Please make sure that you follow the following steps:
    1. Enter the contract and item number in the PO item line
    2. Click on the u201CService Selu201D icon to select the required
    services from the contract
    3. In the Pop-up screen, enter the agreement number in the
    corresponding field.
    4. Now select the required services from the contract and
    use the u201CServicesu201D icon or  the F9 key. Now save the purchase
    order with the adopted lines
    Best Regards,
    Arminda Jack

Maybe you are looking for

  • Move Database From one location to another in same Server

    Hi, I am using 11 g R2 in OEL 5. I have installed my database inside oracle base /TEST_DB. Here i have oracle home and datafiles directories etc as usual. But i need to move this to /UAT/TEST_DB and run the oracle home and database form there. Is thi

  • XMLdatasets: How to combine multiple xml data sources??

    What I'm trying to do (without any results so far...) is to combine data from two different xml sources. I have one source with a list of cultural events (agenda.xml) and another with a list of contacts (contacts.xml). Each source has a column with a

  • Garage Band MIDI conflict

    Hey there, Has anyone here ever had a problem getting into Garage Band with this popping up? "garageband has detected a possible conflict between one or more third party MIDI or audio drivers" it says I have to figure out how to delete old MIDI drive

  • Installing HFM 11.1.2.3

    Hello, I have a question, I want to install HFM 11.1.2.3, but I don't know which are the  hardware  requeriments for the installation  in prod environment, if you could help me whit the question. Thank's in advance

  • SMP 3.0 - Server doesn't stops on Windows 7

    We have SMP 3.0 Server on a couple of machines with Windows 7. But when we click on stop or stop from desktop as an administrator, get following errors Stop SAP Mobile Platform Server: The service "SAP Mobile Platform Server" is not in a STOPPED stat