How to tigger an action and save it?

Hi All,
can you please help me in tiggering an action.
the below code is posted by jonas and in debugging i found that it is working fine but it is not saving.if it is saved then the issue is solved.pls can anyone help me.
Is there any FM or Class to save it.
&---- *& Report Z_TRIGGER_ACTION * &----
*& The program should trigger the Action *& 'Z_FORLANGNING_1' used to create a follow-up *& transaction from an existing *contract.
&---- REPORT z_trigger_action.
INCLUDE crm_direct.
DATA lv_guid_ref TYPE crmt_object_guid.
DATA lv_context TYPE REF TO cl_doc_context_crm_order.
DATA lv_toolbar TYPE boolean.
  DATA lv_manager TYPE REF TO cl_manager_ppf.
  DATA lt_context TYPE ppftctxtir.
  DATA lt_trigger TYPE ppfttrgor.
   DATA ls_trigger TYPE ppfdtrgor.
   DATA lt_action TYPE crmt_action_get_tab.
    DATA ls_action TYPE crmt_action_get.
DATA lv_object TYPE REF TO object.
DATA lv_action TYPE REF TO cl_trigger_ppf.
DATA lv_status TYPE i.
DATA lt_objects_to_save TYPE crmt_object_guid_tab.
DATA ls_objects_to_save TYPE crmt_object_guid.
data : ls_guid type crmt_object_guid.
*Selection-screen
      SELECTION-SCREEN BEGIN OF BLOCK 001.
*Object-ID for CRM Order Object
PARAMETERS p_obj_id TYPE crmt_object_id.
         SELECTION-SCREEN END OF BLOCK 001.
Get GUID for CRM Order Object
          SELECT SINGLE guid FROM crmd_orderadm_h INTO lv_guid_ref WHERE object_id = p_obj_id.
1. context create
          CALL FUNCTION 'CRM_ACTION_CONTEXT_CREATE'
             EXPORTING iv_header_guid = lv_guid_ref
                       iv_object_guid = lv_guid_ref
             IMPORTING ev_context = lv_context
             EXCEPTIONS no_actionprofile_for_proc_type = 1
                        no_actionprofile_for_item_type = 2
                        order_read_failed = 3
             OTHERS = 4.
          IF sy-subrc NE 0.
            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 RAISING error_occurred.
          ENDIF.
2. action deterimne
          CALL FUNCTION 'CRM_ACTION_DETERMINE'
           EXPORTING iv_header_guid = lv_guid_ref
                     iv_object_guid = lv_guid_ref
                     iv_context = lv_context
                     iv_for_toolbar_only = lv_toolbar
                     iv_no_detlog = true.
3. get actions from ppf manager
           lv_manager = cl_manager_ppf=>get_instance( ).
            INSERT lv_context INTO TABLE lt_context.
            CALL METHOD lv_manager->get_active_triggers
               EXPORTING it_contexts = lt_context
               IMPORTING et_triggers = lt_trigger.
4. fill exporting parameters
             LOOP AT lt_trigger INTO ls_trigger.
                ls_action-guid = ls_trigger->read_guid( ).
                ls_action-def = ls_trigger->get_ttype( ).
                ls_action-text = cl_view_service_ppf=>get_descrp_for_dropdown( io_trigger = ls_trigger ).
                  INSERT ls_action INTO TABLE lt_action.
             ENDLOOP.
5 get actions from object services
             CLEAR ls_action.
             READ TABLE lt_action INTO ls_action WITH KEY def = 'ZCREATE_MULTI_LETTERS'.
             IF sy-subrc = 0.
               ls_guid = lv_guid_ref.
               CALL METHOD ca_trigger_ppf=>agent->if_os_ca_persistency~get_persistent_by_oid
               EXPORTING i_oid = ls_action-guid
                 RECEIVING result = lv_object.
               lv_action ?= lv_object.
               ENDIF.
6 execute action
               CALL METHOD lv_action->set_is_inactiv( space ).
               CALL METHOD lv_action->execute
                  RECEIVING rp_rc = lv_status
                  EXCEPTIONS empty_medium_reference = 1
                             empty_appl_reference = 2
                             locked = 3
                             document_is_locked = 4
                             inactive = 5
                             startcondition_not_true = 6
                      OTHERS = 7.

Hi Raja,
Where do you intend to save the action? Into the action log inside the document header?
Please keep in mind that we can configure the SAP CRM in order to delete actions after successful execution; this configuration is done at Action Definition Level.
Please check transaction CRMC_ACTION_DEF->Action Profile->Action Definition: Details.
I hope it helps.
Best Regards,
Gabriel Santana

