Coding for event "status change" in opportunity

Hello,
i need to process own coding if an opportunity was changed to status "lost".
How would you realize this? Where do i find a god point to add this own coding which shall be processed on status change?
Thank you
Best regards
Manfred

Hi.
It's very simple.
You create your function module using the same interface that another ones in this transaction.
Pick up an example, for instance the entry:
BUS2000111  |  end of document processing (50)   |  priority: 40  | object STATUS | Event: after change | Atribute: <*> | function module: CRM_OPPORT_H_PROB_SET_EC
Use the same interface for your function module:
FUNCTION CRM_OPPORT_H_PROB_SET_EC.
""Local Interface:
*"  IMPORTING
*"     REFERENCE(IV_OBJECT_NAME) TYPE  CRMT_OBJECT_NAME
*"     REFERENCE(IV_EVENT_EXETIME) TYPE  CRMT_EVENT_EXETIME
*"     REFERENCE(IV_EVENT) TYPE  CRMT_EVENT
*"     REFERENCE(IV_ATTRIBUT) TYPE  CRMT_EVENT OPTIONAL
*"     REFERENCE(IV_HEADER_GUID) TYPE  CRMT_OBJECT_GUID OPTIONAL
*"     REFERENCE(IV_STRVAL_OLD) TYPE  ANY OPTIONAL
*"     REFERENCE(IV_STRVAL_NEW) TYPE  ANY OPTIONAL
All these parameters will going to be updated with current info while you are creating your opportunity document.
In IV_STRVAL_OLD you will find info about the previous status (which is the object assigned), and in IV_STRVAL_NEW you will find the info about the new status that was assigned in the opportunity document.
So what you have to do is:
1 - create a Z function module with this same interface.
2 - Assign it to object STATUS_H, on CRMV_OBJECT_FUNC view using SM30 transaction. Note: I am just not sure if you must use object STATUS_H or STATUS.
3 - Create the event that must be:
BUS2000111 | 1 - Imediatelly | Priority: 99 for instance | object: STATUS_H or STATUS | event: AFTER_CHANGE | Atribute <*> | your function module | check for function on header | callback: empty
This is better than use the ORDER_SAVE badi because it executes your function module as soon as you change the status.
I guess that using the CRM_ORDER_STATUS badi as it was sugested is also a good option.
Regards.
Susana Messias

