Writing an internal table to a WF container for an already triggerd WF from Web Dynpro

Adams, Andrew A. ANDREW.ADAMS at woodside.com.au
Sun Apr 15 21:43:30 EDT 2012


Ali

Just out of interest, from your original post, am I right in thinking you've referenced your workflow container to a DDIC table type? We have a number of Web Dynpro applications updating workflow tables without issue using the SAP_WAPI_WRITE_CONTAINER function.  However, in all instances the workflow table is defined as a multi-line element referencing a DDIC structure.

Regards
Andrew

-----Original Message-----
From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf Of sap-wug-request at mit.edu
Sent: Monday, 16 April 2012 12:17 AM
To: sap-wug at mit.edu
Subject: SAP-WUG Digest, Vol 89, Issue 11

Send SAP-WUG mailing list submissions to
        sap-wug at mit.edu

To subscribe or unsubscribe via the World Wide Web, visit
        http://mailman.mit.edu/mailman/listinfo/sap-wug
or, via email, send a message with subject or body 'help' to
        sap-wug-request at mit.edu

You can reach the person managing the list at
        sap-wug-owner at mit.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of SAP-WUG digest..."


Today's Topics:

   1. RE:  Writing an internal table to a WF container for an
      already   triggered WF From Web Dynpro (Mike Pokraka)
   2. Event not triggering (Srinivas Reddy)
   3. Re: Event not triggering (Rick Bakker)


----------------------------------------------------------------------

Message: 1
Date: Sat, 14 Apr 2012 21:42:22 +0100 (BST)
From: "Mike Pokraka" <wug at workflowconnections.com>
Subject: RE:  Writing an internal table to a WF container for an
        already         triggered WF From Web Dynpro
To: "SAP Workflow Users' Group" <sap-wug at mit.edu>
Message-ID:
        <ab0746b9ff45a889b5f7adeaea58b5a5.squirrel at g.mail.aaisp.net.uk>
Content-Type: text/plain;charset=iso-8859-1

Hi,

I think Margaret?s knowledge is well up to scratch, but I?ll ?weigh in?
anyway. As she explained the workflow is a separate process and should not
require meddling from outside. The event mechanism is perfect for this
purpose. This is also covered in the WF Book ? the WDA, WDJ and BSP
chapters (19-21) all describe different mechanisms that are to some degree
interchangeable.

Depending on how you launch the WebDynpro application, you may even have a
parameter SAPWFCBURL coming into your application. If so, you can use a
simple HTTP call to complete your work item and send data back to it
(although I must admit I haven?t explored whether it?s possible to
transfer tables). This is covered in more detail in the BSP chapter.

Regards,
Mike