Similar Messages

  • I am working in Numbers and can't seem to change the generic value assigned to the legend.  Any advice on how to select the legend and save new values?

    I am working in Numbers and can't seem to change the generic value assigned to the legend.  Any advice on how to select the legend and save new values?

    Ntenich,
    If your table has a Header and your Legend text is in the header, it will be picked up by the table.
    Jerry

  • I shot a video using my iPad 2, and it is too far away from the subject. How do I zoom in and save the whole video like that? Thanks!

    I shot a video using my iPad 2, and it is too far away from the subject. How do I zoom in and save the whole video like that? Thanks!

    Sorry to be such a moron with this, but I just don't have much experience with this iPad.  I have had it for over a year and I just keep adding stuff to it and it has worked great.  Now that the memory is used up, I am trying to figure out how to free up space and not lose what I have paid for. 
    So, Step 1 is complete, as I have "Transferred" all of the purchases.
    What is Step 2?  I unchecked the concert on the iTunes library, did a sync, but it's still on my iPad.
    Thanks again for the help!!!

  • How do I take movies and save them on the iPad?

    How do I take movies and save them on the iPad?
    Thank you for your help.

    Tank you Jim for responding: "(swipe Video to the selected position - don't just touch it)."
    (I can't believe this!) I open camera. tap video: nothing. Swipe video button (where to?) nothing.
    Reading videos at a glance in the iPad user guide gives me nothing. I know I must be missing something. 
    Thank you for your help.
                                             Walter                                                                                       

  • I can't open Firefox and I haven't saved my extensive bookmarks, which contains all my important websites. How can I start Firefox and save my bookmarks?

    I have a Dell Inspiron E1505, and I use Kaspersky Internet Security. The past week, I've had problems opening Firefox - it has been slow. Today, it just won't open at all. At first I thought it was my Internet connection, so I called my provider, Comcast Cable. But I was also able to open Internet Explorer. I was told that I may have to remove Firefox, and redownload it, but it would erase all my bookmarks. How can I access Firefox and save my bookmarks?

    Try starting Firefox in Safe Mode (Firefox Safe Mode, not Windows Safe Mode).
    First, I recommend backing up your Firefox settings in case something goes wrong. See [https://support.mozilla.com/en-US/kb/Backing+up+your+information Backing up your information]. (You can copy your entire Firefox profile folder somewhere outside of the Mozilla folder.)
    Next, check out this article:
    [http://support.mozilla.com/kb/Safe+Mode Safe Mode]. Be careful not to "reset" anything permanently if you didn't back up.
    To export bookmarks to an HTML file that IE and other browsers can read, see [https://support.mozilla.com/en-US/kb/Exporting%20bookmarks%20to%20an%20HTML%20file Exporting bookmarks to an HTML file | How to | Firefox Help].
    Any luck?

  • Simple question: I placed a document in iCoud on my iMac and it appeared on my iOS devices. If I change it on my iPad it changes on my iMac. Now, how do I change it and save it on my iMac so it automatically changes on my iOS devices?

    Simple question: I placed a document in iCoud on my iMac and it appeared on my iOS devices.
    If I change it on my iPad it changes on my iMac.
    Now, how do I change it and save it on my iMac so it automatically changes on my iOS devices?

    Welcome to the Apple Community.
    I have seen previous versions mentioned in a pop up message before on iCloud.com, but I'm not really sure at all how it would help, as I couldn't get it to do anything.
    The best advice I have at this time is to back up your work on your iOS device by regularly saving it to iTunes, if anything goes wrong you can then either load it into the numbers app again on the device or recover it via iTunes on your computer.
    My syncs are immediate, I never get chance to see if it works in the background, sorry.

  • How to capture an image and save it using action script

    Hello,
    I need to know if is posible to capture an image or a screen region and save it using action scrip.
    Somebody know how to do it ??
    Thanks

    you can capture an image using the bitmapdata class and getPixel().  you can then save that to a bitmap using server-side code like php.

  • Actions and Save for Web

    I have tried to research this on my own searching the forum and asking users far more advanced than I am to no avail. I thought it might be possible that someone here would know whether what I want is feasible.
    I use the "Optimize to file size" feature in the Save For Web Panel constantly. I am planning on doing a large amount of conversions in the near future (by which I mean resaving .jpegs at a certain dimension and resolution. As far as the dimension and resolution go, there is no difficulty creating an action to do that. But the icing on the cake for me is have them all processed through Save for Web at a certain file size (for the sake of argument, say 500K). Yes, I know that the resulting images will vary in quality (obviously) because the end result will very much depend on their file size to begin with but that is not an issue for me for my purposes.
    Save for Web has various presets and allows you to save presets; however, it does not allow you to save the Optimize to file size as a preset. When I try to record an action, and go to the Save for Web, use the Optimize etcetera, the action created lists the quality of the image I process to record the action. So, for example, if my image is less than 500K, the quality recorded in the action is 100. If my image exceeds 500K, the quality might be 86 and that is what the action records. For whatever reason, what is recorded is the quality rather than the 500K. I am not sure if this is being written clearly enough to explain. I want every image to end up being 500K regardless of what the final quality is (quality being the difference between the original image and the image as saved by Save for Web). But actions are saving the attribute of quality rather than file size.  Sigh. I think I am just repeating myself trying to make it clear but probably failing. In case a screen shot helps clarify, here it is. If this can't be done, I would love to know that so I can give up trying.

    I want every image to end up being 500K regardless of what the final quality is (quality being the difference between the original image and the image as saved by Save for Web).
    You may have to resort to Scripting for this task … it may need a fairly convoluted approach but I think it has come up before, so someone may be able to help you over at
    http://forums.adobe.com/community/photoshop/photoshop_scripting

  • How scan a text document and save as editable text not image

    I have a new ENVY 5660 and a macbook pro running yosemite.  When I scan a text document and try to save it, I am only given a choice of image formats.  How can I save it as an editable text in pages or word?

    Hi , Welcome to the HP Forums! I see that you are wondering how to scan a text document, and save as editable text, and not a image, with your HP Envy 5660, on Mac OS X 10.10. I am happy to look into this for you!  According to your printer's specifications, it states: NOTE: Integrated OCR software is available only with Officejet 5740 and 8040 models. Which means, this software is not included with this printer. You might be able to perform this operation, if you are able to get third-party OCR software. Such as: ReadIris.  Hope this answers your question!  “Please click the Thumbs up icon below to thank me for responding.”

  • How to scan fm channels and save IN hp slate6 voice tab

    Hi,I wanted to scan and save the list of FM channels in hp slate6 voice tab.How do I do it?Regards,Umesh.N

    Hey  ,
    Welcome to the HP Forums! I understand you're looking for information on using the FM radio feature of your Slate 6 VoiceTab. Can you tell me which app you are using and I'll do my best to help.

  • How do I right click and save pictures in flash

    Hey,
    I am wondering if its possible to create a flash button that
    says 'save as' when you right click one of the pictures in flash.
    Just like in HTML how you can easily right-click and save a
    picture, I want to be able to do the same thing but in flash. Is
    this possible? Would I use something like dynami pictures that are
    outside the flash file but in the same folder and will be placed in
    the flash movie when called upon? I very curious, please let me
    know of any ideas you may have.

    triniq wrote:
    >
    Hey,
    >
    > I am wondering if its possible to create a flash button
    that says 'save as'
    > when you right click one of the pictures in flash. Just
    like in HTML how you
    > can easily right-click and save a picture, I want to be
    able to do the same
    > thing but in flash. Is this possible? Would I use
    something like dynami
    > pictures that are outside the flash file but in the same
    folder and will be
    > placed in the flash movie when called upon? I very
    curious, please let me know
    > of any ideas you may have.
    Call the button "target" (instance name) than your photo
    image1234567.jpg
    and paste it to timeline frame.
    If you right click Target Movie clip, you will have the
    download option.
    Need to upload and test online, won't work in working
    environment or browser
    run from desktop.
    function down() {
    fileRef.download(foto, "image1234567.jpg");
    var foto = "image1234567.jpg";
    var my_cm = new ContextMenu ();
    var menuItem_cmi = new ContextMenuItem ("Download The
    Photo", down);
    my_cm.customItems.push(menuItem_cmi);
    my_cm.hideBuiltInItems();
    target.menu = my_cm;
    var listener = new Object ();
    listener.onSelect = function (file) {
    trace ("onSelect: " + file.name);
    listener.onCancel = function (file) {
    trace ("onCancel");
    listener.onOpen = function (file) {
    trace ("onOpen: " + file.name);
    listener.onProgress = function (file, bytesLoaded,
    bytesTotal) {
    trace ((("onProgress with bytesLoaded: " + bytesLoaded) + "
    bytesTotal: ") + bytesTotal);
    listener.onComplete = function (file) {
    trace ("onComplete: " + file.name);
    listener.onIOError = function (file) {
    trace ("onIOError: " + file.name);
    var fileRef = (new flash.net.FileReference());
    fileRef.addListener(listener);

  • How do I get zoom and save back?

    Hi all,
    So here goes.
    Tried to zoom and save today on my BB.
    I have tried everything and can't even tho I used to do it?
    It's like options have disappeared?
    So looked at various free apps and they all a pain so went online and some such about new operating system won't allow it or some guff like that.
    So how do I go back to my old operating system to make it work and why would BB get rid of such a useful function? Seems awfully stupid to me to take a feature away without a better replacement?
    Perhaps I have missed something I just wanna take some photo's i've been sent and zoom and save them to a different size and then send on. Should be very simple as it was two clicks before.
    Let me know your thoughts! 

    the following post by Zevoneer in this thread http://discussions.apple.com/message.jspa?messageID=8794716 says it all:
    Did you back up your purchases before you you reinstalled your system? If you erased your drive then the purchases will have been erased along with everything else. If you didn't make a back-up of your purchases to restore from (as you are advised to do) then I'm sorry to say that the policy on lost purchases is that you have to pay to download them again:
    "Once a Product is purchased and you receive the Product, it is your responsibility not to lose, destroy, or damage the Product, and Apple shall be without liability to you in the event of any loss, destruction, or damage." iTunes Store: Purchased content can be downloaded only once
    You could try contacting the iTunes Music Store Customer Service and you might be able to persuade them to sanction a second free download. There have been occasional reports in the iTunes forum of this happening, however just be aware that they are not under any obligation to do so. If you click on this link you'll be able to email your query: iTMS Customer Service
    If you have an iPod that still has the purchases on it the transfer of purchased content from the iPod to authorised computers was introduced with iTunes 7. You'll find details in this article: Copying iTunes Store purchases from your iPod or iPhone to a computer
    You might also want to check out these pages for future reference:
    How to back up your media in iTunes
    Back up your iTunes library by copying to an external hard drive
    JGG

  • How to read csv Data and save it with no format changes

    Hi,
    At first I am not used to Diadem.
    I want to read in a csv file do some calculation with the data and save the changed data in the same csv file. A file as an example is attached (496888_edit.csv).
    Therefore I wrote this lines:
    Dim i
    Dim Delimiter
    Dim FilePath
    Dim FileParameters
    Delimiter = ";"
    Call DataFileLoad(FilePath,"CSV","Load")
    ' Do some calculations
    FileParameters = "<filename>"&FilePath&"</filename>"&"<delimiter>"&​Delimiter&"</delimiter>"
    Call DataFileSave(FileParameters,"CSV")
    After running that lines the csv file is looking like the other attached file (496888_after.csv)
    Because of some reasons which I could not explain Diadem is rounding the numbers. I want that both files look the same.
    What can I do?
    There might be another extension. Just to read in some columns, doing some calculations and after the calculation saving that columns in the file instead of the originals. (The csv files are much bigger like the two examples)
    Thanks,
    Jens 
    Attachments:
    496888_edit.csv ‏1 KB
    496888_after.csv ‏1 KB

    The only thing that can be changed in writing float64 values using the CSV plugin is the decimal point ('.' or ',').
    The format of the doubles is not rounded but the CSV writer only writes the relevant digits.
    It is using up to 15 digits which is the resolution of float 64. It would also switch to scintific writing if necessary.
    So there is no way to force only 6 digits and filling 0s are left out. So if you just fear that you loose precision that will not happen.
    (only the typical problems of epressing a 2 system binary value in a 10 system text string)
    If you are interested to have a fix float format the only solution is to write with VBS directly to a file doing formatting on your own, which is slow.

  • How to capture screen display and save it

    Hello everyone,
    I would like to capture what is being displayed on the screen and save it to a file or send it via http to someone else. I used to have this code but I lost it.
    Your help would be highly appreciated.
    Thanks
    Ulises

    Thanks for the reply. There is sample code somewhere
    to look for.Is that a question?
    /Kaj

  • How do i migrate actions and presets to CS6?

    Is there a way to migrate actions and presets from CS5.1 to CS6 yet?

    I belive Chris is referring to this:
    Move actions, presets, and workspaces | Photoshop CS4, CS5, CS5.1
    http://helpx.adobe.com/photoshop/kb/move-actions-presets-workspaces-photoshop.html

Maybe you are looking for