Similar Messages

  • EXIT/ BADI/ Enhancement point for User Status change in Order

    Hi all,
    I am looking for an EXIT or a BADI or an enhancement point specifically for user status change in an order thru IW31/IW32.
    I have the exit names for Order PBO, PAI, 'SAVE' event etc. so m not looking for generic answers.
    I have to put some validations for the Order on USER STATUS CHANGE. Let me know if any of u have any pointers on that.
    Thanks and Regards,
    Sonal

    Hi,
    Use this Enhancement IWO10009 and call these function module to change the User Status
    STATUS_TEXT_EDIT --> To Read the existing status.
    STATUS_CHANGE_INTERN_VB --> to change the status.
    Regards,
    Satish

  • Coding for PFS status button in ALV report.

    Hi,
    Can anyone please tell me how to write code for PFS status buttons which we enable in ALV report to make them work according to required functionality.

    Hi,
         In the ALV, Pass the user command form name in the parameter i_callback_user_command .
    then create a sub routine like below and do the coding,
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program       = g_repid
          i_callback_pf_status_set = 'PF_STATUS'
          i_callback_user_command  = 'USER_COMMAND'
            TABLES
          t_outtab                 = gt_output
        EXCEPTIONS
          program_error            = 0
          OTHERS                   = 0.
    FORM user_command USING pa_ucomm TYPE syucomm
                            pa_selfield TYPE slis_selfield.    
    CASE pa_ucomm.
       WHEN 'BACK'.
              <<UR CODE>>
    ENDCASE.
    ENDFORM.
    reward points if usefull
    Regards,
    Niyaz

  • Table for WBS status change with date

    Hi,
    Please assist me with a table name which should have WBS status with date on which statis was changed.
    Thanks,
    Manish.

    Hi
    You can use program (SE38) RBSVCDOC to track these changes. Else go manually in CJ20N to track these status changes.
    Use JCDS and JEST table for any other reporting on it.
    *Kindly mark your thread once your query is resolved.*
    Regards
    Saurabh

  • Status profile and status change in opportunity

    Hi All,
    I have a business requirement to convert an opportunity type from one to another without creating another document
    when user changes the status from in process to approved. Along with converting from OP6 to OP2, I have to change the status to in process also.How can I achieve this in CRM 7.1 version?
    Thanks
    Andy

    The status profile for OP2 and OP5 are different.
    So just by passing OP2 in orderadm_h is giving an error status profile can't be assigned to OP2"
    any suggestions to try some other way?

  • CJ20N Authorization Object for Project Status Changes

    Hi Gurus,
      Can any one knows the Authorization Object responsible to control the change of status for a project in the CJ20N?
      We want to control who can and who can't change the STATUS of a project independent from other changes.
    Regards
    Gustavo Balboa

    User authorization object B_USERSTAT. Before that u should define authorization key in Tcode:BS52 and assign it to User status in Tcode:OK02.
    In authorization object B_USERSTAT set ERSL=Authorization Key, so that the user can change the status of that perticular status only.
    Venkat

  • Badi for SC status changes

    Hi All,
    Do you know a BADI that is called when a SC status is changed?
    I need to obtain the SC Nr or GUID and the new status of it.
    Thanks in advance!
    Regards,
    Martin

    Hello Martin,
    We cannot control the SC status in BADI.
    But you can use theDOC_SAVE_BADI and call the BBP_PD_SC_GETDETAIL to get the status of SC. If you have any specific requirement let me know.
    Rgds,
    Prasanna

  • ERecruiting - Triggering of mail when candidate status changes

    Hi All,
    Is an email generated from the system, when a candidate status is changed?
    Say for example if the Activity of an candidate is changed to "Status Change - Rejected", will an email will be generated?

    Hello,
    some general thoughts at the beginning:
    Candidates do not have a rejected state. Candidate states are profile locked and profile released. Only applications and candidacies have a rejected state. It is very important for a technical view to have the obect types in e-recruiting very clear or you will get into big trouble sooner or later.
    SAP delivered workflows are examples. They do not fit a production environment. Also the sap delivered activity and process customizing is an example (and no good one) you will have to design this according to the business needs in the project.
    For the workflow question. It is possible to trigger a workflow by activity creation and activity completion. For status chage activities ths is the same as they are completed directly and never have status planned. The BOR object ERC_ACTIV contains both events, activtycreated is triggered directly, activitycompleted needs a note to run properly.
    It is also possible to trigger a workflow by a status change of an object. The super BOR object ERC_OBJECT contains a statuschanged event, which is raised for all status changes of NA, NB, NC, ND and NE objects.
    For rejection there are basically 2 scenarions.
    Scenario 1
    When rejecting a candidacy by creating a rejection activity you trigger a workflow based on the activity to create the corresponces activity automatically. You can either send it directly or just create it to allow the user to have an individual text. (I do not go into details of this workflow according to the chosen application-candidacy-relation, that would go to far at this point).
    Scenario 2
    When rejecting a candidacy directly in minimum data entry you do not have a status change activity as the status is set directly. In this case you have a workflow which is triggered directly by the status chang which again creates (and sends) the correspondence activity.
    Of course you need checks to ensure the two workflows are not mixed.
    Kind regards
    Roman

  • Email notification in Charm with several status changes

    Hello,
    according to OSS 1275036 I tried to implement email notification in my Charm-process using BADI  AGS_SDK_SCHED_ST_CHD in my schedule condition. If a new partner is responible in Charm-process, this partner should be notified by email. The email should be send if user status is changing.
    It still works for my change request (notification of change manager) and the first step of my change document (notification of developer). But for all following steps (e.g. notification of tester) no action for email-notification is found in my change document.
    In my actions I only use schedule conditions (according to OSS) and no start condition. To use the BADI for several user status, I maintained my user status in field value instead of inital value.
    Does anybody know, how to use this BADI for several status changes in my change document?
    Thanks,
    Laura

    Hello together,
    I solved my problem by using CRM Standardcustomizing. Forgot SAP note 1275036 and 865619. They are all bad and not sufficient for a complex Charm scenario.
    I only used note 1275036 for the first mail in my change document (email to developer). For all following mail notifcations I'm using actions based on workflow conditions instead of BADI.
    Just using normal CRM-Customizing and create one schedule and start condition for every used action.
    E.g. send mail to tester:
    schedule condition:
      &Servicevorgang CRM.Anwenderstatus&  [*] E0002+DHFHEAD 
      and    &Servicevorgang CRM.ErrorFreeFlag&  = X 
    start condition:
    &Servicevorgang CRM.Anwenderstatus&  [*] E0004+DHFHEAD 
      and    &Servicevorgang CRM.ErrorFreeFlag&  = X 
    This works perfect, because you won't get several mails for one status if you save your document more than one time, which is a problem with note 865619.
    Regards,
    Laura Mathes

  • NiDCPower Wait For Event

    Hello,
    I am using the PXIe-4139 SMU to source a current sequence that starts when a trigger is received and takes about 40 seconds to complete.
    After the niDCPower Initiate VI I have inserted the niDCPower Wait For Event VI with a timeout set to 300 seconds to allow for enough time to receive the trigger and complete the sequence. This VI waits for the Sequence Engine Done Event.
    Now this works fine, however, when the user wishes to stop the programm for whatever reasons, they have to wait the full 300 seconds until the Wait For Event VI produces a timeout error and stops the programm. This is rather inconvenient. How can I change the programm so that the user can stop it even when the Wait For Event VI hasn't reached its timeout?
    I tried this:
    But this doesn't work. For some reason, I get a timeout error with code -200474 but the boolean operator returns FALSE.
    Any other ideas?

    If there an output on the wait for event VI that flags a timeout? If so, set the timeout short (like 100 msec) and wait for 3000 timeouts before continuing on.
    Oh, and use an event structure. Timeout event (timeout=0) checks the wait for event, value change event for button breaks out of loop.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • User status change in inspection lot

    sir,
    when i am doing  ud in qa11 that there is compulsary a USER STAUS must be QAA Aprroval by QA manager if user staus is QCNA not approvewd by QA manager then it gives error for user status changes must be compulsary.
        so where we can change that user status of .I have a one option in qa02 is there any another options.
    Please guide me

    Dear Prakash
    If you want to manualy change the status in QA11, you can change there itself. Near to the user status there is a change where you can change the user status ( Set status button - tick and change button)
    Regards
    Gajesh

  • E-mail Notification of Work Status Change

    Hi Experts, I configured and triggered a BPC e-mail notification for Work Status change. However, there are few areas I would like to improve on. Please help. A sample notification message is attached below. Areas highlighted in red are the areas I would like to improve on.
    Subject: You have received an automated message from %PRODUCT2%
    The work status code of Entity has been changed by RCHU:
    This is to inform you that RCHU has updated the work status to Submitted on 01/09/2012 16:21 UTC.
    Category:C_Actual
    Entity:E_1211
    Time:2007.FEB
    New Status:Submitted
    Date/Time:01/09/2012 16:21 UTC
    Here are my questions.
    1. Subject line - Where do I configure the variable %PRODUCT2% ?
    2. Entity - How can I display the description of the Entity?
    3. Date/Time - How can I display local time instead of UTC?
    Thank you in advance for your help. We are running the Microsoft version of BPC.
    Edited by: Raymond Chu on Jan 12, 2012 8:17 AM
    Edited by: Raymond Chu on Jan 12, 2012 8:18 AM

    The periodic scripts or launchd would have to send the email. I don't think you have to do anything to send mail, just receive it, you can check that from the command line:
    mail [email protected]
    When you finish your message put a period on a blank line and hit return, that indiecates the end of the message.
    The one butt biter is that Apple puts a .forward file in all home directories that says to direct all mail to /dev/null , essentially it sends it to a black hole. You'll need to edit this file and put in your email address (if you want the email to go there) or the mails (should) wait for the user to run the mail command to read their messages.
    The mail command has a fairly extensive man page:
    man mail
    Roger

  • Project definition system status change details

    Dear PS experts,
    Request, kindly let me know which report is available to show the system status change from
    crtd to rel
    rel to teco
    teco to clsd
    we would like to analyse which date or period the system status changed thru edit-status
    from crtd to rel
            rel to teco
            teco to clsd
    we don't use any user status.
    i have checked cn60 & all reports from cn41 to cn47, but i don't get any report states about the change details of system status.
    pl help
    srihari

    thanx,
    can u pl tell me about cn60 std report, does this use for system status change or any other purpose, pl let me what purpose this report is available for us.
    i wanted to know only the changes taken place in project definition with regard to crtd to rel or rel to teco or teco clsd, there should some report which will give this data without touching the tables.
    pl help
    regards
    Srihari

  • Track production order ststes histry (Status change date, time, user)

    I want to track a production order status change history. Status change date, user name and status. Appreciate if somebody can give me a T Code, SAP report or a table.

    HI,
    You can see the the date, time and user for the status changes by following the menu path given by Mr. Mangalraj.
    However if you cant see them, then check the T Code OPL8 (for PP and COR4 for PI), implementation tab. Tick the check boxes for for Status Change Documents as your choice (for header, operations etc).
    After checking these boxes you will be able to see the status change details.
    Hope that helps.
    Regards,
    Rohit.

  • Customized program in Network status change

    when I change status for network in project from budget release to budget submit, it will trigger a email sending to my exchange mail box, but how to find the program name that trigger the email? thanks

    You wanted to find out program name than you need to take help of ABAP resource they will get via SOST trasaction which records all the email triggered by system from here you will get name of business object or other details from there you get the details of program name and all..  Your take here should be SOST transaction where you email for Netwrok status Change you will find there onwards ask technical team to take lead furthere.
    With Regards
    Nitin P.

Maybe you are looking for