On Sat, April 14, 2012 2:28 pm, Hilsbos, Margaret A wrote:
> Ali,
>
> I'm glad it worked for you.  To me it's very intuitive: the workflow has
> to wait for the data to be provided by someone taking another action (in
> other words, an 'event') so this is the approach that makes sense in the
> workflow worldview.   I wouldn't be surprised if there is a more
> straightforward approach from a data-oriented perspective.  But, I would
> tend to treat the workflow instance as a 'gated community' and expect to
> access the container only through specific, controlled routes. So I also
> wouldn't be surprised to find that it just isn't possible to write to the
> container from outside the workflow in the manner you're suggesting.
> (Thinking about it, if a program can write to the container at any point
> in the process, wouldn't that be a risk for unexpected situations to
> arise? You may 'know' that this webdynpro will only do its thing before a
> certain point in the workflow. But without a wait step, you can't ensure
> that the data arrives before it's needed, right?) Maybe someone else with
> more specific knowledge can weigh in on this question?
>
> But anyway, I'm glad you got it working!
>
> Margaret
>
> From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf
> Of Ali Husain
> Sent: Friday, April 13, 2012 5:22 PM
> To: SAP WUG
> Subject: RE: Writing an internal table to a WF container for an already
> triggered WF From Web Dynpro
>
> Hello Margaret,
>
> Yeah that's exactly the what i was trying to do which is to pass data from
> Web Dynpro to Workflow in the middle of the process. I was trying to avoid
> the FM SWE_EVENT_CREATE because i thought there should be a more intuitive
> way of passing an internal table to workflow. I've used the the method
> if_swf_cnt_element_access_1~element_get_value and I was able to read a
> structure so thought that if_swf_cnt_element_access_1~element_set_value
> should work for setting data as well. It didn't work for some reason. It
> could be that i'm missing something in the code i've pasted before.
> Someone has suggested that i convert the table into XML and do other
> conversions but that seems to be an overkill for something that i think
> should've been more straight forward to achieve. I did try the local event
> and it did work so i guess i'll stick with that for now.
>
> Thanks a lot for the suggestion.
> Ali
>
>
>> From: sap-wug-request at mit.edu<mailto:sap-wug-request at mit.edu>
>> Subject: SAP-WUG Digest, Vol 89, Issue 9
>> To: sap-wug at mit.edu<mailto:sap-wug at mit.edu>
>> Date: Fri, 13 Apr 2012 08:26:43 -0400
>>
>> Send SAP-WUG mailing list submissions to
>> sap-wug at mit.edu<mailto:sap-wug at mit.edu>
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>> http://mailman.mit.edu/mailman/listinfo/sap-wug
>> or, via email, send a message with subject or body 'help' to
>> sap-wug-request at mit.edu<mailto:sap-wug-request at mit.edu>
>>
>> You can reach the person managing the list at
>> sap-wug-owner at mit.edu<mailto:sap-wug-owner at mit.edu>
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of SAP-WUG digest..."
>>
>>
>> Today's Topics:
>>
>> 1. Writing an internal table to a WF container for an already
>> triggered WF From Web Dynpro (Ali Husain)
>> 2. RE: Writing an internal ta! ble to a WF container for an
>> already triggered WF From W eb Dynpro (Hilsbos, Margaret A)
>>
>>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Fri, 13 Apr 2012 02:29:00 +0300
>> From: Ali Husain <mr_mago40 at hotmail.com<mailto:mr_mago40 at hotmail.com>>
>> Subject: Writing an internal table to a WF container for an already
>> triggered WF From Web Dynpro
>> To: SAP WUG <sap-wug at mit.edu<mailto:sap-wug at mit.edu>>
>> Message-ID:
>> <BAY162-W33B950E7BD5BBECD174AD88F3A0 at phx.gbl<mailto:BAY162-W33B950E7BD5BBECD174AD88F3A0 at phx.gbl>>
>> Content-Type: text/plain; charset="windows-1256"
>>
>>
>>
>> Hello All,
>> I've post this question in the Workflow forum but because i'm trying to
>> work against the clock i'll post it here too.
>> I'm trying to write an internal table to a workflow container from Web
>> Dynpro by calling a function module. While searching for this topic,
>> most of the posts i found showed how to do it while raising the event
>> via the FM SWE_EVENT_CREATE. The event container for t! his fm is swcont
>> which is compatible with the macros. For example the following would
>> work:
>> INCLUDE <cntn01>.
>> swc_container lt_container. "Declaration
>> * swc_create_container lt_container. "Initialization - I don't think i
>> need in my case since the workflow has already been triggered
>> swc_set_table lt_container 'T_SAME_RSM' it_same_rsm.
>> * Calling SWE_EVENT_CREATE which has the type SWCONT for its event
>> parameter.
>> However, for my requirement the workflow has already been triggered and
>> i don't need to call that FM. So instead i tried completing the work
>> item using FM SAP_WAPI_WORKITEM_COMPLETE but that fm has the type
>> swr_cont for its container parameter which is not compatible with the
>> macros container type and hence it was dumping when i used it. Same
>> thing for the FM SAP_WAPI_WRITE_CONTAINER.
>> I tried transferring the values between the two different structures but
>> that only worked for a single cont! ainer element and not the table
>> type.
>> I also tried another app roach but the workflow container was not
>> updated even after including the commit work and wait statement:
>> ** CALL METHOD cl_swf_run_wim_factory=>find_by_wiid
>> ** EXPORTING
>> ** im_wiid = wd_comp_controller->gv_wf_id
>> ** RECEIVING
>> ** re_instance = lo_wi_handle.
>> ** Get the container
>> ** lo_cnt = lo_wi_handle->get_wi_container( ).
>> ** TRY.
>> ** lo_cnt->if_swf_cnt_element_access_1~element_set_value(
>> ** EXPORTING
>> ** name = 'T_SAME_RSM'
>> ** qname =
>> ** value = lt_same_rsm
>> ** unit =
>> ** IMPORTING
>> ** exception_return =
>> ** ).
>> ** CATCH cx_swf_cnt_cont_access_denied .
>> ** CATCH cx_swf_cnt_elem_not_found .
>> ** CATCH cx_swf_cnt_elem_access_denied .
>> ** CATCH! cx_swf_cnt_elem_type_conflict .
>> ** CATCH cx_swf_cnt_unit_type_conflict .
>> ** CATCH cx_swf_cnt_elem_def_invalid .
>> ** CATCH cx_swf_cnt_invalid_qname .
>> ** CATCH cx_swf_cnt_container .
>> ** ENDTRY.
>> Any help on how i would write a table type to the workflow container
>> when the workflow has already been triggered?
>> Thanks a lot for the help.
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL:
>> http://mailman.mit.edu/pipermail/sap-wug/attachments/20120413/658b5401/attachment-0001.htm
>>
>> ------------------------------
>>
>> Message: 2
>> Date: Fri, 13 Apr 2012 12:26:36 +0000
>> From: "Hilsbos, Margaret A"
>> <Margaret.Hilsbos at dayzim.com<mailto:Margaret.Hilsbos at dayzim.com>>
>> Subject: RE: Writing an internal table to a WF container for an
>> already triggered WF From Web Dynpro
>> To: "SAP Workflow Users' Group" <sap-wug at mit.!
>> edu<mailto:sap-wug at mit.!%20edu>>
>> Message-ID: <7CD2171329DDA3469582B61CC673B77D058311 40 at corpdag01>
>> Content-Type: text/plain; charset="us-ascii"
>>
>> Ali,
>>
>> Am I understanding your scenario? Sounds like:
>>
>>
>> 1. Something triggers a workflow
>>
>> 2. Later, something happens in a webdynpro that creates data that needs
>> to be supplied to the workflow instance that was triggered in step 1.
>>
>> If that's correct, I'd look at putting a 'wait for event' in the
>> workflow, then have the action in the webdynpro raise that event and
>> pass the data. I'm not sure if that would work - I haven't had to do
>> anything like that - but that's what I'd look at.
>>
>> Hope that helps,
>>
>> Margaret
>>
>>
>> From: sap-wug-bounces at mit.edu<mailto:sap-wug-bounces at mit.edu>
>> [mailto:sap-wug-bounces at mit.edu]<mailto:[mailto:sap-wug-bounces at mit.edu]>
>> On Behalf Of Ali Husain
>> Sent: Thursday, April 12, 2012 7:29 PM
>> To: SAP WUG
>> Subject: Writing an internal table to a WF container for an already
>> triggered WF Fro! m Web Dynpro
>>
>>
>> Hello All,
>>
>> I've post this question in the Workflow forum but because i'm trying to
>> work against the clock i'll post it here too.
>>
>> I'm trying to write an internal table to a workflow container from Web
>> Dynpro by calling a function module. While searching for this topic,
>> most of the posts i found showed how to do it while raising the event
>> via the FM SWE_EVENT_CREATE. The event container for this fm is swcont
>> which is compatible with the macros. For example the following would
>> work:
>>
>> INCLUDE <cntn01>.
>>
>> swc_container lt_container. "Declaration
>>
>> * swc_create_container lt_container. "Initialization - I don't think i
>> need in my case since the workflow has already been triggered
>>
>> swc_set_table lt_container! 'T_SAME_RSM' it_same_rsm.
>>
>> * Calling SWE_EVENT_CREATE which has the type SWCONT for its event
>> parameter.!
>>
>> However, for my requirement the workflow has already been triggered and
>> i don't need to call that FM. So instead i tried completing the work
>> item using FM SAP_WAPI_WORKITEM_COMPLETE but that fm has the type
>> swr_cont for its container parameter which is not compatible with the
>> macros container type and hence it was dumping when i used it. Same
>> thing for the FM SAP_WAPI_WRITE_CONTAINER.
>>
>> I tried transferring the values between the two different structures but
>> that only worked for a single container element and not the table type.
>>
>> I also tried another approach but the workflow container was not updated
>> even after including the commit work and wait statement:
>>
>> ** CALL METHOD cl_swf_run_wim_factory=>find_by_wiid
>>
>> **! EXPORTING
>>
>> ** &nbs p; im_wiid = wd_comp_controller->gv_wf_id
>>
>> ** RECEIVING
>>
>> ** re_instance = lo_wi_handle.
>>
>> ** Get the container
>>
>> ** ! lo_cnt = lo_wi_handle->get_wi_container( ).
>>
>> ** TRY.
>>
>> ** lo_cnt->if_swf_cnt_element_access_1~element_set_value(
>>
>> ** EXPORTING
>>
>> ** name = 'T_SAME_RSM'
>>
>> ** qname =
>>
>> ** value = lt_same_rsm
>>
>> ** unit ! =
>>
>> ** IMPORTING
>>
>> ** exception_return =
>>
>> ** ).
>>
>> ** CATCH cx_swf_cnt_cont_access_denied .
>>
>> ** CATCH cx_swf_cnt_elem_not_found .
>>
>> ** CATCH cx_swf_cnt_elem_access_denied .
>>
>> ** CATCH cx_swf_cnt_elem_type_conflict .
>>
>> ** CATCH cx_swf_cnt_unit_type_conflict .
>>
>> ** CATCH cx_swf_cnt_elem_def_invalid .
>>
>> ** CATCH cx_swf_cnt_invalid_qname .
>>
>> ** CATCH cx! _swf_cnt_container .
>>
>> ** ENDTRY.
>>
>> A ny help on how i! would write a table type to the workflow container
>> when the workflow has already been triggered?
>>
>> Thanks a lot for the help.
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL:
>> http://mailman.mit.edu/pipermail/sap-wug/attachments/20120413/4cbed4d0/attachment.htm
>>
>> ------------------------------
>>
>> _______________________________________________
>> SAP-WUG mailing list
>> SAP-WUG at mit.edu<mailto:SAP-WUG at mit.edu>
>> http://mailman.mit.edu/mailman/listinfo/sap-wug
>>
>>
>> End of SAP-WUG Digest, Vol 89, Issue 9
>> **************************************
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
>




------------------------------

Message: 2
Date: Sun, 15 Apr 2012 11:27:24 +0530
From: Srinivas Reddy <ootasrinivasreddy at gmail.com>
Subject: Event not triggering
To: "SAP Workflow Users' Group" <sap-wug at mit.edu>
Message-ID:
        <CAGu01YZP638gyR5Tdr9eJmDPgpcV6SEFrJ-RZ3T8n0auYAp=4Q at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi Experts,

I need to start a workflow when ever a meterial document  is posted with
the movement type 325 in the transaction MIGO_TR. I have used the CREATED
event of the standard business object BUS2017. Unfortunately the event has
not triggered. I have checked the event log and could not find any event
triggered and also no issues with the event linkage.What could be the
problem for not starting the workflow?? Please help me..

--
Thanks and Regards
Srini..
SAP Technical Consultant
+919963307464
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20120415/e3dd90cb/attachment-0001.htm

------------------------------

Message: 3
Date: Sun, 15 Apr 2012 16:03:33 +1000
From: Rick Bakker <rbakker at gmail.com>
Subject: Re: Event not triggering
To: "SAP Workflow Users' Group" <sap-wug at mit.edu>
Message-ID:
        <CAGSLasS82DHA5HP=DTRiuK=TvwoJgPZY5SaA2epLuPAsxvO7qw at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hello,

Make sure the event trace is turned on and has no filters (tx SWELS). If
there is no event then that is the problem, it has nothing really to do
with workflow. I'm not sure what configuration is necessary to get that
particular transaction to create an event. Any other events being created?

regards
Rick Bakker
hanabi technology

On Sun, Apr 15, 2012 at 3:57 PM, Srinivas Reddy <ootasrinivasreddy at gmail.com
> wrote:

> Hi Experts,
>
> I need to start a workflow when ever a meterial document  is posted with
> the movement type 325 in the transaction MIGO_TR. I have used the CREATED
> event of the standard business object BUS2017. Unfortunately the event has
> not triggered. I have checked the event log and could not find any event
> triggered and also no issues with the event linkage.What could be the
> problem for not starting the workflow?? Please help me..
>
> --
> Thanks and Regards
> Srini..
> SAP Technical Consultant
> +919963307464
>
>
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20120415/247cef92/attachment-0001.htm

------------------------------

_______________________________________________
SAP-WUG mailing list
SAP-WUG at mit.edu
http://mailman.mit.edu/mailman/listinfo/sap-wug


End of SAP-WUG Digest, Vol 89, Issue 11
***************************************

NOTICE: This email and any attachments are confidential. 
They may contain legally privileged information or 
copyright material. You must not read, copy, use or 
disclose them without authorisation. If you are not an 
intended recipient, please contact us at once by return 
email and then delete both messages and all attachments.




More information about the SAP-WUG mailing list