on 11-15-2012 4:18 PM
Hi Experts,
I have a requirement to attach the PDF to the email sent to workflow initiator in outlook mail after approval or rejection which I am able to do that.
There is a option to provide any comment during approval and these comment also stored as attachment. So now in the email I can see both the attachment. I am using SAP_WAPI_ATTACHMENT_ADD inside a class method to attach this PDF. Now as I saw that all the attachment will be available for subsequent workitem or the activity. I am not able to separate these attachment. Can any one help me to get only PDF attachment to the Email.
Regards,
Chandrashekhar
Hi,
Simpler solution will be to use two different custom container elements for attachments. OBJECT TYPE SOFM.
During binding bind to separate container elements.
Based on your conditions then use any of the container elements.
Thanks,
Anubhav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anubhav,
Thanks for response. I tried the below code to create the SOFM object in task container. But somehow its not creating. Just to let you know I am using the Class method for below
DATA: lt_return TYPE bapirettab,
lv_pdf_form TYPE fpcontent,
lv_subrc TYPE sy-subrc,
lt_msg TYPE STANDARD TABLE OF swr_messag,
lt_str TYPE STANDARD TABLE OF swr_mstruc,
l_wa_header TYPE swr_att_header,
lt_container TYPE STANDARD TABLE OF swcont,
lv_sofm TYPE swr_att_id.
*--Get PDF Attachment data for TA form
CALL FUNCTION 'PTRM_WEB_FORM_PDF_GET'
EXPORTING
i_employeenumber = im_pernr
i_tripnumber = im_reinr
i_language = co_langu_en
IMPORTING
e_pdf_form = lv_pdf_form
TABLES
et_return = lt_return.
*--Update the attachment Header information
l_wa_header-file_type = co_file_type_b.
l_wa_header-file_extension = co_file_ext_pdf.
l_wa_header-file_name = im_reinr.
l_wa_header-language = im_langu.
*--Create Workflow Attachment
CALL FUNCTION 'SAP_WAPI_ATTACHMENT_ADD'
EXPORTING
workitem_id = im_workitemid
att_header = l_wa_header
att_bin = lv_pdf_form
language = im_langu
IMPORTING
return_code = lv_subrc
att_id = lv_sofm
TABLES
message_lines = lt_msg
message_struct = lt_str.
swc_container container.
swc_create_container container.
swc_set_element container 'SOFM' lv_sofm.
swc_set_element container 'SOFM' lv_sofm-doc_id.
Hi,
1. Use SWC0 instead of SWC. Declare this as a TYPE GROUP in "Properties" tab of your class.
2. In CALL FUNCTION 'SAP_WAPI_ATTACHMENT_ADD' put do_commit = 'X'.
3. Directly use macro swc0_create_object e_attachment lv_objsofm lv_objtkey. No need to use last four lines of code you have written.
Let me know if this worked.
Thanks,
Anubhav
Hi anubhav while trying this its throwoing an error stating that lcl_SWC is unknown. Not sure what I am doing wrong. I had added the SWC0 in type group in properties tab. The Objecttype is the SOFM and then its key. But what is the expected type decalrtion of the e_attachment and how this is used.
Hi,
So you are expecting out of two entries only the first entry in the container element _Attach_objects must be assigned to the decision step.
If you are sure that first entry is always the PDF attachment and the second entry is always comment then pass/ define the binding between WF container and task container as below:
Workflow Container -> Task Container
_Attach_objects[1] -> _Attach_objects
Regards
Pavan
Message was edited by: Pavan Bhamidipati
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
9 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.