Code to change LEAD status

Hi Experts,
I have a requirement, in which the user wants to change the LEADs STATUS via a Z-Code.
Means, we have a WebDyn Pro report displaying the list of Leads in ALV with their status. User wants to change the staus of Lead their itself in the report and save it. User dont want extra work effort of opening LEAD maintainence screen and changing status their & then saving it, rather user wants to update the status then & their in the webdyn pro report.
Hence to acheive this I found two Function module : CRM_ORDER_MAINTAIN & CRM_ORDER_SAVE. Unfortunately, I cannot figure out, what all IMPORTING/CHANGING paparameters need to be passed in those FM.
Has anyone faced similar situation, if yes then please provide me a sample code.
Or can anyone put some other idea to update that status. ??
Waiting for replies..
Rgds
Pankaj Khare

You can use CRM_ORDER_MAINTAIN and populate the parameter IT_SERVICE_OS
or use BAPI_OPPORTUNITY_CHANGEMULTI and populate the parameter SERVICE_OS.
BR,
Florin

Similar Messages

  • Changing Lead Status

    Hi All,
    I am trying to change lead status when saving. I have configured action profile as follows:
    Created new action in action profile
    Processing type: Method Call
    Method Used: Complete_document ( Am I using right Method?)
    Processing Parameters: PROCESS_TYPE = LEAD (LEAD is my TX type)...Here I have dout ...which parameter I have to pass here.
    Created new condition
    Defined start condition as follows:
    &CRM Lead.System Status& = I0802 ( I0802 = Complete).
    Gun....Thanks for your inputs to my previous question...I have given max points..
    Please help in this issue.
    Thanks,
    Ajay

    Hi again Ajay,
    Using method COMPLETE_DOCUMENT, you don't need to set any parameter.
    I still don't get you for start condition :
    &CRM Lead.System Status& = I0802 ( I0802 = Complete).
    Because using COMPLETE_DOCUMENT, once you run it, it will set the document
    system status to I1005 - COMPLETED.
    Is &CRM Lead.System Status& = I0802 your last system status you want to
    change to I1005 ?
    Hope this could help.
    Gun.

  • Absence workflow - Changing Req. status

    Hello, I'm using workflow for absence requests in ESS.
    I created a FM with the following code, which is used in a BOR method and included in a workflow task:
    get request from guid
        CALL METHOD ca_pt_req_header=>agent->get_request
          EXPORTING
            im_request_id = request_id
          IMPORTING
            ex_request    = request.
      Change state only for existing request object
        IF request IS BOUND.
    execute state transition
          CALL METHOD request->initiate_state_transition
            EXPORTING
              im_transfer_event = event
            IMPORTING
              ex_new_status     = new_status.
        ENDIF.
        COMMIT WORK AND WAIT.
    When I test the workflow, it doesn't change the status of the request, but if I have tested the FM and the method and I can change the status request. I have checked the bindings and it seems ok.
    Any help?

    Hi
    Make use of the below code to change the status of a leave/absence request.
    METHOD approve.
      DATA: request TYPE REF TO if_pt_req_request,
            event   TYPE tim_req_xfer_event VALUE cl_pt_req_const=>c_reqtrans_approve.
      CALL METHOD cl_pt_req_badi=>get_request
        EXPORTING
          im_req_id  = me->req_id
        IMPORTING
          ex_request = request.
      CALL METHOD cl_pt_req_badi=>initiate_state_transition
        EXPORTING
          im_request    = request
          im_event      = event
    *    IM_RET_VALUE  = 0
        IMPORTING
          ex_new_status = me->status.
    ENDMETHOD.
    Never use any commit work after you chnage the status of the leave request from a workflow task.
    Regards
    Pavan

  • Can i Change/Update the Lead Status using Action profile of Activity.

    Hi,
    I have created one Lead, and on the basis of Qualification level action triggers and Ativity getting generated.
    I want to know that it is possible by using functions(Action Profile/conditions) in activity, If i change the status reason of Activity (as Accepted) Earlier Leads status would change.(as Close)
    Please resolve with solution.
    Regurds,
    Dipesh.

    Hi Dipesh,
    What I understand is, u wish to change the status of preceding lead transaction when the activity status reason is changed to accepted.
    1.  This functionality can be achieved using ORDER_SAVE Badi. This Badi implementation shall check the activity reason changed to accepted, if yes, read the doc flow, get the lead transaction and change its status to close.
    2. As per my knowledge use of action profiles and conditions will not be helpful in this case.Else, create an action definition as Activity reason changed, put a condition which like Activity reason= Accepted.
    In the action definition Processing type use method call.
    Here u will have to create a new implementation of the BADI of action profile, and put the same logic as stated in point 1.
    But in think implementing point 1 should be easier.
    Wish the information is useful.
    Regards,
    Shalini Chauhan

  • Apps 11i change product status code from "Installed" to "Shared"

    Hi All,
    is it possible to change product status code from "Installed" to "Shared"?
    Reg
    chirag Patel

    Why would you need to do this?
    Generally, it is not possible (not supported). However, you can do that for certain modules (like HR/Payroll). Refer to the following note for more details:
    Note: 461063.1 - HR and Financials Applications Installed as Full Instead of Shared
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=461063.1
    Note: 461063.1 - Changing Oracle Human Resources Installation from FULL HR/FULL Payroll Install to SHARED HR/SHARED Payroll Install
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=461063.1

  • CRM LEAD STATUS CHANGE : BAPI_LEAD_CHANGEMULTI

    Hi everyone,
    I see that you were able to change status via BAPI_LEAD_CHANGEMULTI. I am currently using CRM 4.0
    trying to do the same thing; but unsuccessfully.
    Any help in this matter will be greatly appreciated.
    I undated statusx-status = 'X', filled out status table
    as well as the input_fields. But comes back with wrong object type (STATUS) error message.(input field invalid)
    Thanks in advance,
    David

    Hi David,
    If you want to change the status try CRM_MA_ACT_SAVE
    FM.
    Best Regards,
    Chetan

  • Changing task status in code

    Hi Experts,
    I saw in a thread that different functions were advised to be used whenever changing WBS status programmatically:
    System status change of WBS element
    I was wondering if a similar list also exists for task status. I need functions that perform the same checks when changing status than the standard for:
    releasing tasks
    confirming partially / completely tasks
    teco tasks
    Thanks in advance
    Kind regards,
    Neil

    Not aware regardging Program availability. But the same if you are amuaaly able to set up and to avoid ling time in data upload / Migration.. You can develop BDC and use the same for the changing status of task. I believe  by task, you  are referrring  network activity.
    Regards
    Nitin P.

  • Change of Status is not working in WebUI

    Hello All,
    Iam facing a problem in changing the status of the item in web UI requirement as follows.
    We need to set the item status from the To be Closed to Close.The status To be closed is set by an contract processor and schedules the Action .i.e Close item Once the contract approver execuets the action.It need to be change to Closed and the item end date need to be set to the date when the Action is execueted
    I have done my coding in the Execute method for the action Close item by using the FM CRM_ORDER_MAINTAIN
    to change the item enddate and CRM_STATUS_CHANGE_EXTERN to change the Status to Closed and the Commit Work .My code is working fine in GUI but this is not working in WebUI . I can only see it when i execute the action go to the edit mode.
    Can any one help me out in this regards.
    Thanks in Advance.
    Regards,
    Kiran Posanapalli.
    Edited by: posanapalli kiran on Feb 15, 2010 7:16 PM

    Hi Kiran,
    we're having the same issue that an opportunity is updated in the normal Gui but not in the WebUI when using FM CRM_ORDER_MAINTAIN.
    What coding did you use for fixing this?
    Kind regards,
    Roy Willems

  • Error in CV02N while changing the status.

    Hi Experts,
    We are getting a error while changing the status of technical change document that " Inconsistent characteristic value assignment" .The document is in status "in use" and we are trying to change it to " old version" using T code CV02N.
    when I tried to see the error desription it is telling that delete the inconsistencies. But I didn't find the list of incosistencies. What may be the problem? Please help me out to get ride of this problem.
    Thanks and best regards,
    Praveen

    Hi Pete,
    The full text message: Inconsistent characteristic value assignment
    Message no. C1821
    In diagnosis it is telling that "You want to change the value assigned to a characteristic. However, the change causes inconsistency, so the new value is not allowed."
    Actually I am just changing the status of the document. I am not changing any characteristic value.
    Actually it is appearing as information message. but while saving it pop up and not allowing to save.
    Please do the needful.
    Best Regards,
    Praveen

  • While changing the status of content in Weblogic 10.3 programitically

    while changing the status of content in Weblogic 10.3 programitically is giving the error
    User is not authorized to check in the node.
         at com.bea.content.virtual.internal.server.bean.InternalWorkspaceOpsBean.handleWorkflowActions(InternalWorkspaceOpsBean.java:480)
         at com.bea.content.virtual.internal.server.bean.InternalWorkspaceOpsBean.internalCheckIn(InternalWorkspaceOpsBean.java:420)
         at com.bea.content.virtual.internal.server.bean.InternalWorkspaceOpsBean.checkIn(InternalWorkspaceOpsBean.java:343)
         at com.bea.content.virtual.internal.server.bean.WorkspaceOps_xe5vix_ELOImpl.checkIn(WorkspaceOps_xe5vix_ELOImpl.java:166)
         at com.bea.content.virtual.internal.WorkspaceOpsImpl.checkIn(WorkspaceOpsImpl.java:90)
         at com.bea.content.federated.internal.VersionManagerImpl.checkIn(VersionManagerImpl.java:239)
         at com.nab.portal.portlets.cmscontent.EndDateCMSContent.updateNodeStatus(EndDateCMSContent.java:243)
         at jsp_servlet._portlets._cmscontent.__sampletest._jspService(__sampletest.java:140)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:408)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:318)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at org.apache.beehive.netui.pageflow.PageFlowPageFilter.continueChainNoWrapper(PageFlowPageFilter.java:455)
         at org.apache.beehive.netui.pageflow.PageFlowPageFilter.runPage(PageFlowPageFilter.java:432)
         at org.apache.beehive.netui.pageflow.PageFlowPageFilter.doFilter(PageFlowPageFilter.java:284)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilter.java:336)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at com.bea.jsptools.servlet.PagedResultServiceFilter.doFilter(PagedResultServiceFilter.java:82)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:503)
         at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:251)
         at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
         at org.apache.beehive.netui.pageflow.faces.internal.PageFlowViewHandler.renderView(PageFlowViewHandler.java:203)
         at com.bea.portlet.adapter.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:77)
         at org.apache.beehive.netui.pageflow.faces.internal.PageFlowViewHandler.renderView(PageFlowViewHandler.java:203)
         at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at org.apache.beehive.netui.pageflow.PageFlowPageFilter.continueChainNoWrapper(PageFlowPageFilter.java:455)
         at org.apache.beehive.netui.pageflow.PageFlowPageFilter.runPage(PageFlowPageFilter.java:432)
         at org.apache.beehive.netui.pageflow.PageFlowPageFilter.doFilter(PageFlowPageFilter.java:284)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at com.nab.portal.filter.UserSessionFilter.doFilter(UserSessionFilter.java:176)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at com.nab.portal.filter.CrossSiteScriptingFilter.doFilter(CrossSiteScriptingFilter.java:333)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at com.bea.portal.tools.servlet.http.HttpContextFilter.doFilter(HttpContextFilter.java:60)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilter.java:336)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at com.bea.jsptools.servlet.PagedResultServiceFilter.doFilter(PagedResultServiceFilter.java:82)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3502)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2186)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2092)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    the node is checke odut by annoymous user biut its not checked in the status from 1 to 2 is updated but it not updated to published or retired
    are there any Entreprise scoped roles which sholud be created to set the visitor entitlements on the content
    Please do reply asap
    Thanks
    Regards
    Rani
    Rani Bhatia

    hi
    while changing the sttaus of content in weblogic 10.3 programitcally
    i have written this code List nodeIds=null;
         INodeManager iNodeManager= ContentManagerFactory.getNodeManager();
              try {
              ID nodeId = new ID();
              nodeIds = new ArrayList();
                   linkNode =iNodeManager.getNode(ctx,fileName);
                   log.info("Linknode"+linkNode);
                   String Encodedpath= linkNode.getURLEncodedPath();
                   log.info("Encodedpath"+Encodedpath);
                   com.bea.content.ID nodeid= linkNode.getId();
                   nodeIds.add(nodeid);
              log.info(nodeid);;
                   String repoName = nodeid.getRepositoryName();
                   log.info("repoName"+repoName);
                        IVirtualRepositoryManager repoMgr = ContentManagerFactory.getVirtualRepositoryManager();
                        com.bea.content.federated. IVersionManager iversionManager= ContentManagerFactory.getVersionManager();
                        com.bea.content.federated.IWorkflowManager iWorkflowManager= ContentManagerFactory.getWorkflowManager();
                   if(linkNode!=null)
                        int i= linkNode.getWorkflowStatus();
                                  log.info("Workflow Status"+i);
                                  int j=linkNode.getLifeCycleStatus();
                                  log.info("Workflow Status"+j);
                                  linkNode.setLifeCycleStataus(5);
                                  linkNode.setWorkflowStatus(5);
                                  //iNodeManager.save(ctx, linkNode);
    iversionManager.checkOut(ctx, nodeid, version.getVersionId());                         com.bea.content.virtual.version.VersionableContent versionableContent1 = iversionManager.getVersion(ctx, nodeid, "1");
                             versionableContent1.setStatus(5);
                             iversionmanager.checkIn(ctx, nodeid, versionableContent1);
                             log.info("checkin");
                             b=true;
                        else
                             b=false;
                             log.info("Node already retired ");
              catch (AuthenticationException auex) {
                   log.error("WEB1013IF-3 getLinkNode" + auex.toString());               
              } catch (AuthorizationException authex) {
                   log.error("WEB1013IF-4 getLinkNode" + authex.toString());     
              }catch (RepositoryException repoEx) {
                   log.error("WEB1013IF-5 getLinkNode" + repoEx.toString());
              return b;
    by default annoymous user check out the node
    if for any logged in user which api has to be used eg if i have created the weblogic user how to set this user through api , which apis are used to set this user programmitically so that this user can check out the node and check in the node so that its status can be updated
    Thanks
    Regards
    Rani Bhatia
    Edited by: user10309975 on Jul 5, 2010 10:29 PM

  • Add value to Lead Status

    Hi All,
    How can I add new value's to Lead Status. Status field on the Lead Screen is a read only Pick list.
    Thanks

    Debendra, at this time it is not possible to add or change the values in the Lead Status field.

  • To change user status profile on sales order at run time.

    Hi Experts,
    We have defined status profile for Sales returns ( Doc type RE) which blocks the  return order on creation. There are two statuses here which are to remove the delivery block and to remove the billing block by authorised users.
    The requirement is now to have a three level block ( three statuses ) on the same document. We can create a new status profile and assign it to a new return sales order tpye  but we want to avoid creating new document types. Since this document type is used across various companies in the group we can not assign a new profile on the existing RE document as well.
    My question to all experts is
    Is it possible to dynamically change the status profile assigned to the document type based on characterstics like sales org or company code etc? If any body has done this please let me know the user exit , function module, BADI etc where the necessary coding has been done.
    Helpful answers will be rewarded with points.
    I look forward to your co operation.
    Regards,
    Kartik Shah

    Hi Liam,
    In the Program MV45AFZZ in the FORM userexit_save_document
    you use the following fn module to change the user status
    'STATUS_CHANGE_EXTERN'
    Example
    IF t180-trtyp = 'H'.  "Only creation time
      READ TABLE xvbap WITH KEY matnr = c_matnr.
      IF sy-subrc = 0.  "If above material exist then change status
        LOOP AT xvbap WHERE cuobj NE space
                       AND  matnr =  c_matnr.
          l_objnr = xvbap-objnr.
          CALL FUNCTION 'STATUS_CHANGE_EXTERN'
            EXPORTING
              objnr               = l_objnr
              user_status         = 'E0013'  "Send ej IDOC
              set_chgkz           = 'X'
            EXCEPTIONS
              object_not_found    = 1
              status_inconsistent = 2
              status_not_allowed  = 3
              OTHERS              = 4.
        ENDLOOP.
      ENDIF.
      sy-subrc = 0.  "Restore the previous condition
    ENDIF.
    Reward if helpful *********

  • Changing the status of the sales order item based on reason for rejection

    Hi All,
    When a Sales order item is rejected then the status at the item level is changed as 'TECO'.When the reason for rejection is removed the status 'Teco' is reset.This status change can be achieved using the user exit 'MV45AFZZ'.But the exit does not allow re-atp calculation whenver a blocked item is release.I have use the exit 'MV45AFZB' ,through this the status change as well as re-atp calculation takes place.But the status changed(Based on reason of rejection) does not appear in the same screen.The change gets reflected only when the sakes order is saved and i open it again.
    I want the status change to appear in the same screen.I am doing my code in the form 'userexit_check_vbap' of the exit 'MV45AFZB'. Please let me know if there are any user exits or BADI's available for the same(Changing the status of the sales order item based on reason for rejection ).
    Regards,
    S.Subasree

    Hi subburamaiah
    If you want the report you can create a separate SIS report . In that take the input field  as a Reason for rejection.. and ask for the output the list of sales orders .Now when you check this user defined report you will give the reason for rejection and check what all orders got rejected on that reason for rejection.
    Regards
    Srinath

  • How to change the status value?

    Hi Experts
    We landed in the starnge situation. We defined a multi task EE Monitor activity to change the status attribute to past due when particular internal event code is overdue. We forgot to assign the correct EE monitor Activity to EE Profile and the report /SAPTRX/EE_MONITOR converted the internal event code to overdue but did not change the status to past due for lakhs of records.
    Now we assigned the correct EE Monitor activity to the EE profile. How do we change the status to past due for already processed records? Is there any standard program available for this purpose or shall we need to write any custom program for it?
    Your quick response is much appreciated.
    Thanks
    Ravi

    Hi Ravi,
    the coding in the EE Mon activity SET_STATUS can be used as template. The method is unfortunately protected.
    It depends if you use EE History (Setting in EH Type Customizing). If yes it is importatnt to update also EE History table and the counter in the EH header for the History.
    Maybe the easiest way would be to send with a report messages to the EH and do the update in the rule set with the standard activity.
    You could use a new event code and react on it in the rule set.
    Best regards,
    Steffen

  • How to change the Status CRTD of the Inspection Lot?

    Dear all.
    I want to Complete an Inspection Lot 10000000005 In the T-CODE qvm2.When I select the Inspection Lot 10000000005 and press F8 to Complete the Inspection,the SAP show an error message "Status check error".
    And the detail info show that the error was cause by the Status CRTD of the Inspection Lot.I check the Status of the Inspection Lot 10000000005 and found that it's Status was CRTD CHCR SPRQ.My question was how to change the Status CRTD of the Inspection Lot?
    Regard
    Yoda

    Hi
    CRTD means ...
    In material master QM vew-inspection setup->Inspect with task list tick is there.
    Now to change status,
    Go to Qp01>create a task list for material(If not exists)>remember date of creation of task list must be prior to date to creation of inspec lot
    If task list is created/exists>go to QA02.<inspection specification -->click on Inspec Spec
    and attach task list
    go to sample tab....click on sample.
    Now save it.
    Status will change to REL
    Regards
    Sujit

Maybe you are looking for