SAP-WUG Digest, Vol 50, Issue 71

Kris Verschueren kris.verschueren at ctac.nl
Mon Jan 26 10:56:19 EST 2009


Hi,
a while ago I had the same problem, not with a PDf but with an attachment.
With the code below it is possible to create an attachment in the background and to link it with a taskid. I hope this can help you.
 
*   Container for Text
    swc_container bo_sofm_container.
    swc_create_object bo_sofm 'SOFM' ''.
    refresh ta_attachments.
    loop at ta_mytable_new into wa_mytable.
      ta_attachments-line = wa_mytable.
      append ta_attachments.
    endloop.
*   Save text as Workflow attribute
    swc_set_table   bo_sofm_container 'DocumentContent' ta_attachments.
    swc_set_element bo_sofm_container 'NO_DIALOG' 'X'.
    swc_set_element bo_sofm_container 'Documenttype' 'RAW'.
    swc_set_element bo_sofm_container 'DOCUMENTTITLE' tp_doctitle.
    swc_call_method bo_sofm 'Create'   bo_sofm_container.
    swc_get_element bo_sofm_container '_Result' bo_sofm.
    swc_get_object_key bo_sofm tp_message_key.
*   Remove enqueue
    call method cl_swf_run_wim_factory=>suppress_enqueue
      EXPORTING
        im_wiid = tp_wi_id.
*   Create note
    CALL FUNCTION 'SWL_WI_NOTE_CREATE'
      EXPORTING
        WI_ID                         = tp_wi_id
        NOTE                          = tp_message_key
        I_SUPPRESS_ENQUEUE            = 'X'
      EXCEPTIONS
        ERROR_SETTING_NOTE_EXIST_FLAG = 1
        ERROR_NOTE_CREATION           = 2
        ERROR_CONTAINER_UPDATE        = 3
        CONTAINER_DOES_NOT_EXIST      = 4
        ERROR_IN_WI_ENQUEUE           = 5
        ILLEGAL_WI_STATE              = 6
        WI_HEADER_READ_FAILED         = 7
        OBJECT_CREATION_FAILED        = 8
        METHOD_CALLING_FAILED         = 9
        WI_BUFFER_REFRESH_FAILED      = 10
        USER_HAS_CANCELLED            = 11
        OTHERS                        = 12.
*   Recreate enqueue
    call method cl_swf_run_wim_factory=>reactivate_enqueue
      EXPORTING
        im_wiid = tp_wi_id.
 
Kind regadrs,
Kris Verschueren.

________________________________

Van: sap-wug-bounces at mit.edu namens sap-wug-request at mit.edu
Verzonden: za 24-1-2009 18:17
Aan: sap-wug at mit.edu
Onderwerp: SAP-WUG Digest, Vol 50, Issue 71



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: Attatching PDF File in background step (Andy Curtis)


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

Message: 1
Date: Sat, 24 Jan 2009 09:16:44 +0000
From: Andy Curtis <abcurtis at gmail.com>
Subject: Re: Attatching PDF File in background step
To: sap-wug at mit.edu
Message-ID:
        <14f090f00901240116ge47be34k21243702049c5fb at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Rick

Can't you just bind the pdf object to the Task as an Ad Hoc Object?

Andy

---------- Forwarded message ----------
From: "Sample, Rick" <Rick.Sample at graybar.com>
To: "SAP Workflow Users' Group" <sap-wug at mit.edu>
Date: Fri, 23 Jan 2009 11:42:43 -0600
Subject: Attatching PDF File in background step


>  I have a need to get a Trip PDF and attach it to a Task in a background
> step.
> I get the PDF just fine. I attach to a task in FORE GROUND just fine and
> dandy.
>
> Now, where I am stumped. How to attach in a background step.
> I obviously can not use GUI controls to achieve this, so anyone have an
> idea or three, or an example to reference?
>
> Thanks much!
>
> Rick Sample | Office (314) 573-5700 | rick.sample at graybar.com
> www.graybar.com - *Graybar Works to Your Advantage*
> **
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20090124/29b09448/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 50, Issue 71
***************************************


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 9209 bytes
Desc: not available
Url : http://mailman.mit.edu/pipermail/sap-wug/attachments/20090126/0a6719e6/attachment.bin


More information about the SAP-WUG mailing list