Creating Service Contract through program

Hi Experts,
Could you please direct me to create a Service Contract (Billable) through program...?
I am trying to use FM - 'CRM_ORDER_MAINTAIN'.
But fully confused what parameters to pass.
Please help...
Regards,
Venkat

Hi Mohammed,
Thanks for the reply.
Filling the fields and relevant data to structures and filling CT_INPUT_FIELDS is okay for me.
Where I have doubt is when filling these REF_HANDLE, LOGICAL_KEY etc.,

Similar Messages

  • How to creating Service Contract using BAPI_SLSTRANSACT_CREATEMULTI

    Hi,
    In my requirement, I have to create a Service Contract from flat file by using BAPI - BAPI_SLSTRANSACT_CREATEMULTI  and data which are comming from flat files are, Serial number, Sold-to party, Ship-to party, Installation date, Contract start date, Contract end date, Service profile, Response profile.
    Please suggest me what are the Import parameters should I pass in this BAPI to create Service Contract?
    Thanks in Advance,
    Deepesh

    Hi All,
    for everybody's benefit (and to avoid you the time I've spent to work this out...), here is a working example on how to create an sales order (TA) via the BAPI_SLSTRANSACT_CREATEMULTI.
    Not really a Service Contract, but it tells you how to call the BAPI.
    Points appreciated, if you find this helpful...
    I use the convention entryField for the values that should be set based on your system.
    Cheers
    G
    *& Report  ZZGVBAPISALESORDER
    REPORT  ZZGVBAPISALESORDER.
    include constants
    include crm_direct.
    // GUIDs
    data: lv_guid_h       type GUID_32,
          lv_guid_i       type GUID_32,
          lv_guid_sl      type GUID_32,
          lv_guid_p       type GUID_32.
    // Handles
    data: lv_current_handle type crmt_handle,
          lv_handle_h      type crmt_handle,
          lv_handle_i      type crmt_handle,
          lv_handle_sl     type crmt_handle,
          lv_handle_p      type crmt_handle.
    // Administration header + item + etc
    data: lt_salesorder_header type table of bapibus20001_header_ins,
          ls_salesorder_header type bapibus20001_header_ins,
          lt_salesorder_item   type table of bapibus20001_item,
          ls_salesorder_item   type bapibus20001_item,
          lt_scheduleline      type table of BAPIBUS20001_SCHEDLIN,
          ls_scheduleline      type BAPIBUS20001_SCHEDLIN,
          lt_partner           type table of BAPIBUS20001_PARTNER_INS,
          ls_partner           type BAPIBUS20001_PARTNER_INS,
          ls_logical_key       TYPE crmt_partner_logic_partner_key,
          lt_organisation      type table of BAPIBUS20001_ORGMAN_INS,
          ls_organisation      type BAPIBUS20001_ORGMAN_INS.
    // Saved sales orders
    data: lt_saved_process type table of bapibus20001_object_id,
          ls_saved_process type bapibus20001_object_id,
          ls_salesorder    type CRMT_RETURN_OBJECTS_STRUC.
    data: lt_input_fields type table of bapibus20001_input_fields,
          ls_input_fields type bapibus20001_input_fields,
          lt_return type table of bapiret2,
          ls_return type bapiret2.
    // Macro definition to populate structure and input field
    This, called as
    setfield ls_salesorder_header GUID lv_guid_h
    is exploded as
    ls_salesorder_header-GUID = lv_guid_h.
    ls_input_fields-fieldname = 'GUID'.
    append ls_input_fields to lt_input_fields.
    Note 1: &2 (field name) MUST be uppercase
    Note 2: for the salesorder header, I haven't used the macro,
    to show how the code should look.
    I've used the macro everywhere else.
    define setfield.
      &1-&2          = &3.
      ls_input_fields-fieldname  = '&2'.
      append ls_input_fields to lt_input_fields.
    end-of-definition.
    // end of macro definition
      // fill order administration header
    perform get_guid changing lv_guid_h.
    add 1 to lv_handle_h.
    ls_salesorder_header-guid          = lv_guid_h.
    ls_salesorder_header-handle        = lv_handle_h.
    ls_salesorder_header-process_type  = 'TA'.
    clear ls_input_fields.
    ls_input_fields-ref_handle = lv_handle_h.
    ls_input_fields-ref_guid = lv_guid_h.
    *ls_input_fields-ref_kind   = gc_object_ref_kind-orderadm_h.
    ls_input_fields-objectname = gc_object_name-orderadm_h.
    ls_input_fields-fieldname  = 'GUID'.
    append ls_input_fields to lt_input_fields.
    ls_input_fields-fieldname  = 'HANDLE'.
    append ls_input_fields to lt_input_fields.
    ls_input_fields-fieldname  = 'PROCESS_TYPE'.
    append ls_input_fields to lt_input_fields.
    append ls_salesorder_header to lt_salesorder_header.
      // fill organisation data (I needed this, you may rely on
    sales org determination instead...)
    clear ls_input_fields.
    ls_input_fields-ref_handle  = lv_handle_h.
    ls_input_fields-ref_guid    = lv_guid_h.
    ls_input_fields-ref_kind    = gc_object_ref_kind-orderadm_h.
    ls_input_fields-objectname  = gc_object_name-orgman.
    setfield ls_organisation REF_GUID lv_guid_h.
    setfield ls_organisation REF_HANDLE lv_handle_h.
    setfield ls_organisation REF_KIND gc_object_ref_kind-orderadm_h.
    setfield ls_organisation SALES_ORG_RESP salesOrgResp(input).
    setfield ls_organisation SALES_ORG salesOrg(input).
    setfield ls_organisation DIS_CHANNEL disChannel(input).
    append ls_organisation to lt_organisation.
      // fill order administration item
    perform get_guid changing lv_guid_i.
    lv_handle_i = lv_handle_h.
    add 1 to lv_handle_i.
    clear ls_input_fields.
    ls_input_fields-ref_guid   = lv_guid_i.
    ls_input_fields-ref_handle  = lv_handle_i.
    *ls_input_fields-ref_kind   = gc_object_ref_kind-orderadm_i.
    ls_input_fields-objectname = gc_object_name-orderadm_i.
    setfield ls_salesorder_item GUID lv_guid_i.
    setfield ls_salesorder_item HEADER lv_guid_h.
    setfield ls_salesorder_item HANDLE lv_handle_i.
    setfield ls_salesorder_item HEADER_HANDLE lv_handle_h.
    setfield ls_salesorder_item ORDERED_PROD product(input).
    *_set_field ls_salesorder_item ITM_TYPE 'TAN'.
    setfield ls_salesorder_item MODE 'A'.
    *adjustment taken from standard include LCMS_MAPPERF04
    *(see where-used-list for BAPI_SLSTRANSACT_CREATEMULTI, program LCMS_MAPPERU11)
    delete lt_input_fields where fieldname = 'HANDLE'
                                    OR
                                 fieldname = 'HEADER_HANDLE'.
    append ls_salesorder_item to lt_salesorder_item.
      // fill schedule line for item
    perform get_guid changing lv_guid_sl.
    add 1 to lv_handle_sl.
    clear ls_input_fields.
    ls_input_fields-ref_guid   = lv_guid_i.
    ls_input_fields-ref_handle  = lv_handle_i.
    ls_input_fields-ref_kind   = gc_object_ref_kind-orderadm_i.
    ls_input_fields-objectname = gc_object_name-schedlin.
    setfield ls_scheduleline ITEM_GUID lv_guid_i.
    setfield ls_scheduleline GUID lv_guid_sl.
    setfield ls_scheduleline HANDLE lv_handle_sl.
    setfield ls_scheduleline ITEM_HANDLE lv_handle_i.
    setfield ls_scheduleline QUANTITY '1.000'.
    append ls_scheduleline to lt_scheduleline.
      // fill partner line
    *perform get_guid changing lv_guid_p.
    *the partner use the logical key as well
    ls_logical_key-ref_partner_handle = '0001'.
    clear ls_input_fields.
    ls_input_fields-ref_guid   = lv_guid_h.
    ls_input_fields-ref_handle = lv_handle_h.
    ls_input_fields-ref_kind   = gc_object_ref_kind-orderadm_h.
    ls_input_fields-objectname = gc_object_name-partner.
    ls_input_fields-logical_key = ls_logical_key.
    setfield ls_partner REF_GUID lv_guid_h.
    setfield ls_partner REF_HANDLE lv_handle_h.
    setfield ls_partner REF_KIND gc_object_ref_kind-orderadm_h.
    setfield ls_partner REF_PARTNER_HANDLE '0001'.
    setfield ls_partner KIND_OF_ENTRY 'C'.
    setfield ls_partner PARTNER_FCT '00000001'.
    setfield ls_partner PARTNER_NO bpNumber(input).
    setfield ls_partner NO_TYPE 'BP'.
    setfield ls_partner DISPLAY_TYPE 'BP'.
    move-corresponding ls_partner to ls_logical_key.
    append ls_partner to lt_partner.
    //  example of a second partner function (custom) with data
        override
    ls_logical_key-ref_partner_handle = '0002'.
    clear ls_input_fields.
    ls_input_fields-ref_guid   = lv_guid_h.
    ls_input_fields-ref_handle = lv_handle_h.
    ls_input_fields-ref_kind   = gc_object_ref_kind-orderadm_h.
    ls_input_fields-objectname = gc_object_name-partner.
    ls_input_fields-logical_key = ls_logical_key.
    setfield ls_partner REF_GUID lv_guid_h.
    setfield ls_partner REF_HANDLE lv_handle_h.
    setfield ls_partner REF_KIND gc_object_ref_kind-orderadm_h.
    setfield ls_partner REF_PARTNER_HANDLE '0002'.
    setfield ls_partner KIND_OF_ENTRY 'B'.            "manual entry...
    setfield ls_partner PARTNER_FCT customFct(input).
    setfield ls_partner PARTNER_NO bpNumber(input).
    setfield ls_partner NO_TYPE 'BP'.
    setfield ls_partner DISPLAY_TYPE 'BP'.
    setfield ls_partner TITLE 'Mr.'.
    setfield ls_partner FIRSTNAME 'John'.
    setfield ls_partner LASTNAME 'Smith'.
    setfield ls_partner STR_SUPPL1 'John Smith and Co'.
    setfield ls_partner STREET 'Street1'.
    setfield ls_partner STR_SUPPL3 'Street4'.
    setfield ls_partner HOUSE_NO '42'.
    setfield ls_partner CITY 'Townville'.
    setfield ls_partner DISTRICT 'Districtshire'.
    setfield ls_partner POSTL_COD1 'AA1 2BB'.
    note now ...
    *adjustment taken from standard include LCMS_MAPPERF04
    *(see where-used-list for BAPI_SLSTRANSACT_CREATEMULTI, program LCMS_MAPPERU11)
    I don't use macro because name of the field in input_table is different
    *_set_field ls_partner COUNTRYISO 'GB'.
    *instead
    ls_partner-COUNTRYISO = 'GB'.
    ls_input_fields-fieldname = 'COUNTRY'.
    append ls_input_fields to lt_input_fields.
    *_set_field ls_partner LANGU_ISO 'EN'.
    ls_partner-LANGU_ISO = 'EN'.
    ls_input_fields-fieldname = 'LANGU'.
    append ls_input_fields to lt_input_fields.
    move-corresponding ls_partner to ls_logical_key.
    append ls_partner to lt_partner.
    Create sales orders                                                  *
    call function 'BAPI_SLSTRANSACT_CREATEMULTI'
      EXPORTING
        testrun       = false
      TABLES
        header        = lt_salesorder_header[]
        item          = lt_salesorder_item[]
        partner       = lt_partner[]
        organisation  = lt_organisation[]
        input_fields  = lt_input_fields[]
        scheduleline  = lt_scheduleline[]
        saved_process = lt_saved_process[]
        return        = lt_return[].
    // get the GUID of the created object
    call function 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        wait = 'X'.
    INCLUDE ZZGVBAPISALESORDER_GET_GUIDF01.
    The include contains only this:
    ***INCLUDE ZZGVBAPISALESORDER_GET_GUIDF01 .
    *&      Form  get_guid
          text
         <--guid  text
    FORM get_guid  CHANGING GUID.
      CALL FUNCTION 'SYSTEM_UUID_C_CREATE'
          IMPORTING
               UUID    = GUID.
    ENDFORM.                    " get_guid

  • Problem in Creating Service contract Quote

    Hi,
    I have a problem while creating Service Contract Quote. The Problem is "No Items being created in Service Contract Quote."
    I am copying these line items from the Package Quote(Programatically). I am reading the Package Quote Lines Items using CRM_ORDER_READ and I am looping these one by one, and copying into one Item Table. Passed this table, to MAINTAIN_ORDERADM_I function module. And Then I am calling SAVE function module.
    But, for me service contract Quote is being created with no line items.
    Can you please let me know, how can I solve this problem.
    And let me know what are the necessary steps to be taken progrmtically,  for creating Service Contract Quote from a Package Quote.
    Thanks,
    Sandeep

    A standard way of doing this would be to create an action in service contract with method call processing type, and method COPY_DOCUMENT. For this you need to do the following:
    1) Create a new action called "SRV_CNTRCT_QUOTE_CREATE" in action pofile already attached to Package Quote. Use
        CRMC_ACTION_DEF Tcode for this.
    2) Choose processing type as method call and method as COPY_DOCUMENT.
    3) Choose parameter CRMD_ORDERADM_H, PROCESS_TYPE with initial value as transaction type of Serv Contract Quote.
    4) Institute start and scheduled conditions if required in CRMC_ACTION_CONF.
    Note: For this copying controls at transaction level, item category level and itemcat determination while copying should have been determined.
    Regds,
    Raghu

  • IDOC type CRMXIF_ORDER_SAVE_M in CRM thru LSMW to create Service Contracts.

    Hi All,
    I am trying to create Service contracts using IDOC type CRMXIF_ORDER_SAVE_M in CRM thru LSMW.
    I have a mapping issue of the file fields to the segment fields;
    I have 5 files, Contract Header, Items, Dates, Partners, Objects(Serial numbers);
    I Appreciate if you send me the mapping details for me if some one has already done this please;
    or any otherhelp on the notes/documents are highly appreciated
    Thanks
    Iver

    hi, do you mean the problem is in the file resource file, and you want to use it in LSMW?
    If so, I have meet the similar problem,  two source file inbound into LSMW. one header , one item
    And I solve it in this way,
    combine the 2 file before lsmw read it, like this
    Header data 1 /   item1
    header data 1 /   item2
    header data 2 /   item1
    header data 3 /   item1
    header data 3 /   item2
    for each line, the header data is exist, if item is mutiple, the header line can be repeat.
    Then the 2 file combine to one file, lsmw read the combined file
    You need to do some additional logic in data mapping,  mapping the different item  in each loop, but header data once if they are same.

  • Creating service contract from OM

    Hi,
    We have tried creating service contracts from OM in 11.5.10.
    Can we create service contracts from OM in 11.5.9? Any pointers where i can confirm this?
    Thanks,
    Sid.

    SId,
    Yes we can!.
    Thanks
    Nagamohan

  • Create Service Contract using BAPI_SLSTRANSACT_CREATEMULTI

    Hi,
    In my requirement, I have to create a Service Contract from flat file by using BAPI - BAPI_SLSTRANSACT_CREATEMULTI and data which are comming from flat files are, <b>Serial number, Sold-to party, Ship-to party, Installation date, Contract start date, Contract end date, Service profile, Response profile.</b>
    Please suggest me what are the Import parameters should I pass in this BAPI to create Service Contract?
    Thanks in Advance,
    Deepesh

    Hi Deepesh ,
    Please use BAPI_BUSPROCESSND_CREATEMULTI for creating the service contract.This is better in terms of functionality and usage , though very similar to BAPI_SLSTRANSACT_CREATEMULTI in terms of its interface.
    You need to call :
    1. BAPI_BUSPROCESSND_CREATEMULTI
    2. BAPI_BUSPROCESSND_SAVE
    3. BAPI_TRANSACTION_COMMIT 
    in succession.
    As far as filling the import parameters is concerned,
    1.All your dates would go to APPOINTMENT_H or APPOINTMENT_I ( Header or Item)
    2.Sold-to Party, Ship-to Party would go to PARTNER.
    Regards,
    Rishi.

  • ERROR IN CREATING SERVICE CONTRACT

    HI GUYS,
      WHEN IAM CREATING SERVICE CONTRACT IN VA41 IAM GETTING ERROR " BASELINE DATE=TODAYS DATE FOR PERIOD
    HORIZON" WHY IAM GETTING THIS ERROR HOW I CAN  RESOLVE THIS.PLEASE GIVE ME STEP BY STEP SOLUTION

    Hi Nagesh,
      Check if the settings for baseline date are correct. Please refer the below mentioned thread and see if it is helpful for you:
    Contracts Creation message Base line date for rule 11 not
    Thanks

  • How to create Service Contract-Urgent

    Hii All,
    Can anyone tell me what all the requirements needed to create a service contract?
    I shall be thankful to anyone who could please please send me the step by step procedure to create the service contract.
    Thanks
    Gopi.

    Hi Gopal ,
    Use following steps for creating service contract.
    1] Use t-code <b>ME31K</b>
    2] Enter details like Vendor , Agreement type (MK) , Purch Orgn Purch.group.In the same , enter Item Category as "<b>D</b>" and respective account assignment category (K,F etc.)
    3]In second screen enter Validity period , then short text for the desired services.In next screen , enter Service details and proper account assnmnt
    Save the contract
    Regards
    Nilesh

  • Error while creating services contract

    dear all
    when i am trying to create service contract i am getting error message as
    Enter reason for change for version
    Message no. MEDCM003
    kindly help

    >
    sardendu kumar wrote:
    > dear all
    > when i am trying to create service contract i am getting error message as
    >
    > Enter reason for change for version
    > Message no. MEDCM003
    > kindly help
    Seems like there is version management active, and its asking for reason or number, look up a field requiring the input and fill it up.
    Edited by: Afshad Irani on May 31, 2010 5:12 PM

  • How can i remove an Service Contract through DI API ????

    Hi everybody,
    when i try to delete an service contract through DI API (2007 PL 47), with method Remove, i receive the following error: "The object does not support this method, or method not implemented yet".
    Somebody know the right way for delete an service contract?

    Hello,
    This is not possible. If you read the help, this describes: Not Supported.
    What you can do:
    Set the Ending to Today or at least the same as Staring Date, or  change the status to terminated or On Hold.
    Best Regards,
    János

  • Service contract conversion program?

    Hi all,
    What kind of program is service contract conversion program? Please refer to  documents/files or threads if needed...
    Thanks,
    Charles.

    Hi Shree,
    Thanks for the reply but currently I'm looking for method to fill up the Interface table compulsory column.
    As mention, some like ID which is stored in other tables which is not so direct to find.
    So I wonder if anyone could let me know if there is a query which I can run the find all matching column between the Interface table against the based table for Service Contracts.
    Currently I still cannot find any document or link which can let me know how to fillup all the compulsory column with the correct values.
    Regards,
    Ronnie

  • Error while creating Service Contract

    Folks,
    While I create a service contract, I am getting the error:
    "An error occurred in system PEC510 during account assignment"
    Could someone help me out with this?
    Thanks,
    Divya.

    Hi Divya,
    Please check the following in IMG:
    CRM -> Transactions -> Settings for Service Processes -> Integration -> Set up time sheet and controlling integration
    After that you should enter the corresponding R/3 System. In R/3 customizing use the following path: Settings for Service Processing -> Controlling Integration -> Establish Controlling type, controlling level and controlling scenarios.
    Here you should check if a controlling scenario for single object controlling (usually) has been maintained. See also paragraph 3.1.1.10.3 in BP guide C26 at the following location: http://help.sap.com/bp_crmv250/CRM_DE/BBLibrary/Documentation/C26_BB_ConfigGuide_EN_US.doc
    Kind regards,
    KZ

  • Not able to create Service Contract from another svc.contract as followup

    Hi,
    I am trying to create a service contract from another service contract as folllow up document as a part of contract renewal process. However, when I click on follow up button, in the popup, not able to the option Service Contract. Hence I am unable to create.
    Could you please let me know, what needs to be done such that Service Contract also will be shown in the popup.
    Thanks for all the replies.
    Thanks,
    Sandeep

    Hello Sandeep,
    It is not possible to create a follow up service contract (BUS2000112) for another service contract (BUS2000112).
    I do not know your business scenario, you can debug method GET_FOLLOWUP_CUST of class CL_CRM_UIU_BT_GET_PROCTYPES and see where the follow-up transaction types are filtered out.
    I met similar case before, the solution provided at that time was
    - modify FM CRM_UBB_FILTER_SUC_PROC_TYPE in line 49. You can comment out the following line:
    delete ct_suc_proc_type where process_type = ls_suc_proc_type-process_type.
    Hope this could be helpful.
    Best regards,
    Maggie

  • Unable to create Service Contract from Sales Order

    Hi Guru's,
    I put a sales order with one product and service line. SO has been closed and then I ran 'Service Contract Order Capture Integration' program.
    When I query my SO using Reprocess Order, I got error status with message as "Request ID : 8360452; Referenced Product not present in the Installed Base;".
    So I searched in metalink found - 'Referenced Product not present in the Installed Base [ID 549160.1]'.
    As mentioned in the document I checked the freeze flag in Oracle Installed Base Admin --> Setup --> Install Parameters.
    The same already been checked. I also checked the service item definition and found IB track not checked under service tab. When I tried to check the flag, an error states that 'Non subscription contract Item cannot be Install Base trackable'.
    Now how to overcome this issue. Any help will be highly appreciate.
    Instance Details:-
    RDBMS : 10.2.0.4.0
    Oracle Applications : 11.5.10.2
    Thanks,
    Bala

    Hello Bala,
    The 'Installed Base Trackable Flag' is a Master Item Controlled attribute in Inventory, which means that when the Attribute is set at the Master Item Level it is cascaded to all Child Organizations.
    If there is inventory in any of the Child Organizations, the flag cannot be changed at the Master level.
    You must issue all of the Inventory out of each Child Organization, change the flag at the Master level.
    Thanks
    -Arif.

  • I want to create purchase Contract through workflow

    Hi All,
    I am working on Purchase contract through workflow. In that I am using business object BUS2014,
    But in this business BUS2014, there is no event called create, So I take copy of business object BUS2014 to ZBUS2014.And I craeted event create & method end_date for checking the end date of contract.
    The problem is, When I am using for t-code ME31k for release, If i am going to check t-code SWEL the event is not trigger on for release.
    My requirement is when the contract is going to over then before 10 days the workflow event is trigger and give the remainder to creator & the vendor. And also same thing before 5 days it will give the 2nd remainder.
    Please help me out regarding this.
    Thanks & Regards,
    Pankaj Sinha.
    Edited by: Pankaj Sinha09 on May 11, 2009 10:07 AM

    Hi there Sebastian,
    You will need this 'extra Action' and QuickTime Pro...
    http://www.apple.com/downloads/macosx/automator/quicktimecompressionactionsandwo rkflow.html
    Regards
    Ric

Maybe you are looking for

  • Can I use the Debugger to debug why a line in UPDATE RULE gives no values?

    Hi, in a simple Update Rule, I had the routine below: RESULT = SOURCE_FIELDS-QTY. "( The goal was to calculate the field MyCclQTY in the cube; Routine was between ODS and Cube ): The cube output gave a BLANK while QTY has 300; although I expected to

  • T400- make the external monitor primary problem.

    I use T400 and Acer p223w monitor. From some reason I cannot make the external monitor to be the primary monitor. Using the Presentation Doctor I have the option to define the external monitor as the primary but when I test it, it says that I have il

  • Finding Transfered Files

    I have used a fire wire to transfer my photos from my desk top (imac) to my lap top Mac book pro). Everything seemed to go well but the photos are not on my lap top. What went wrong?

  • How to register?

    I can't figure out how to register my new wireless mighty mouse. I've searched in all of the categories on the registration form but none of them list it. Can someone point me in the right direction? Thanks!

  • SMTP authentication in OCSR2 9.0.4.1

    I am setting the smtp authentication in OCSR2 to true, after that, when ever I sent mail thru the server, it need the smtp authentication. I thought I had been successfully configure the server. But later on, when I trying to send mail to the user in