REPORT zpwtest .
DATA : lv_fname TYPE rs38l_fnam ,
lv_mail_recipient TYPE swotobjid ,
lv_mail_sender TYPE swotobjid ,
lv_control TYPE ssfctrlop ,
lv_name TYPE so_name ,
lv_output TYPE ssfcompop .
START-OF-SELECTION .
* Get fucntion module name of Smartform
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZPWTEST'
IMPORTING
fm_name = lv_fname.
* Create recepient object
*Check the User Type to send email to external address use
U - Internet address
lv_name = sy-uname .
CALL FUNCTION 'CREATE_RECIPIENT_OBJ_PPF'
EXPORTING
ip_mailaddr = lv_name "Recipient SAP user Name
ip_type_id = 'B' "SAP User Type
IMPORTING
ep_recipient_id = lv_mail_recipient
EXCEPTIONS
invalid_recipient = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
* Create Sender Object
CALL FUNCTION 'CREATE_SENDER_OBJECT_PPF'
IMPORTING
ep_sender_id = lv_mail_sender
EXCEPTIONS
invalid_sender = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
* Device will be MAIL
lv_control-device = 'MAIL' .
lv_output-tdtitle = 'Mail subject Line' .
CALL FUNCTION lv_fname
EXPORTING
control_parameters = lv_control
mail_recipient = lv_mail_recipient
mail_sender = lv_mail_sender
output_options = lv_output
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
List of All Blogs
-
►
2008
(39)
-
►
July
(9)
- Display ListBox in Parameter of Selection Screen
- Important EDI Transactions and Programs
- Hide F8 Button on Selection Screen
- Find Obsolete Function Module
- Sample RS_COVERPAGE_SELECTIONS
- SAP ABAP Dynamic Internal table and Processing 02
- SAP ABAP Dynamic Internal table and Processing 01
- Smartform/Sapscript Page Counter - Mode
- SAP SD Pricing Overview
-
►
June
(12)
- Transporting Table Entry
- Sample/Demo code availble in SAP
- SELECT-OPTION in Module Pool Screen
- Add your own pattern in SE38
- Call Transaction in New Window
- Minimum Code Required to Send SAP Mail
- Calculate Tax of Purchase order Line Item
- Send report as attachment in background
- Button on Selection-Screen
- Displaying Two ALV Grid on Screen
- Function Module for getting information of Diction...
- HR ABAP 02 - Getting Started - LDB PNP
-
►
July
(9)
Useful Links
Categories
Abap Objects
ALV List
Config
Dynamic
EDI
Excel
Formatting
HR ABAP
MD04
Module Pool
OLE Automation
Open Dialog Box
Quick Reference
Report
Sample Code
SAP ABAP
SAP FI
SAP Mail
SAP MM
SAP Notes
SAP SD
Sapscript
Selection-Screen
Smartforms
Standard Text
Translation
Tutorial
Upload Download
Utility
Web service
xml to ABAP
XSLT
You are most welcome to use any information available in this blog. Any usage of the information or sample code is at your own risk. I do take care of accuracy and relevance of blog before publishing. However, I do not guarantee that information and code are accurate and bug free, their can be alternate and better way of doing same thing so please use information as reference only. Relevance of code and instructions can possibly change with time, check the blog post date before using this information. This is my personal blog, recommendation and opinions expressed in this blog are mine and not of any company of any of my employer.
I do moderate comments and publish as soon as I check them. You can post questions as well, which I will try best to solve. I will anyway publish your questions in case others readers might have answer.
Thanks for coming here and reading the blogs :)
I do moderate comments and publish as soon as I check them. You can post questions as well, which I will try best to solve. I will anyway publish your questions in case others readers might have answer.
Thanks for coming here and reading the blogs :)
Saturday, September 19, 2009
Sending Smartform in SAP Inbox or external Mail
Labels:
Quick Reference,
SAP ABAP,
Smartforms
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment