on 04-12-2010 8:23 AM
Hi All.
I have requirement of attaching a business object as link in a mail step. I am instantiating the Business Object before the mail step.
I want the instantiated Business Object as an attachment or, link in the Mail. Please provide me with your valuable inputs.
Thanks.
Solved, the issue by creating a BUsiness Object and instantiating it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nageshwara,
I have also similar requirement.
I have to send a Link in SendMail step of workflow. Once user will click it, it will call FB03 transaction with a document.
I have tried using BOR object and attached it to _Adhoc_Objects. But link is not coming in SBWP.
Please help.
Best Regards,
Manoj
Hi,
Do you want to attach the Business object name[EX : BUS2012] with in the mail??
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You have to use Function Module SWN_CREATE_SHORTCUT. Check the following links
http://wiki.sdn.sap.com/wiki/display/CRM/CRMWebUI-LaunchingtransactionsinGUIforWindows
http://wiki.sdn.sap.com/wiki/display/Snippets/CreatingaSAPshortcutforanytransactionandsendingitby+mail
Thanks
Arghadip
Hi Arghadip.
I have done as directed by you, sample code:
DATA : BEGIN OF zst_shortcut_par,
fieldname TYPE c LENGTH 60,
fieldvalue TYPE c LENGTH 255,
END OF zst_shortcut_par.
DATA: content TYPE string.
DATA: it_shortcut_param LIKE zst_shortcut_par OCCURS 0 WITH HEADER LINE.
DATA: doc_chng LIKE sodocchgi1.
DATA: tab_lines LIKE sy-tabix,
body_start LIKE sy-tabix.
DATA: it_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE.
DATA: it_objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
DATA: it_objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: it_reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
CLEAR it_shortcut_param.
REFRESH it_shortcut_param.
it_shortcut_param-fieldname = 'G_VBELN'.
it_shortcut_param-fieldvalue = '0000000035'. "Employee number
APPEND it_shortcut_param.
break innshi.
PERFORM zfm_create_shortcut
TABLES
it_shortcut_param
USING
'INNSHI'
'/DS1/SD_C_I129_PGI'
CHANGING
content.
PERFORM send_mail.
&----
*& Form zfm_create_shortcut
&----
FORM zfm_create_shortcut
TABLES
shortcut_param STRUCTURE zst_shortcut_par
USING
recipient_user_id TYPE syuname
transaction TYPE tcode
CHANGING
content TYPE string.
Declaration for shortcut content
DATA : parameter TYPE text255,
v_pernr(12) TYPE c.
DATA : v_tcode TYPE tcode.
Check if transaction code is available
CLEAR v_tcode.
SELECT SINGLE tcode FROM tstc
INTO v_tcode
WHERE tcode EQ transaction.
IF v_tcode IS INITIAL.
MESSAGE 'Enter a valid transaction' TYPE 'E' DISPLAY LIKE 'A'.
EXIT.
ENDIF.
Populate the parameters to be passed to the shortcut
IF NOT shortcut_param[] IS INITIAL.
CLEAR parameter.
LOOP AT shortcut_param.
CONCATENATE parameter shortcut_param-fieldname '='
shortcut_param-fieldvalue ';'
INTO parameter.
ENDLOOP.
ENDIF.
*CLEAR it_reclist.
*it_reclist-receiver = 'INNSHI'.
*it_reclist-rec_type = 'B'.
*APPEND it_reclist.
create the shortcut content for the required transaction
CALL FUNCTION 'SWN_CREATE_SHORTCUT'
EXPORTING
i_transaction = transaction
i_parameter = parameter
i_sysid = sy-sysid
i_client = sy-mandt
i_user = recipient_user_id
i_language = sy-langu
i_windowsize = 'Normal window'
IMPORTING
shortcut_string = content
EXCEPTIONS
inconsistent_parameters = 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.
ENDFORM. "zfm_create_shortcut
&----
*& Form SEND_MAIL
&----
text
----
--> p1 text
<-- p2 text
----
FORM send_mail .
Mail Subject
doc_chng-obj_descr = 'PGI Error Mail'.
Mail Contents
CONCATENATE ' The requested change has been made to your temporary address.'
' Please double click on the attachment and choose display to view the updated address'
INTO it_objtxt.
APPEND it_objtxt.
Creation of the entry for the document
DESCRIBE TABLE it_objtxt LINES tab_lines.
CLEAR it_objpack-transf_bin.
it_objpack-head_start = 1.
it_objpack-head_num = 0.
it_objpack-body_start = 1.
it_objpack-body_num = tab_lines.
it_objpack-doc_type = 'RAW'.
APPEND it_objpack.
Populate attachment content
CLEAR : tab_lines, it_objbin.
CONCATENATE content it_objbin-line INTO it_objbin-line.
APPEND it_objbin.
DESCRIBE TABLE it_objbin LINES tab_lines.
Creation of the entry for the compressed attachment
it_objpack-transf_bin = 'X'. "Will get content from content_bin
it_objpack-head_start = 1.
it_objpack-head_num = 1.
it_objpack-body_start = 1.
it_objpack-body_num = tab_lines.
it_objpack-doc_type = 'RAW'.
it_objpack-obj_name = 'PGI ERROR MAIL'.
it_objpack-obj_descr = 'PGI_ERROR REPORT'.
it_objpack-doc_size = tab_lines * 255.
APPEND it_objpack.
target recipent(s)
CLEAR it_reclist.
it_reclist-receiver = 'INNSHI'.
it_reclist-rec_type = 'B'.
APPEND it_reclist.
Sending the document to recipients with the shortcut attachment
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = doc_chng
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = it_objpack
contents_bin = it_objbin
contents_txt = it_objtxt
receivers = it_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
OTHERS = 99.
ENDFORM. " SEND_MAIL
it is sending a mail and getting an attachment, when opening it sometimes gives bin error. it_objpack-doc_type = 'OBJ'.
And when document type selected as 'OBJ' gives error 'ASC'.
Please Advice...
Hi Arghadip.
I could create a hyper for the transaction, this i have done, as i could not get my object as link in the mail. I have created a transaction for my report and created a hyperlink in the mail. Now the problem with Passing parameter for the transaction. I am unable to pass the parameters. I would like to show the user with the reported executed, result of the report when he clicks on the hyperlink. Could u please advise.
Thanks
LVN Sharma
Hi
Lets say your report is Ztest and has certain parameters on the screen.
Creating a variant and then assigning the report and the variant to T.Code Ztest_wfl.
<A HREF="sap-object://CUST_TRAN ZTEST_WFL"> Call Transaction ZTEST_WFL</A>
With this when you execute the transaction from the mail the selection screen with variant values comes up.
Now point is that these values have to be changed for every instance.So using dynamic variants from STVARV and then modifying their values from workflow itself may help.
Thanks and Regards
aman
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.