How to access ad-hoc objects in class methods

Mike Pokraka wug.replies at workflowconnections.com
Wed Jan 18 05:13:16 EST 2006


Hi Jocelyn,
Nearly forgot... Yes I did find out some class(y) ways of doing it and
then some. Intresting stuff, a bit long to all post here right now, but
I'll see if I can put a blog together to 'share the love' as Mark is fond
of putting it.

The short of it is:
CL_WF_CONTAINER_WRAPPER is the class equivalent of all the container
macros, completely compatible and can be used in isolation (even in BO's)
- in fact it calls the same FM's as the SWC_* macros.

The more 'pure' class way (mostly nicked from some of the SAP_WAPI code),
and also "not for customer use" is using if_swf_run_wim_internal &
if_swf_cnt_container

Instantiate using:
        o_workitem  = cl_swf_run_wim_factory=>find_by_wiid( lv_wiid ).
        o_container = o_workitem->get_wi_container( ).

Convert to BOR:
        TRY.
            CALL METHOD
              O_CONTAINER->IF_SWF_CNT_CONVERSION~TO_BOR_CONTAINER
              IMPORTING
                VALUES = lt_cont.
          CATCH CX_SWF_CNT_ELEMENT .
        ENDTRY.

Cheers
Mike

Dart, Jocelyn wrote:
> Hi Mike,
> Yes the old business objects weren't all that strict about passing data
> around.  ABAP OO is much more
> rigorous.
>
> A quick option is to include the work item id as an (optional) parameter
> of your method, and if passed
> use it to call e.g. SAP_WAPI_READ_CONTAINER and etc.
>
> There are classes you can use to get the same info I believe but I
> haven't worked my way through
> them all yet.  If you can find a class/method way let me know and I'll
> document it.
>
> Regards,
> Jocelyn Dart
> Senior Consultant
> SAP Australia Pty Ltd.
> Level 1/168 Walker St.
> North Sydney
> NSW, 2060
> Australia
> T   +61 412 390 267
> M   + 61 412 390 267
> E   jocelyn.dart at sap.com
> http://www.sap.com
>
> The information contained in or attached to this electronic transmission
> is confidential and may be legally privileged. It is intended only for
> the person or entity to which it is addressed. If you are not the
> intended recipient, you are hereby notified that any distribution,
> copying, review, retransmission, dissemination or other use of this
> electronic transmission or the information contained in it is strictly
> prohibited. If you have received this electronic transmission in error,
> please immediately contact the sender to arrange for the return of the
> original documents.
> Electronic transmission cannot be guaranteed to be secure and
> accordingly, the sender does not accept liability for any such data
> corruption, interception, unauthorized amendment, viruses, delays or the
> consequences thereof.
> Any views expressed in this electronic transmission are those of the
> individual sender, except where the message states otherwise and the
> sender is authorized to state them to be the views of SAP AG or any of
> its subsidiaries. SAP AG, its subsidiaries, and their directors,
> officers and employees make no representation nor accept any liability
> for the accuracy or completeness of the views or information contained
> herein. Please be aware that the furnishing of any pricing information/
> business proposal herein is indicative only, is subject to change and
> shall not be construed as an offer or as constituting a binding
> agreement on the part of SAP AG or any of its subsidiaries to enter into
> any relationship, unless otherwise expressly stated.
>
>
> -----Original Message-----
> From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf
> Of Mike Pokraka
> Sent: Tuesday, 10 January 2006 11:10 PM
> To: sap-wug at mit.edu
> Subject: How to access ad-hoc objects in class methods
>
> G'Day folks,
> Simple question: How can one access Ad Hoc objects of a task in a
> class-based method?
>
> In traditional BOR methods, "SWC_GET_ELEMENT container
> <name-in-calling-workflow>..." does the trick, but class methods have no
> container. So where is it?
>
> Cheers
> Mike Pokraka
> Senior Consultant
> Workflow Connections Ltd.
> Mobile: +44 (0)7786 910 855
>
>
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
>
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
>
>




More information about the SAP-WUG mailing list