Updating service orders

Hi all,
I am using the following function to add partners
to a service order.
Function : CRM_PARTNER_MAINTAIN_SINGLE_OW
The function is able to add an new entry. Can I use the same function to modify a partner. Or do I use another
function..
Thanks & Regards,
Abhijeet A Kharade

Hi Abhijeet,
Use CRM_ORDER_MAINTAIN function module.
Refer the following code:
*& Report  YAM_TEST_CRMORDERMAINTAIN                                   *
REPORT  yam_test_crmordermaintain               .
DATA : lit_partner          TYPE crmt_partner_comt,
       wa_partner           LIKE LINE OF lit_partner,
       ls_input_field       TYPE crmt_input_field,
       ls_input_field_names TYPE crmt_input_field_names,
       lt_input_field_names TYPE crmt_input_field_names_tab,
       lt_input_fields      TYPE crmt_input_field_tab.
DATA : lit_header_guid TYPE crmt_object_guid_tab,
       wa_header_guid  LIKE LINE OF lit_header_guid.
* Populate the Input Field Structure
CLEAR ls_input_field_names.
ls_input_field_names-fieldname = 'PARTNER_FCT'.
INSERT ls_input_field_names INTO TABLE lt_input_field_names.
ls_input_field_names-fieldname = 'PARTNER_NO'.
INSERT ls_input_field_names INTO TABLE lt_input_field_names.
ls_input_field_names-fieldname = 'NO_TYPE'.
INSERT ls_input_field_names INTO TABLE lt_input_field_names.
ls_input_field_names-fieldname = 'DISPLAY_TYPE'.
INSERT ls_input_field_names INTO TABLE lt_input_field_names.
ls_input_field-ref_guid    = '00000000000000000000000000000000'.
ls_input_field-ref_kind    = 'A'.
ls_input_field-objectname  = 'PARTNER'.
ls_input_field-field_names = lt_input_field_names.
INSERT ls_input_field INTO TABLE lt_input_fields.
* Bill To Party
MOVE: '00000000000000000000000000000000'  TO wa_partner-ref_guid,
     'A'        TO wa_partner-ref_kind,
     '0001'     TO wa_partner-ref_partner_handle,
     '00000003' TO wa_partner-partner_fct,
     '10000073' TO wa_partner-partner_no,
     'BP'       TO wa_partner-no_type,
     'BP'       TO wa_partner-display_type,
     'X'        TO wa_partner-mainpartner.
APPEND wa_partner TO lit_partner.
CALL FUNCTION 'CRM_ORDER_MAINTAIN'
       EXPORTING
            it_partner = lit_partner
       CHANGING
            ct_input_fields = lt_input_fields
       EXCEPTIONS
            error_occurred = 1
            document_locked = 2
            no_change_allowed = 3
            no_authority = 4
            OTHERS = 5.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
wa_header_guid = '00000000000000000000000000000000'.
APPEND wa_header_guid TO lit_header_guid.
Where ever I have passed the value for GUID as '00000000000000000000000000000000', you need to pass the GUID of your service order.
<b>Reward points if it helps.</b>

