Raising exception as well as populating workflow container from an activity

hi
I am using an activity step within a worflow which is calling method of a class.
Within the method I am calling a bapi, if sy-subrc of BAPI <> 0 then populating the export parameter(BAPIRET2)  of method and raising an exception.
My requirement is in workflow if there is an exception, it will follow exception path and populate WF container BAPIRET2.
For this, I am writing following code in the method.
call function F.M name
if sy-subrc <> 0.
popurate bapiret2.
raise exception1.
endif.
In the worflow, I have activated the outcome exception1 in the activity step.
But the problem is it is following exception1 path but the workflow container is not populating.
If I am commenting the raise exception1 statement in the method, it is not following the exception path but populating workflow container.
Please suggest how both(it will follow exception path and populate WF container BAPIRET2.) can be achieved. I have checked the binding. It is ok.
Please suggest.
Regards,
Sucheta.

Hi,
Maybe it is just easier to forget the exception path, and put a condition after your step. In the condition you can for example check if the bapiret is initial or not. This is of course just an example - you can also return something else from the method that divides the workflow into two (or more branches). A workaround solution, if you don't get the exception working.
Regards,
Karri

Similar Messages

  • PublishWorkflow error when workflow contains custom code activity

    I've failed to get a custom code activity working within Workflow Manager 1.0 even though I believe I've performed all of the guidance steps provided.
    As other posts, I get the usual 'cannot create unknown type' error:
    client.PublishWorkflow( workflowName, @"..\..\TestWorkflow.xaml" );->
    Cannot create unknown type '{wf://workflow.windows.net/$Current/$Activities}SendMailActivity'.
    The activity is implemented as:
    namespace SharedActivities
    public sealed class SendMailActivity : CodeActivity
    I've created an AllowedTypes.xml file containing the following:
    <?xml version="1.0" encoding="utf-8" ?>
    <AllowedTypes>
    <Assembly Name="SharedActivities">
    <Namespace Name="SharedActivities">
    <Type>SendMailActivity</Type>
    </Namespace>
    </Assembly>
    </AllowedTypes>
    The SharedActivities assembly has the following Post Build event command line
    net stop "Workflow Manager Backend"
    %systemroot%\system32\inetsrv\appcmd stop apppool /apppool.name:"WorkflowMgmtPool"
    xcopy /y "$(TargetPath)" "C:\Program Files\Workflow Manager\1.0\Workflow\WFWebRoot\bin"
    xcopy /y "$(TargetPath)" "C:\Program Files\Workflow Manager\1.0\Workflow\Artifacts"
    copy /y $(ProjectDir)AllowedTypes.xml "C:\Program Files\Workflow Manager\1.0\Workflow\WFWebRoot\bin"
    copy /y $(ProjectDir)AllowedTypes.xml "C:\Program Files\Workflow Manager\1.0\Workflow\Artifacts"
    %systemroot%\system32\inetsrv\appcmd start apppool /apppool.name:"WorkflowMgmtPool"
    net start "Workflow Manager Backend"Execution output : 1>------ Rebuild All started: Project: SharedActivities, Configuration: Debug Any CPU ------
    1>  SharedActivities -> D:\Dev\Prototypes\WorkflowTest\SharedActivities\bin\Debug\SharedActivities.dll
    1>  The Workflow Manager Backend service is stopping.......
    1>  The Workflow Manager Backend service was stopped successfully.
    1>  
    1>  "WorkflowMgmtPool" successfully stopped
    1>  D:\Dev\Prototypes\WorkflowTest\SharedActivities\bin\Debug\SharedActivities.dll
    1>  1 File(s) copied
    1>  D:\Dev\Prototypes\WorkflowTest\SharedActivities\bin\Debug\SharedActivities.dll
    1>  1 File(s) copied
    1>          1 file(s) copied.
    1>          1 file(s) copied.
    1>  "WorkflowMgmtPool" successfully started.
    1>  The Workflow Manager Backend service is starting.
    1>  The Workflow Manager Backend service was started successfully.
    1>  
    ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
    The assembly containing the custom activity is loaded into the Workflow host process.
    I've configured my machine (development) to allow unsafe types.
    I've also
    uploaded my project so you can verify the implementation.
    Thanks in advance, Adam

    I did following step in your VS project.
    Remove SendMailActivity from TestWorkflow.Xaml
    Commented out "[assembly: XmlnsDefinition("wf://workflow.windows.net/$Current/$Activities", "SharedActivities")]
    " line from SharedActivities assemblyInfo.cs file
    build the project
    Added SendMailActivity activity in TestWorkflow.xaml
    run the program.
    Above steps seems to be working for me..

  • Update main workflow container from In-Progress Subworkflow

    Hi,
    I have a requirement where I need to update a main workflow container element from a sub-workflow, while the sub-workflow is still running. (In-Progress)
    I have tried using the FM SAP_WAPI_WRITE_CONTAINER in sub-workflow, but it returns an error saying "Cannot call WAPI interface 'SAP_WAPI_WRITE_CONTAINER' in this context".
    I have also tried FM SWW_WI_CONTAINER_MODIFY, but it does not update at all.
    I have also tried triggering an even in sub-workflow, which in turn triggers a class method, but it gives an errors saying "WF locked"
    Please let me know if you have any other strategies.
    Thanks
    Krishna

    Hi,
    what I can suggest you is try to create a program exit in the subworkflow  and in the program exit you can access the main workflow F wotkitem ID, by using thie main workflow workitem ID try to create the instance of the container. and from there in the program exit class you can set and get the values of the workflow container elements.
    but here you have to make sure that you have to create the instance of the parent workitem ID  container, but  not the subworkflow workitem ID container.
    [Program Exits In Workflow |http://wiki.sdn.sap.com/wiki/display/ABAP/ProgramExitsIn+Workflow]
    Regards
    Pavan

  • Over Time Workflow Container elements not updated

    Hi,
    I am using Standard Task TS20000459 for approval of Overtime entered for an employee in CAT2 transaction.
    Work item is getting generated to his manager's inbox.
    Issue is, subject of the work item should have employee number and Employe name. Standard Task contains Container elements &TS_PERNR& and &TS_ENAME& which is not getting filled with any values.
    Can any one suggest me how to get the same?
    Regards,
    Saravana Perumal

    Hi Shanti
    I faced the same problem...And i resolved that problem by binding...
    Create the container element for PERNR and ENAME in the standard task ts20000459 as well as in workflow container.Then bind those container values.
    Before bind the workflow and task container, you have to bind the workflow container with the event container.
    Regards,
    Hemalatha.

  • Workflow issue - Main workflow container elements are not updated.

    Hi All
    We have implemented N-step badi for approval process and for this we have activated one workflow which contains subworkflow .
    During approval process , only the subworkflow container elements( approver list and last approver) getting updated with status and time.But main workflow container elements is not updating with these details.
    Binding between main workflow and subworkflow is perfect. But reverse binding ( from subworkflow -> main workflow ) will take place once subworkflow is completely finished. But here we will require / need to pass some information from sub workkflow to main workflow when still subworlflow in process( before completed itself).
    Please let me know is there any process / steps is required to pass values between subworkflow to main workflow ( binding is perfect).
    Please let me the way how I can update the main workflow container from  subworkflow container or from any step in sub workflow .
    In subworkflow . we have loop of  approvers and it will send workitems to approvers one by one.
    Here i need to update Main workflow with the information like last approver and approver list with status and approved time.
    So please suggest how Can I update main workflow container from subworkflow while subworkflow is still in process( subworkflow not yet completed).
    Kindly reply me ASAP.
    Thanks and Regards
    Madhukar .

    Yes I am setting SWC_SET_ELEMENT for my container values,the ones for which i have defined as EXPORT.
    And I have checked the task also...
    Everything has been checked properly..The binding is fine.
    Thanks & regards,
    Ravikiran Kallimath

  • Upload file in Web Dynpro and add to Workflow container as SOFM object

    Hi!
    I have a Web Dynpro for ABAP application that should send attachments of uploaded files to a workflow container. I have already managed to do this, and it works fine for TXT files, but when I try to attach a WORD (.DOC) file the file looks corrput when I open it from the SAP inbox.
    When uploading files in Web Dynpro it is as an XSTRING. I have tried out the following alternatives regarding convertion of the XSTRING before it is inserted in the SOFM object:
    1) Convert from XSTRING to STRING using codepage 4110.
    Then it is split into a string table of 255 chars
    2) Convert from XSTRING to STRING using codepage 4102
    Then it is split into a string table of 255 chars
    3) Convert from XSTRING to BINARY format
    I use function module 'SWL_SOFM_CREATE_WITH_TABLE'
    and then swf_create_object lr_sofm 'SOFM' ls_sofm_key.
    before I call some macros to fill the container.
    Anyone else who have tried to do this with success? I'm greatful for any help.
    Regards, Tine

    Hi,
    I had the same problem in the last days and finally I got a quite simple solution:
    I had a look at the FM SWL_SOFM_CREATE_WITH_TABLE an noticed that it calls another FM (SO_DOCUMENT_INSERT_API1) which has a tables parameter for HEX data and is actually able to  create a SOFM object from HEX data.
    I simply copied SWL_SOFM_CREATE_WITH_TABLE as a customer FM and applied a few changes to make it accept HEX data:
    First I added a new table parameter in the interface which gets the HEX data from the calling application (uploaded data using BIN format):
    OBJECT_CONTENT_HEX     LIKE     SOLIX
    Here is the code of the FM (I marked all additional and changed lines with a comment):
    function z_test_sofm_create_with_table .
    *"*"Lokale Schnittstelle:
    *"  IMPORTING
    *"     VALUE(NOTE_TITLE) LIKE  SODOCCHGI1-OBJ_DESCR OPTIONAL
    *"     VALUE(DOCUMENT_TYPE) LIKE  SOODK-OBJTP DEFAULT SPACE
    *"  EXPORTING
    *"     VALUE(SOFM_KEY) LIKE  SWOTOBJID-OBJKEY
    *"  TABLES
    *"      NOTE_TEXT STRUCTURE  SOLISTI1 OPTIONAL
    *"      OBJECT_CONTENT_HEX STRUCTURE  SOLIX OPTIONAL
    *"  EXCEPTIONS
    *"      ERROR_SOFM_CREATION
      data: region like sofd-folrg.
      data: folder_id like soodk.
      data: l_folder_id like soobjinfi1-object_id.
      data: document_data like sodocchgi1.
      data: document_info like sofolenti1.
      data: object_content like solisti1 occurs 0 with header line.
      data: lines like sy-tabix.
    *- set default
      if document_type is initial.
        document_type = 'RAW'.
      endif.
    *- create office object
    *-- get dark folder
      region = 'B'.
      call function 'SO_FOLDER_ROOT_ID_GET'
        exporting
          region                = region
        importing
          folder_id             = folder_id
        exceptions
          communication_failure = 1
          owner_not_exist       = 2
          system_failure        = 3
          x_error               = 4
          others                = 5.
      if sy-subrc ne 0.
        message e696(wl)                       "<== Add message class
                raising error_sofm_creation.
      endif.
    *- get description
      if note_title is initial.
        read table note_text index 1.
        note_title = note_text.
      endif.
    *-- create office document
      document_data-obj_name = 'ATTACHMENT'.
      document_data-obj_descr = note_title.
      document_data-obj_langu = sy-langu.
      object_content[] = note_text[].
      describe table object_content lines lines.
      document_data-doc_size = ( lines - 1 ) * 255 + strlen( object_content ).
      if object_content[] is initial.                     "<== insert
        describe table object_content_hex lines lines.    "<== insert
        document_data-doc_size = lines * 255.             "<== insert
      endif.                                              "<== insert
      l_folder_id = folder_id.
      call function 'SO_DOCUMENT_INSERT_API1'
        exporting
          folder_id                  = l_folder_id
          document_data              = document_data
          document_type              = document_type
        importing
          document_info              = document_info
        tables
          object_content             = object_content
          contents_hex               = object_content_hex   " <== Insert line
        exceptions
          folder_not_exist           = 1
          document_type_not_exist    = 2
          operation_no_authorization = 3
          parameter_error            = 4
          x_error                    = 5
          enqueue_error              = 6
          others                     = 7.
      if sy-subrc ne 0.
        message e696(wl)                              "<== Add message class
                raising error_sofm_creation.
      endif.
    *- set export parameter
      sofm_key = document_info-doc_id.
    endfunction.
    The returned  SOFM key I added to a container element. The element refers to event parameter of type OBJ_RECORD in my ABAP OO Class
    Using this function I was able to raise an event by using Method cl_swf_evt_event=>raise
    that invoked a workitem containing an Excel-File i had uploaded as binary file and passed to the FM z_test_sofm_create_with_table as document type 'XLS'.
    In the woritem preview when clicking on the attachment the file was opened directly in Excel.
    Actually the new lines for calculation the file size is not yet quite correct. At first glance it does not seem to cause any trouble, but I will stll check that. In FM SO_OBJECT_INSERT the size is again checked and calculated if initial, so leaving size initial might also be an option.
    I hope this helps anyone having a similar issue.
    Greetings,
    Michael Gulitz

  • When Background task raises exception that is not handeled

    Hi,
    I am using a background task that uses a method which does not handle exceptions raised by the function module it calls in turn. When such situation arises, i want to build some sort of exception handling mechanism in my workflow.
    e.g, BG task uses method 1 that calls method 2. method 2 raises some exception which is not handled in method1 or method2 results into short dump. As a result of this situation Workflow bg task changes the status to ERROR and I want to handle such unplanned exceptions in Workflow.
    Is there anyway for workflow to know (maybe some event) when one of it's BG task status changes to ERROR?
    Thanks,
    Saurabh

    Hi,
    Just use the exit_return macro in your method. See the following example.
    BEGIN_METHOD 'Method_Name' CHANGING CONTAINER
    **Data Declaration
    **fetching data from container
    CALL FUNCTION 'Function_module_name'
       EXPORTING
       IMPORTING
       TABLES
       EXCEPTIONS
         exception1 = 01
         OTHERS = 02.
       IF sy-subrc ne 0.
         EXIT_RETURN 9001 SPACE SPACE SPACE SPACE. 
                           "Define this event in the exceptions of the method.
       ENDIF.
    Passing data to container
    END_METHOD.
    After doing these changes in your method, you will be able to see your exception in the outcomes tab of the activity. Just activate your exception there. You will get a new branch for this exception in your workflow. In this branch, you can determine how do u want to handle the exception.
    Hope this will help you. Let me know if you have any doubt.
    Thanks
    Yogesh Sharma
    Edited by: Yogesh Sharma on Jul 10, 2008 8:54 AM
    Edited by: Yogesh Sharma on Jul 10, 2008 8:56 AM
    Edited by: Yogesh Sharma on Jul 10, 2008 8:57 AM

  • Re: Raising Exceptions Vs returning erro[Ref:C809787]

    Hi Steve !
    Probably the following explanation might help in resolving the issue raised by
    you:
    At a more abstract level, there is only one thing, i.e. the EVENT. According to
    it's definition, an event is a relatively infrequent occurrence in one portion (lets
    call it event raiser) of the application, which some other portion (or portions,
    lets call them event handlers) (of the same application) are interested to respond
    to it. Now there are two scenarios:
    (A) Event raiser and Event handler(s) are being executed under different threads
    of control (Asynchronous) and
    (B) Event raiser and Event Handler(s) are being executed under same thread of
    control (Synchronous).
    So, Exception Handling belongs to scenario B where the method raising the
    exception (Event Raiser or exception raiser) and the method handling it (Event
    Handler or exception block) are under the same thread of control. More ever it has
    to be insured that at a time only one handler (first the inner most one) receives
    the message.
    Fort&eacute; provides a generic Event handling mechanism (Post Event and Event Loop) to
    handle the scenario A (which is the more generic one). But it also provides a
    specialized Event Handling mechanism (Raise Exception and Exception block) to
    efficiently handle the relatively simple scenario B. Why I am saying that the later
    is efficient because it won't be needing to register the event queue address of the
    interested task (after all there is only one task involved) and put the event
    message in queue.
    Finally let me mentioned that it is just my view based on the understanding I
    have and it may not be true. Only a person from fort&eacute; can confirm it. I will really
    appreciate if somebody correct and or refine it.
    Wish a Very Very Happy New Year to all Fort&eacute; Users
    Regard,
    Kailash.
    [email protected] wrote:
    I would agree with Eric entirely. Exceptions seem to me to be a much more
    complete solution to the problem of error handling. A little bit of effort up
    front in making clear the strategy for exception handling and specifying the
    exceptions that can be raised by a class\method will provide an excellent method
    for error handling.
    In the case of ensuring exceptions are always handled, a top level handler for
    GenericException will usually do the job, allowing you to write error
    information out to logs, screen, etc, and then shut down gracefully.
    The only issue I would raise with exceptions is that they are not propagated
    outside an asynchronous task. If an exception is not handled within an
    asynchronous, it will not propagate to the task that started that asynchronous
    task. Forte provides return and exception events when starting asynchronous
    tasks to cope with this, but it seems a shame to have one method of dealing with
    errors (exceptions) for synchronous behaviour, and another (events) for
    asynchronous behaviour.
    Steve Elvin
    Systems Developer
    Frontline Ltd.
    UK
    Mark,
    The problem with return codes is that there is an underlying assumption
    that the receiver will always catch and interpret that error code. This
    may or may not be good thing, depending on how you architect your
    application. If, on the other hand, you want to ensure that an error is
    always handled, if not by the receiver then by the Forte, Exceptions are
    the way to go. To extend this mechanism further, I would subclass
    GenericException and created my own error code attribute on that
    subclass. That way the receiver has the choice of interpreting the
    exception based on that error code, and wrapping it in a
    MessageDialog/window or do the usual 'errormgr.showerrors()'.
    Exceptions seem a more flexible approach to me. That is, if you can live
    with the fact that by using it, you're violating the 'exceptions for
    behavioral anomalies' software engineering principle !
    Best wishes.
    Eric Pereira
    Forte Consultant
    ----Original Message Follows----
    From: "Kallambella, Ajith" <[email protected]>
    To: "'Mark Sundsten'" <[email protected]>, [email protected]
    Cc: [email protected]
    Subject: RE: Raising Exceptions Vs returning error codes
    Date: Wed, 30 Dec 1998 08:52:39 -0500
    Reply-To: "Kallambella, Ajith" <[email protected]>
    Mark,
    Identifying conditions where you would rather use an exception
    to an error_code ( and vice-versa ) normally depends on
    your application design. Usually exceptions
    are used to handle behavioral anomalies which are
    not expected during the normal course of execution of
    the program, and which would affect the continuity of
    your algorithm if ignored. Examples would be a fatal
    error, a semantically invalid( but syntactically-valid
    token ) etc.
    Error_codes and return status's can be used to handle
    anticipated and recoverable errors. Example would
    be presentation layer validations. In any normal
    UI system, the user is expected to make errors and it
    would be annoying to throw an exception( and to handle
    it ), every time user enters wrong data. A well
    modeled client layer should not only handle
    data-validation errors , but should be smart enough
    to encourage users to input correct or
    "near-correct" data. Examples could be
    making use of look-up windows etc. Interestingly,
    Express uses exceptions to handle data-validations.
    As you see, exceptions fit well into your processing
    logic where severity of damage caused by an error
    is more. Where as error_codes fit well into presentation
    logic( and some not-so-critical processing logic ) where
    errors are usually recoverable and normal path of
    execution can be easily restored.
    Hope this helps. I would be very interested to hear
    what others have to say.
    Ajith Kallambella. M
    Forte Systems Engineer,
    International Business Corporation.
    -----Original Message-----
    From: Mark Sundsten [mailto:[email protected]]
    Sent: Tuesday, December 29, 1998 2:10 PM
    To: [email protected]
    Cc: [email protected]
    Subject: Raising Exceptions vs returning error codes
    When dealing with error handling, I find myself struggling with the
    choice
    of
    raising exceptions (and handling them) from the caller
    vs returning an error code of somekind.
    When would you want to use one over the other?
    Should you always use exception handling?
    Any discussion would be appreciated.
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    Get Your Private, Free Email at http://www.hotmail.com
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>-
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Hi Steve !
    Probably the following explanation might help in resolving the issue raised by
    you:
    At a more abstract level, there is only one thing, i.e. the EVENT. According to
    it's definition, an event is a relatively infrequent occurrence in one portion (lets
    call it event raiser) of the application, which some other portion (or portions,
    lets call them event handlers) (of the same application) are interested to respond
    to it. Now there are two scenarios:
    (A) Event raiser and Event handler(s) are being executed under different threads
    of control (Asynchronous) and
    (B) Event raiser and Event Handler(s) are being executed under same thread of
    control (Synchronous).
    So, Exception Handling belongs to scenario B where the method raising the
    exception (Event Raiser or exception raiser) and the method handling it (Event
    Handler or exception block) are under the same thread of control. More ever it has
    to be insured that at a time only one handler (first the inner most one) receives
    the message.
    Fort&eacute; provides a generic Event handling mechanism (Post Event and Event Loop) to
    handle the scenario A (which is the more generic one). But it also provides a
    specialized Event Handling mechanism (Raise Exception and Exception block) to
    efficiently handle the relatively simple scenario B. Why I am saying that the later
    is efficient because it won't be needing to register the event queue address of the
    interested task (after all there is only one task involved) and put the event
    message in queue.
    Finally let me mentioned that it is just my view based on the understanding I
    have and it may not be true. Only a person from fort&eacute; can confirm it. I will really
    appreciate if somebody correct and or refine it.
    Wish a Very Very Happy New Year to all Fort&eacute; Users
    Regard,
    Kailash.
    [email protected] wrote:
    I would agree with Eric entirely. Exceptions seem to me to be a much more
    complete solution to the problem of error handling. A little bit of effort up
    front in making clear the strategy for exception handling and specifying the
    exceptions that can be raised by a class\method will provide an excellent method
    for error handling.
    In the case of ensuring exceptions are always handled, a top level handler for
    GenericException will usually do the job, allowing you to write error
    information out to logs, screen, etc, and then shut down gracefully.
    The only issue I would raise with exceptions is that they are not propagated
    outside an asynchronous task. If an exception is not handled within an
    asynchronous, it will not propagate to the task that started that asynchronous
    task. Forte provides return and exception events when starting asynchronous
    tasks to cope with this, but it seems a shame to have one method of dealing with
    errors (exceptions) for synchronous behaviour, and another (events) for
    asynchronous behaviour.
    Steve Elvin
    Systems Developer
    Frontline Ltd.
    UK
    Mark,
    The problem with return codes is that there is an underlying assumption
    that the receiver will always catch and interpret that error code. This
    may or may not be good thing, depending on how you architect your
    application. If, on the other hand, you want to ensure that an error is
    always handled, if not by the receiver then by the Forte, Exceptions are
    the way to go. To extend this mechanism further, I would subclass
    GenericException and created my own error code attribute on that
    subclass. That way the receiver has the choice of interpreting the
    exception based on that error code, and wrapping it in a
    MessageDialog/window or do the usual 'errormgr.showerrors()'.
    Exceptions seem a more flexible approach to me. That is, if you can live
    with the fact that by using it, you're violating the 'exceptions for
    behavioral anomalies' software engineering principle !
    Best wishes.
    Eric Pereira
    Forte Consultant
    ----Original Message Follows----
    From: "Kallambella, Ajith" <[email protected]>
    To: "'Mark Sundsten'" <[email protected]>, [email protected]
    Cc: [email protected]
    Subject: RE: Raising Exceptions Vs returning error codes
    Date: Wed, 30 Dec 1998 08:52:39 -0500
    Reply-To: "Kallambella, Ajith" <[email protected]>
    Mark,
    Identifying conditions where you would rather use an exception
    to an error_code ( and vice-versa ) normally depends on
    your application design. Usually exceptions
    are used to handle behavioral anomalies which are
    not expected during the normal course of execution of
    the program, and which would affect the continuity of
    your algorithm if ignored. Examples would be a fatal
    error, a semantically invalid( but syntactically-valid
    token ) etc.
    Error_codes and return status's can be used to handle
    anticipated and recoverable errors. Example would
    be presentation layer validations. In any normal
    UI system, the user is expected to make errors and it
    would be annoying to throw an exception( and to handle
    it ), every time user enters wrong data. A well
    modeled client layer should not only handle
    data-validation errors , but should be smart enough
    to encourage users to input correct or
    "near-correct" data. Examples could be
    making use of look-up windows etc. Interestingly,
    Express uses exceptions to handle data-validations.
    As you see, exceptions fit well into your processing
    logic where severity of damage caused by an error
    is more. Where as error_codes fit well into presentation
    logic( and some not-so-critical processing logic ) where
    errors are usually recoverable and normal path of
    execution can be easily restored.
    Hope this helps. I would be very interested to hear
    what others have to say.
    Ajith Kallambella. M
    Forte Systems Engineer,
    International Business Corporation.
    -----Original Message-----
    From: Mark Sundsten [mailto:[email protected]]
    Sent: Tuesday, December 29, 1998 2:10 PM
    To: [email protected]
    Cc: [email protected]
    Subject: Raising Exceptions vs returning error codes
    When dealing with error handling, I find myself struggling with the
    choice
    of
    raising exceptions (and handling them) from the caller
    vs returning an error code of somekind.
    When would you want to use one over the other?
    Should you always use exception handling?
    Any discussion would be appreciated.
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    Get Your Private, Free Email at http://www.hotmail.com
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>-
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • Access the adobe form data in the workflow container for further processin

    HI,
    I am using HCM processes and Forms. I need to access the form data in the workflow container once the workflow kicks off.
    I need to access these data as would need it for further processing in the workflow.
    I know that TS17900110 allows to import form conatiner to
    -> WF Container in the field name and value pair. But I need to access a lot more fields than what is in the task. Is there a standard task which allow to retrieve all the fields in the form in one task or do I need to develope a custom class to do that. If so could you please provide some clue as in how to code this specific requirement as i am somewhat new to OO ABAP.
    Thanks...

    hi,
    in the livecycle designer under libary tab u have webdynpro tab--->choose submit to sap button and place it in the adobe form ur designing. u can use this button to trigger the code that u have written in webdynpro java.
    for eg if u have
    a value node details
    and under that two value attr fname,lname
    import the model (Insertdata---it has two import param fname and lname)u need for updating the data to r3 system.
    in the ctrller have a method submit.Here write the code to insert fname and lname into the db.
    IPrivateMyForm.IDetailsElement elem = wdContext.nodeDetails().currentDetailsElement();
    Insertdata_Input input = new Insertdata_Input();
    wdContext.nodeInsertdata_Input().bind(input);
    input.setFname(elem.getFname());
    input.setLname(elem.getLname());
    try
    wdContext.currentInsertdata_InputElement().modelObject().execute();
    wdContext.nodeOutput().invalidate();
    catch (Exception ex)
    { ex.printStackTrace();}
    ul bind details to the datasource.
    when u edit ur interactive ui element these attr(fname and lname) vl be visible under dataview tab u can drag and drop them to the form
    now add submit to sap button in ur form.
    this button correspond to the onactionSubmit dat u have written in the ctrller.
    so wen u click this the data vl be inserted
    Regards
    Jay

  • Error in Raising exceptions in a method and handling the same in the WF

    Hi All
    I tried to implement Raising exceptions in a method and handling the same in the workflow
    in the same way given in SAPtechnical site .
    1.by adding a error msg in exception parameter .
    2. if the select query fails, to fetch the agent then :exit_return 9001 'ztable name' space space space.
    3.in the Background activity in which this method is called there automatically one outcome appears ,and I hav acitvated that outcome and in that done what need to be done for that error handling - just send a mail to concern person .
    4. in the normal outcome of the activity , the step to be executed are there .
    but its not working , if exception come then the WF stuck there only . it do not follow the exception outcome .
    Kindly help me , How can I do the exception handly in WF.
    thanks & Regards
    Kakoli

    > That is usually the case - you catch an error in the underlying program and pass that back so the workflow can go into error.
    > You're doing it correctly.
    I don't think that's quite right.
    If you define an error/exception in a method, it is automatically mapped to an outcome of the step/task.
    If you activate that outcome, then you can handle the exception in a branch of the workflow.
    For example: 'Remote connection is down, please contact Basis'
    The step should only go into error if an outcome occurs that you have NOT activated.
    So the original question is valid. Please give some more information on what the error message is..
    chrs
    Paul

  • Retrieve workflow container data in programming exit

    I am trying to use a programming exit in Workflow in order to amend the task container for the receipients field of a "Send Email" step. The reason why we are not determining the receipients in the usual way is because we hold the receipients (amongst other data) in a separate Z* table - this needs to stay this way.
    I created a class and copied method CHANGE_CONT_ELEMENT to base my altered code on. The method is triggered fine when testing the workflow. Here is what it now looks like:
    method CHANGE_CONT_ELEMENT .
      DATA: container TYPE REF TO if_swf_cnt_container,
            if_swf_cnt_container,
            cont TYPE REF TO IF_SWF_IFS_PARAMETER_CONTAINER,
            name TYPE swfdname,
            lh_wihandle TYPE REF TO if_swf_run_wim_internal,
            l_exception TYPE REF TO cx_swf_cnt_container,
            l_wiid TYPE sww_wiid,
            w_container type ref to IF_SWF_IFS_PARAMETER_CONTAINER,
            w_names type SWFDNAMTAB,
            wa_names type line of SWFDNAMTAB,
            w_value(30).
      w_container = me->m_ctx->GET_WI_CONTAINER( ).
      w_names = w_container->LIST_NAMES( ).
    data: w_name type SWFDNAME.
    w_name = 'TEST-NUMBER'.
    TRY.
      loop at w_names into wa_names.
        CALL METHOD w_container->get
         EXPORTING
          name       = wa_names.
      endloop.
    CATCH CX_SWF_CNT_ELEM_NOT_FOUND .
    CATCH CX_SWF_CNT_ELEM_TYPE_CONFLICT .
    CATCH CX_SWF_CNT_UNIT_TYPE_CONFLICT .
    CATCH CX_SWF_CNT_CONTAINER .
    ENDTRY.
    ENDMETHOD.
    Now w_names retrieves the names of the fields fine (including my "TEST" entry which I declared in the Workflow Builder), but the GET method causes a "CX_SWF_CNT_ELEM_NOT_FOUND" exception.
    Is this the correct way to retrieve data out of a Workflow container within a WF programming exit? What am I doing wrong?
    Kind regards,
    Michael Koch

    Hi Michael, Paolo & Other experts,
    I am trying to understand when, why and how to use a 'programming exit' in a SAP workflow.
    (1) Did you figure out the solution to your problem?
    (2) Is there any material / tutorial on use of a  'programming exit' in a workflow?
    Thanks
    Abaper

  • Passing multiline element to workflow container ? how do i ?

    Hello Folks,
    I need to pass an internal table to the workflow container...In this container i had already created an Multiline element which the right table type assigned..
    I need to call this Workflow using FM SAP_WAPI_START_WORKFLOW.... Eg:
    CALL FUNCTION 'SAP_WAPI_START_WORKFLOW'
      EXPORTING
       TASK                      = WFNAME
       LANGUAGE                  = SY-LANGU
       DO_COMMIT                 = 'X'
       USER                      = SY-UNAME
       START_ASYNCHRONOUS        = 'X'
      DESIRED_START_DATE        =
      DESIRED_START_TIME        =
      DESIRED_START_ZONLO       = SY-ZONLO
      IFS_XML_CONTAINER         =
      IMPORTING
       RETURN_CODE               = lv_return_code
       WORKITEM_ID               = lv_workitem_id
      NEW_STATUS               =
    TABLES
       INPUT_CONTAINER           = lt_container_wf
       MESSAGE_STRUCT            = lt_message_struct
       MESSAGE_LINES             = lt_msg_lines.
    lt_container_wf values should have an internal table to be passed a multiline element.....
    I am unble to pass it this way and the error i get is that " Single Line element  <XXXX> is being passed several times...
    How do i tell the system the the element which is passed is a mulitple element..
    Regards,
    Anand

    check this code snippet
    include <cntn01>.
    DATA:
          lv_retcode   TYPE  sysubrc,
          lt_cont   TYPE TABLE OF swcont,
          ls_cont   TYPE          swcont,
          lt_kna1   TYPE TABLE OF kna1,
          ls_kna1   TYPE kna1.
    SELECT * FROM kna1 INTO TABLE lt_kna1 UP TO 10 ROWS.
    swc_create_container lt_cont.
    swc_set_table lt_cont 'CUSTOMER' lt_kna1.
    CALL FUNCTION 'EWW_WORKFLOW_START'
      EXPORTING
        x_task                = 'WSXXXXXXXX'
    TABLES
       X_CONTAINER           = lt_cont
    EXCEPTIONS
       INVALID_TASK          = 1
       NO_ACTIVE_PLVAR       = 2
       START_FAILED          = 3
       GENERAL_ERROR         = 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.

  • Rule Result not returned back to Workflow container

    Hi ,
    We have a workflow where the approver for a Process is Manager of  any Orgunit .
    Now the manager is determined using a Rule with Category u201CFunction To be executedu201D .
    The Business requirement is so that If the immediate manager for any Orgunit is not maintained it will traverse through the entire Org structure unless the Manager is determined.  So the Level of the First approver could be of any value starting from 01.
    We also have Deadline  monitoring active .
    Incase the first approver  doesnu2019t act within 7 days  the Work item should go to the next level Manager ( second  approver ).
    The level of the second  approver depends on the level of the First approver .
    Example : If  the level of the First approver   is 3 then the level of the second approver  would be 4 or more.
                  : If  the level of the First approver   is 2 then the level of the second approver  would be 3 or more.
    Hence to achieve the Level dynamically we need to pass the Level of the first  approver  from the Rule to the Workflow  so that it can be used for determining  the next level manager in the next task.
    In the Function Module which determines the first approver  I have got the Value for the Level .
    I also have assigned that value to the Rule Container (_WI_RESULT , this is the only parameter which can be used for the Export )  using the Macro SWC_SET_ELEMENT  .
    I also have done the  binding from the Rule to the Workflow. But the value is not populated in the Workflow container .
    Could any one please help me  on solving this ??  Any other idea to achieve this is functionality is welcome too.
    Regards,
    Raka

    Hi  Arghadip,
    First of all thanks for the reply .
    We alreday have some logic  like this in place .
    But we want to imporve the system performance .
    We get the agent in one task from the Rule .
    Now again if we try to get the same agent in a method ,won't it be doing the same task twice.
    So we are trying to return the manager Counter value from the Rule container itself to the Workflow container so that it can be used to get the escalation manager.
    Regards,
    Raka

  • UDF to raise exception

    Hi,
    Can anyone help me in providing me the UDF / java code to raise exceptions and fail the mapping.
    I can do it by usinf string out of bound exception to fail the mapping ( which is one of the way).
    But i need to invoke the exception clause to throw the custom message.
    Can anyone please throw some light on this could be helpful..
    Thanks,
    Sneha

    Hi Sneha,
    public String throwexception(String input, Container container) throws StreamTransformationException{
    if(input.equals("ERROR"))
    throw new RuntimeException("Mapping fail");
    else
    return input;
    refer this
    Throwing Custom Exception in SXMB_MONI( Error Node)
    Also see,
    Throwing Smart Exceptions in XI Graphical Mapping
    /people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping
    XI/PI: Throwing Generic Exceptions from any type of Mapping
    /people/michal.krawczyk2/blog/2007/04/26/xipi-throwing-generic-exceptions-from-any-type-of-mapping

  • PASS DATA FROM ABAP PROGRAM TO WORKFLOW CONTAINER

    Hello Everybody,
    I am a workflow beginner and I want to pass a data from my ABAP code to a workflow container. This workflow container is used in the Send Mail step.
    The ABAP  Program is:
    REPORT  zdb_work_flow.
    tables : vbak.
    DATA : k TYPE sweinstcou-objkey,
                e TYPE swetypecou-event.
    DATA : st TYPE swcont,
                itab TYPE STANDARD TABLE OF swcont.
    PARAMETERS : vbeln TYPE vbak-vbeln.
    start-of-selection.
      st-element = 'VBELN'.   "This is my WORKFLOW CONTAINER
      st-tab_index = 1.
      st-elemlength = 10.
      st-type = 'C'.
      st-value = vbeln.
      append st to itab.
      k = vbeln.
      e = 'TRIGGER'               "This is an event in my BUS OBJ ZDB_WFLOW
      CALL FUNCTION 'SWE_EVENT_CREATE'
        EXPORTING
          objtype                               = 'ZDB_WFLOW'   "My BUS OBJ
          objkey                                 = k
          event                                  = e    "Event TRIGGER in ZDB_WFLOW
        tables
          event_container               = itab
        exceptions
          objtype_not_found             = 1
          OTHERS                        = 2
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.         .
      COMMIT WORK.
    Now I have created a workflow in SWDD as ZDB_WF_SW.
    In this WF I have created a container as VBELN.
    In the SEND MAIL I have given a header as "Worflow Triggered for &VBELN&"
    PROBLEM.
    The Workflow is getting triggered. I am also getting a mail "Workflow Triggered for" in my mailbox but the &VBELN& is missing from the header.
    I have set the IMPORT EXPORT flag of the WF CONTAINER "VBELN"
    Please Help.
    Edited by: Deepankar.B on Feb 22, 2011 4:08 PM
    Edited by: Deepankar.B on Feb 22, 2011 4:10 PM

    You wouldn't use a SMA as an assistance class - but refer to one within it.
    I would use Shared Memory Area classes - but I'd also build a SMA that could talk across multiple application servers.
    Thomas Jung proposed this in a forum reply some time ago.
    It shouldn't be too difficult to use RFC's to access the content of SMA's in multiple app servers - ensuring synchronisation across multi app servers. I've not yet had the need, so haven't attempted.
    The long polling in 7.02 apparently uses this approach, so in a 7.02 system there may even be standard components/ SMAs that you could use.
    I do not think global areas in FM's are available across sessions - I don't think you could use that as a data transport.

Maybe you are looking for

  • Broken in Logic 9?: Reindex loops from external drive

    Adding loops from an external drive in Logic 9 does not seem to work any longer. It used to work great in L8. Anyone have similar experiences? Know any work arounds? Is it a bug? If it's a bug I'll file it with Apple. Previously in Logic 8 it was eas

  • Problem while creating XDO Report with PL/SQL

    hi, i am trying to create 1.created XDO Report with the help of PL/SQL which takes two parameters and code for writing XML tags to output file 2.created concurrent program that will call the PL/SQL pkg here i am trying to create the xml out put bu t

  • Does anyone know how to lock a specific application, such as e-mail in Ipad?

    I have my company email in my Ipad and I want to lock it in order to prevent whoever uses my Ipad to login to my email. Does anyone know how to lock a specific application or it cannot be locked?

  • Help to buield program in Smarter way

    Hallow I have a interface program that I have to send a many(50) different structre but in all stuctre I have 6 fields that is requirement in all stuctre. I heard that I can do a strucre with the requirement fields and one field type char 255 that I

  • Extended Accounting - Configuration info

    Hi all, My understanding is that the file '/etc/acctadm.conf' is created / changed, whenever extended accounting is enabled / changed. I noticed that this file is not getting created when extended accounting is enabled. Also is there a function which