Similar Messages

  • Updating service order status in CRM from R3 after the invoice is created

    Hi all ;
    I need to update the user status of an service order in CRM when the invoice related to it in R3 is created, so I have already know  the service order no .
    How can i achieve this by sending BDOC from R3 to CRM? Which BDOC should i use?and is it enough to fill only status data in BDOC?
    Thanks.

    Hi sushant,
    When the R/3 Order status is set to 'Completed' then the system status for order in CRM system is automatically changed to 'Completed'.
    So firstly check whether the User status ('Completed')in SAP CRM has the Business transaction event set to 'FINI'. So when the system status is set to 'Completed' the user status will also change to 'Completed.'
    Secondly even check what are the statuses of item in the Orders.
    regards,
    Anubhav

  • Update Service order status based on Sales order billing status

    Hi All,
    Pls give some suggestions for below scenario.
    Sales order will be created from Service order.
    Service order should get completed once the sales order is billed fully.
    Billing status is available in Sales order header. When ever billing is created, sales order status get updated.
    Where I need to have the trigger (User exit etc...) to update the service order status w.r.t sales order billing status.
    Rgds,
    Senni.B

    Hi,
    As standard the system update service status, maybe some config is missing. Please check the copy control conditions in SD.
    Hope this help.
    Regards.

  • Update service order fileds using exits or BADI

    Hi,
    while creating service order some fileds need to be populated like INGPR, ILART,KOSTL etc. When I create service order these fileds should be populated automatically but this is not happening . Kindly suggest anu BADI or user exit
    Regards,
    Ram

    Thanks Naresh, it helped...
    Can you please help on the below:
    1. For outbound Sales order IDoc- CRMXIF_ORDER_SAVE_M01,need BADIs for modification of the IDoc before it gets generated.
    2. Need program to generate output as outbound IDoc- CRMXIF_ORDER_SAVE_M01  for sales order conformation/acknowledgement.
    3. Need a BADI after the EDI Sales order is saved.
    Thanks in advance
    Vijay

  • Service Order Creation through Sales Order...

    Hello,
    I got one requirement it is , we need to copy the account assignment (WBS element ) from sales order line item to service order line item . Morever same wbs element should be used to create automatic settlement rule in service order.
    This should also work even if user changes the WBS element later. i.e, updated WBS element should again update service order and settlement rule automatically.
    I tried to use Exit MV45AFZB and routine USEREXIT_MOVE_FIELD_TO_COBL, but still i am not able to see the data in service order Location tab, Object tab.
    I checked the table ILOA, its not getting updated when creating Service order via sales order.
    I am not able to see any fields value coming on Service order screen when creating through sales order.
    Regards,
    Sujeet Mishra

    Hi ARC,
    Here the issue is that, Sales Order is getting created but while sending the Order num. to Webpage through web service then rasing below Exception.
    Runtime Error UNCAUGHT_EXCEPTION
    Except. CX_SOAP_CORE
    Date and Time 07.05.2008 20:13:24
    ShrtText
    An exception that could not be caught occurred.
    What happened?
    The exception 'CX_SOAP_CORE' was raised but was not caught at any stage in the
    call hierarchy.
    Since exceptions represent error situations, and since the system could
    not react adequately to this error, the current program,
    'CL_SOAP_TRANSPORT_EXTENSN_ROOTCP', had to
    be terminated

  • Copying WBS element (a/c assignment ) from sales order  to Service order

    HI Controllers,
    I got one requirement it is , we need to copy the account assignment (WBS element ) from sales order line item to service order line item . Morever same  wbs element shud be used to create automatic settlement rule in service order.
    This should also work even if user changes the WBS element later. i.e, updated WBS element should again update service order and settlement rule automatically.
    << Moderator message - Everyone's problem is important. Please do not ask for help quickly. >>
    Thanks in advance
    Sneha
    Edited by: Rob Burbank on Apr 25, 2011 1:39 PM

    Hi Sneha
    You can use Exit MV45AFZB in order to copy the account assignment objects... Use the Form  USEREXIT_MOVE_FIELD_TO_COBL with in MV45AFZB
    You can use the same exit to update your settlement rule as well
    br, Ajay M

  • BAPI for service order create/change

    Hi,
    I need to create and update service order on release 4.6C. I have searched for available BAPI but did not come up with anything. Searching the OSS and forums, I found that there are function modules BAPI_ALM_ORDER_CREATE and BAPI_ALM_ORDER_MAINTAIN available on release 4.7 . There are notes about downgrading these function modules to 4.6C (Note 655926 is one of them, search ALMBAPI).
    My question is, has anybody done this ? What all is part of this downgrade ? There are numerous correction notes, and did you have to apply those ?
    Any help will be greatly appreciated.
    Regards,
    Rajendra Salecha

    Hi Rajendra,
    The note 655926 you mentioned, clearly details all the steps involved in downgrading the BAPIs to 46C. You just have to follow the steps in that order and yes, you need to have all the notes that are mentioned in there, unless they are delivered as part of some support pack and you are on that support pack level already.
    Srinivas

  • Set deletion flag for service orders

    Hi
    How do I mass update service orders and notifications to set the deletion flag.
    I tried with IW72 but no luck Please help.
    Thanks
    Kumar

    Hi,
    You can use batch recording to assign DLFL status to work orders,
    This is the program code
                          0000     T     IW32                                                                               
    SAPLCOIH              0101     X                                                                               
    0000           BDC_CURSOR                                                                                CAUFVD-AUFNR
                          0000           BDC_OKCODE                                                                                /00
                          0000           CAUFVD-AUFNR                                                                                4000488
    SAPLCOIH              3000     X                                                                               
    0000           BDC_OKCODE                                                                                =LVMS
                          0000           BDC_CURSOR                                                                                CAUFVD-AUART
    SAPLCOIH              3000     X                                                                               
    0000           BDC_OKCODE                                                                                =BU

  • Bapis and IDOC for Service order... etc.

    Hi  Experts,
    Can any body please tell me what are the bapis for creating
    following things.
    Create Service Order or Sales Order
    Update Service Order
    Goods Issue & Goods Receipt
    Inventory Balanceses
    Purchase Requisition Information
    Purchase Order Information
    For this above are there any standard inbound and outbound
    idoc for data transfer.
    Thanks  & Regards,
    Chetan

    Hi,
    Thank you very much For the Information.
    I had asked one more question below that.
    "For this above are there any standard inbound and outbound
    idoc for data transfer".
    Thanks & Regards,
    Chetan

  • Crm service order related fields updation

    hi ,
    i am creating a sales order using va01 transaction. service order is automatically created with the config settings . during this, some of the fields in service order in R/3 are not updated. i wnt to populate 6 fields in service order when creating sales order .
    i hv got user exit to update 4 fields, but for operations tab in service order, i need to populated activity type and work ( quantity fields ), these fields are not availbale in the above user exit.
    Can any one pls suggest me how to update the operations tab fields in service order .
    Reg
    Shiva

    hi ,
    i am creating a sales order using va01 transaction. service order is automatically created with the config settings . during this, some of the fields in service order in R/3 are not updated. i wnt to populate 6 fields in service order when creating sales order .
    i hv got user exit to update 4 fields, but for operations tab in service order, i need to populated activity type and work ( quantity fields ), these fields are not availbale in the above user exit.
    Can any one pls suggest me how to update the operations tab fields in service order .
    Reg
    Shiva

  • How to update the service order status at meter level

    Hi
    I need to fetch one open service order and update the retrieved open service order status at meter level.
    I am trying to do it through BAPI_ALM_ORDER_MAITAIN but i am not able to do it.
    Please let  me know the process how to update.
    Thanks & Regards
    Pallavi

    Hi,
    Check if this code works ...
    REPORT zbapi .
    DATA t_meth TYPE TABLE OF bapi_alm_order_method.
    **Internal table for Operation (BAPI)
    DATA t_oper TYPE TABLE OF bapi_alm_order_operation.
    DATA t_comp TYPE TABLE OF bapi_alm_order_component.
    **Internal Table for Opertaions UP (BAPI)
    DATA t_comp_up TYPE TABLE OF bapi_alm_order_component_up.
    **Internal table for BAPI Return code
    DATA t_ret TYPE TABLE OF bapiret2.
    ***WORK AREA DECLARATIONS
    **Work Area for Hedaer
    DATA:wa_header TYPE caufvdb,
    wa_meth TYPE bapi_alm_order_method,
    wa_op TYPE afvgb,
    wa_comp TYPE resbb,
    wa_comp1 TYPE bapi_alm_order_component,
    wa_comp_up TYPE bapi_alm_order_component_up,
    wa_oper TYPE bapi_alm_order_operation.
    PARAMETERS:TEST.
    ****Fill Method Internal table
    CLEAR wa_meth.
    wa_meth-method = 'SAVE'.
    APPEND wa_meth TO t_meth.
    wa_meth-refnumber = sy-tabix.
    wa_meth-objecttype = 'COMPONENT'.
    wa_meth-method = 'CHANGE'.
    wa_meth-objectkey(12) = '000004000104'.
    wa_meth-objectkey+12(4) = '0010'.
    wa_meth-objectkey+16(4) = '0010'.
    APPEND wa_meth TO t_meth.
    **Component Internal table
    wa_comp1-reserv_no = '0000001072'.
    wa_comp1-res_item = '0001'.
    wa_comp1-activity = '0010'.
    wa_comp1-item_number = '0010'.
    wa_comp1-special_stock = 'B'.
    wa_comp1-requirement_quantity = '15'.
    wa_comp1-stge_loc = '0001'.
    wa_comp1-backflush = 'X'.
    APPEND wa_comp1 TO t_comp.
    **Component Update Internal table
    wa_comp_up-special_stock = 'X'.
    wa_comp_up-backflush = 'X'.
    wa_comp_up-requirement_quantity = 'X'.
    wa_comp_up-stge_loc = 'X'.
    APPEND wa_comp_up TO t_comp_up.
    **Call Bapi
    BREAK-POINT.
    CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
    TABLES
    it_methods = t_meth
    it_component = t_comp
    it_component_up = t_comp_up
    return = t_ret.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.   <--- Hope u r using this too
    regards,
    Naveen
    Edited by: Naveen Deva on Apr 16, 2009 9:12 AM

  • User Exit or BADI to update the service order  in R/3

    Hi,
    When creating a service order the following fields need to be populated automatically using an user exit or badi.
    1. Planner Group
    2. PMActType – Plant maintenance activity type
    3. Cost/Profit Centre
    4. WBS element
    5. Work center
    so my requirement is there any function module or Badi or user exit to update the service order details when service order is created / changed.
    Pls do the needful.
    Reg
    Ramana

    Hi Ramana,
    Go to SPRO Transaction and follow the below path
    Customer relationship management>Transactions>Settings for Service Processes>Business Add-Ins and you will find 8 BADI's.
    Check these BADI's useful for you.
    Regards,
    Lijo Joseph

  • Status Update of Service Order From Billing Document

    Dear Experts,
    I am told to change the User status of Service Order once the Billing Document is Generated.
    Here we are in CRM 2007 and i have done the status update of previous document but here
    Billing document is not possible to read through CRM_ORDER_READ (function module).
    Do any one have any idea how do i proceed.
    Thanks,
    SA

    hi sa
    to change the service order user status , when biling document is generated
    make an implementation of bill_acc_if  bai and in the method ENRICH_ACC_DOCUMENT
    read order data using crm_order_read  and change the status using
    CRM_STATUS_CHANGE_EXTERN
    thnks
    sam

  • No document flow updated in Service Order regarding MM flow i.e. PR, PO, GR

    Hello,
    On creating a service order in CRM, the purchase requisition is created automatically in R/3 for the spare parts entered.
    But this PR information is not getting updated in the service order's document flow in CRM.
    I analysed the flow and found that PR gets successfully created and sends back the document flow data to CRM inbound queue.
    The BDoc type involved is CRM_SRV_XTN.
    In it's Extended part, there is a field called ORDERADM_H_GUID which is correctly filled in the BAPIMTCS structure in R/3 which is converted to probably XML format through macro MOVE_CASTING and sent to CRM inbound queue (function module BAPI_CRM_SAVE).
    However, on debugging the respective inbound queue in CRM, I noticed that the field ORDERADM_H_GUID value is not the same as filled in R/3 but some CONSTANT value like 00230023002300560023002300230023 in all the cases.
    Also, FYI, the fieldu2019s value in R3 after conversion looks like as following u2013
    #########################0000000000 ########䣴Ώ삷#耀諣뢮########     48F4038FC0B70093E10080008AE3B8AE
    While in CRM i.e. FM BAPI_CRM_SAVE it looks as follows u2013
    #########################0000000000 ########################     48F4038FC0B70093E10080008AE3B8AE
    So there I feel that the value what is sent from R/3 is not the same as recieved in CRM, on XML conversion.
    Please advise what could be the reason for this anomaly.
    Thanks and regards,
    Manish

    unfortunately document flow in PS is not like in SD
    only in ECP there is a limited possibility
    you can see the line item report and activate the relationship browser which will give the details of the documents related to that posting
    other than that nothing

  • Function Modules for System Status update and reservation for service order

    I am sending the service orders data using IDOCS.
    once the IDOC is received successfully i need to do 2 things:
    1. Update the system status of the service order with the status 'SPV2'.
    2.  Create the reservation for the service order.
    Is there any function modules avilable for both of these process.
    If not how i can do these two things in ABAP Code.
    please help me out in it.

    check whether this Fm's helps you
    STATUS_CHANGE_INTERN
    CO_IH_SET_STATUS_EXTERNAL
    CO_IH_STATUS_FM_SET
    BAPI_ORDER_CHANGE_STATUS_GET
    BAPI_APPREQUEST_SETSTATUSVARNT
    BAPI_ALM_ORDER_MAINTAIN
    BAPI_RESERVATION_CREATE
    Edited by: Keshu Thekkillam on Oct 26, 2009 5:10 PM

Maybe you are looking for

  • Replication of BP and Sales order from CRM to R/3

    Hello everyone, I have a peculiar condition in my hands.The requirement is to replicate 10 business partners from crm to R/3 ,then the next 4 Business partners need not be replicated and then the next three replicated..How do we do this kind of repli

  • Look for Adobe Acrobat 5.0 : link or installation file available?

    For my old PC Win95  4.00.950 B with IE5  5.00 I look forward to install Adobe Acrobat 5.0 to avoid problems with old printer. Thanks for your help !

  • Graph: Get Right Y-Axis value with GetGraphCursor

    Hello, I'm currently developing an application for a customer which contains data being evaluated in a graph control. There are different scalings of data so I use the left y-axis for digital data and right x-axis for analog data. Now I want to add a

  • Date Unix time stamp in milli seconds

    TYPES : BEGIN OF ty_final,          line(600)  TYPE c,         END OF ty_final. DATA : gt_final TYPE TABLE OF ty_final. I have some the records are that are appending to the  internal table gt_final is of length 6423,7. How can I achieve this ? Final

  • What is the best way to back up iphoto "files"?

    I use time machine but this backs up the "library".  I want to back up the files. I have about 40000 photos that I just want to put on an external drive.  If I highlight too many photos or events in iphoto and drag them into a new folder, it crashes