cancel
Showing results for 
Search instead for 
Did you mean: 

How to email a smartform?

Former Member
0 Kudos

In the form interface of my form, I am passing the recipients email in MAIL_RECIPIENT and the current user's email in the MAIL_SENDER parameters. I need my form to be emailed once its processed. During runtime it gives errors. Does anyone have any experience in sending a smartform via email?

Also has anyone tried dynamically to show JPG files in the smartforms. I entered a fieldname using &, in the Graphics window but it gives compile errors. This field is filled in the program.

<MOVED BY MODERATOR TO THE CORRECT FORUM>

Edited by: Alvaro Tejada Galindo on Dec 26, 2008 11:15 AM

Accepted Solutions (0)

Answers (14)

Answers (14)

Former Member
0 Kudos

Dear Kshitij

Please check below link you will Definitely your Solution

0 Kudos

Hi Mohit,

             I tried the code what you had attached but I am getting error as

"OTF end command // missing in OTF data".

Could you please help me in this regard.

When I checked in transaction sost it is giving blank pdf.

Suppose if I want to add the image from my pc with a path like 'c:/documents and setting' etc how can I specify for the graphics part.

My code is

REPORT zprogram66_10.

INCLUDE <cntn01>.

*  DECLARATION SECTION

START-OF-SELECTION.

* My Smartforms.

  MOVE 'ZMY_SMARTFORMS' TO w_formname.

  CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

    EXPORTING

      formname                 =  'ZSMARTFORM99'

*     VARIANT                  = ' '

*     DIRECT_CALL              = ' '

   IMPORTING

   fm_name                  = w_funcname

   EXCEPTIONS

     no_form                  = 1

     no_function_module       = 2

     OTHERS                   = 3

            .

  IF sy-subrc <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

  ENDIF.

  MOVE : 'X'        TO is_control_param-no_dialog ,

           ' '        TO is_control_param-preview ,

           'X'        TO is_control_param-getotf ,

           sy-langu   TO is_control_param-langu ,

           'PRINTER'  TO is_control_param-device ,

           'X'        TO is_composer_param-tdnoprint ,

           'X'        TO is_composer_param-tdnoprev ,

           'X'        TO is_composer_param-tdfinal ,

           'X'        TO is_composer_param-xdfcmode ,

           ' '        TO is_composer_param-xdf ,

           'X'        TO is_composer_param-xsfcmode ,

           'X'        TO is_composer_param-xsf ,

           ' '        TO is_composer_param-xsfoutdev ,

           'A'        TO is_composer_param-xsfoutmode ,

           'X'        TO is_composer_param-xsfformat ,

           'My Mail'  TO is_composer_param-tdtitle.

* For the Graphics

  MOVE : 'GRAPHICS'           TO is_xfsparam-name ,

         'EXTRACT'            TO is_xfsparam-value.

  APPEND is_xfsparam TO is_composer_param-xsfpars.

  MOVE : 'GRAPHICS-DIRECTORY' TO is_xfsparam-name ,

         'MyDirY'           TO is_xfsparam-value.

  APPEND is_xfsparam TO is_composer_param-xsfpars.

  MOVE : 'CONTENT-ID'         TO is_xfsparam-name ,

         'ENABLE'             TO is_xfsparam-value.

  APPEND is_xfsparam TO is_composer_param-xsfpars.

* Conversion du HTML Hex en Text.

   LOOP AT is_job_info-xmloutput-trfresult-content

        INTO is_html_raw.

     CONCATENATE w_html_xtxt

                 is_html_raw

                 INTO w_html_xtxt

                 IN BYTE MODE.

   ENDLOOP.

   w_html_xtxt = w_html_xtxt(is_job_info-xmloutput-trfresult-length).

   CALL FUNCTION 'SCP_TRANSLATE_CHARS'

     EXPORTING

       inbuff       = w_html_xtxt

       incode       = '4110'

       outcode      = '0000'

       csubst       = 'X'

       substc_space = 'X'

     IMPORTING

       outbuff      = w_html_txt

       outused      = w_html_len

     EXCEPTIONS

       OTHERS       = 5.

   REPLACE ALL OCCURRENCES OF 'utf-8' IN w_html_txt WITH 'latin1'.

    w_html_len = strlen( w_html_txt ).

* Creation objet pour mail.

   CREATE OBJECT obj_mime_helper.

* Récupère les graphiques.

   it_graphics = is_job_info-xmloutput-xsfgr[].

   LOOP AT it_graphics

        INTO is_graphic.

     CLEAR w_gr_xtxt.

     LOOP AT is_graphic-content

          INTO is_gr_raw.

       CONCATENATE w_gr_xtxt

                   is_gr_raw-line

                   INTO w_gr_xtxt

                   IN BYTE MODE.

     ENDLOOP.

     w_gr_xtxt = w_gr_xtxt(is_graphic-length).

     w_offset = 0.

     w_len    = 255.

     CLEAR it_solix[].

     WHILE w_offset < is_graphic-length.

       w_diff = is_graphic-length - w_offset.

       IF w_diff > w_len.

         is_solix-line = w_gr_xtxt+w_offset(w_len).

       ELSE.

         is_solix-line = w_gr_xtxt+w_offset(w_diff).

       ENDIF.

       APPEND is_solix TO it_solix.

       ADD w_len TO w_offset.

     ENDWHILE.

     CONCATENATE 'MyDir'

                 is_graphic-graphics

                 '.bmp'

                 INTO w_file.

     CONCATENATE 'MyDir'

                 is_graphic-graphics

                 '.bmp'

                 INTO w_content_id.

     w_content_type = is_graphic-httptype.

     w_obj_len      = is_graphic-length.

     CALL METHOD obj_mime_helper->add_binary_part

       EXPORTING

         content      = it_solix

         filename     = w_file

         extension    = 'BMP'

         description  = 'Graphic in BMP format'

         content_type = w_content_type

         length       = w_obj_len

         content_id   = w_content_id2.

   ENDLOOP.

   w_offset = 0.

   w_len    = 255.

   WHILE w_offset < w_html_len.

     w_diff = w_html_len - w_offset.

     IF w_diff > w_len.

       is_soli-line = w_html_txt+w_offset(w_len).

     ELSE.

       is_soli-line = w_html_txt+w_offset(w_diff).

     ENDIF.

     APPEND is_soli TO it_soli.

     ADD w_len TO w_offset.

   ENDWHILE.

* Ajoute le corps.

   CALL METHOD obj_mime_helper->set_main_html

     EXPORTING

       content     = it_soli

       filename    = ''

       description = 'My mail'.

* Ajoute le titre

   MOVE is_composer_param-tdtitle TO w_title.

   obj_doc_bcs = cl_document_bcs=>create_from_multirelated(

                   i_subject          = w_title

                   i_importance       = '9'                " 1 / 5 / 9

                   i_multirel_service = obj_mime_helper ).

   CALL METHOD obj_doc_bcs->get_docno

     RECEIVING

       result = w_docno.

   obj_bcs = cl_bcs=>create_persistent( ).

   obj_bcs->set_document( i_document = obj_doc_bcs ).

*---------------------------------------------------------------------*

*   Create the attachment.                                            *

*---------------------------------------------------------------------*

* Call the Smartforms

  CALL FUNCTION w_funcname

    EXPORTING

*     ARCHIVE_INDEX              =

*     ARCHIVE_INDEX_TAB          =

*     ARCHIVE_PARAMETERS         =

control_parameters         = is_control_param

      mail_appl_obj              = is_mailobj

      mail_recipient             = is_recipient

      mail_sender                = is_sender

*     MAIL_APPL_OBJ              =

*     MAIL_RECIPIENT             =

*     MAIL_SENDER                =

invoice  = p

output_options             = is_composer_param

      user_settings              = ' '

*   IMPORTING

*     DOCUMENT_OUTPUT_INFO       =

job_output_info            =  is_job_info

*JOB_OUTPUT_OPTIONS         =

TABLES

itab = itab

    EXCEPTIONS

      formatting_error           = 1

      internal_error             = 2

      send_error                 = 3

      user_canceled              = 4

      OTHERS                    = 5.

  break fgi.

** Convert the OTF to PDF.

   CALL FUNCTION 'CONVERT_OTF_2_PDF'

     IMPORTING

       bin_filesize   = w_doc_size

     TABLES

       otf            = is_job_info-otfdata

       doctab_archive = it_docs

       lines          = it_tline

     EXCEPTIONS

       OTHERS         = 3.

   CLEAR w_gr_xtxt.

   CREATE OBJECT obj_conv.

* Change the output format.

   LOOP AT it_tline

        INTO is_tline.

     CALL METHOD obj_conv->convert

       EXPORTING

         inbuff    = is_tline

         outbufflg = 2500

       IMPORTING

         outbuff   = w_xtxt.

     CONCATENATE w_gr_xtxt

                 w_xtxt

                 INTO w_gr_xtxt

                 IN BYTE MODE.

   ENDLOOP.

   w_gr_xtxt = w_gr_xtxt(w_doc_size).

   w_offset = 0.

   w_len    = 255.

   CLEAR it_solix[].

   WHILE w_offset < w_doc_size.

     w_diff = w_doc_size - w_offset.

     IF w_diff > w_len.

       is_solix-line = w_gr_xtxt+w_offset(w_len).

     ELSE.

       is_solix-line = w_gr_xtxt+w_offset(w_diff).

     ENDIF.

     APPEND is_solix TO it_solix.

     ADD w_len TO w_offset.

   ENDWHILE.

   MOVE : 'Attachment'     TO w_title ,

          'Attachment.pdf' TO w_content_id.

   w_content_type = '  '.

   w_obj_len      = w_doc_size.

* Add as attachment the PDF

   CALL METHOD obj_doc_bcs->add_attachment

     EXPORTING

       i_attachment_type    = 'PDF'

       i_attachment_subject = w_content_id

       i_attachment_size    = w_obj_len

       i_att_content_hex    = it_solix.

* add the email address.

   obj_recipient = cl_cam_address_bcs=>create_internet_address(

                     i_address_string =  'zzzz@gmail.com' ).

   obj_bcs->add_recipient( i_recipient = obj_recipient ).

* Statut change

   MOVE 'N' TO w_status.

   CALL METHOD obj_bcs->set_status_attributes

     EXPORTING

       i_requested_status = w_status.

* Send the mail.

   obj_bcs->send( ).

* Commit Work.

   IF sy-subrc EQ space.

     COMMIT WORK AND WAIT.

   ELSE.

     ROLLBACK WORK.

   ENDIF.

END-OF-SELECTION.

Thank You.

Florian
Active Contributor
0 Kudos

Hi Moulika,

of course you need a smartform delivered before trying it

START-OF-SELECTION.

* My Smartforms.

  MOVE 'ZMY_SMARTFORMS' TO w_formname.

  CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

    EXPORTING

      formname                 =  'ZSMARTFORM99' <--- This one needs to replaced!!

*     VARIANT                  = ' '

*     DIRECT_CALL              = ' '

   IMPORTING

   fm_name                  = w_funcname

.

But this is a very basic, so please work through the official help provided by SAP, there are also a lot examples included. Also Send Smartforms per Mail.

Here is the link:

Introduction - SAP Smart Forms (BC-SRV-SSF) - SAP Library

~Florian

0 Kudos

Hi,

     I already created the zsmartform99 in smartforms transaction and I think I need to change  the line

My Smartforms.

  MOVE 'ZMY_SMARTFORMS' TO w_formname.

to

My Smartforms.

  MOVE 'zsmartform99' TO w_formname.

and I am getting error that mail is not sending to mailid I had specified.


Thank You

Florian
Active Contributor
0 Kudos

Hi Moulika,

check at this line, if you really got the table filled with data to convert. If not, you have to check the smartforms error.

** Convert the OTF to PDF.

   CALL FUNCTION 'CONVERT_OTF_2_PDF'

These you can easiliy check by using transaction Smartform_trace (perhaps its smartforms_trace, I don't know yet exactly)

Did you set a breakpoint at the message raising yet? That would be very helpful to find the issue.

And please, share your error-message (class + Message) with us. It is really hard to suggest things by just having a few infos.

~Florian

Former Member
0 Kudos

Firstly, Olaf many thanks for your example. I have this working with minimum extra effort.

However, I have one unresolved issue - in the smartform there is a graphic (logo) and this is not being emailed - the received email has white space where the logo should appear. Does anybody have any ideas about this?

Former Member
0 Kudos

First, I will thank Oaf's suggest and help for mail function~

Then, The original post have a question for dynamically to show JPG files in the smartforms.

To this, you can set condition in your node, for example: Graphics Node.

In every node in smartforms, it contain a slice "Condition", in there, you can set the condition which you want to show this node.

for example: if the graphic is jack's sign-name, and jack's sap id is SAP_JACK,

you can set the graphics's condition as : sy-uname = 'SAP_JACK'.

So, only when SAP_JACK login and execute the smartform, the graphic will show out, otherwise will not show~

May it can help you~

Former Member
0 Kudos

hi all,

i am sending shipment details smartform via email through standard transaction.the moment when i configure output type in VT02N,with dispatch time 4(immediatly print)it is throwing error 'update was terminated'.

i have checked in OSS note for the above error.

Note 86147 -

but my requirement is not to set the printer, it should go mail directly,can anyone tell me about how to delete default printer setting from smartform

Former Member
0 Kudos

Hi Everybody,

I have used the code in my driver program suggested by Olaf. But I am facing a little problem. When I am starting the send process in scot I am receiving a mail in my workplace mail box with the following message-

The following status was received for the document <New Purchase Order Printout> sent by you to the recipient <REMOVED BY MODERATOR - DON'T WRITE DOWN E-MAILS>:

<Cannot process message in SAP System>.

Can any body help me???

Edited by: Alvaro Tejada Galindo on Dec 26, 2008 11:15 AM

Former Member
0 Kudos

Hello people,

thank i advance for this posts, i have implemented in my system and works very well, but i have a question, can i use a distribution list for the recepient?

Thanks

AOL

Former Member
0 Kudos

Hi all,

I also would like to send a smartform via email, I changed my code based on Olaf's example, got no error, just a

"MAIL request 00000000000xx created successfully"

message. (xx -> an increasing number)

And nothing happens.

I checked the TA SCOT to see any mail movement/error occurs or not. But there is neither error, nor successfully mail send.

What could be the problem?

Former Member
0 Kudos

Hi Peter,

you need to run the program RSCONN01 with variant INT.

Best way is to make it as periodic job.

You could check your outgoing E-mails via TA SOST (if you got the authoritiy)

Hope it works

Olaf

Former Member
0 Kudos

Hi All,

I am able to get mail in SAP Inbox (IP type ID B)with Smartform body but when I use external mail (IP type ID U), User gets e-mail to company mail Id but not smartform attachment - form is missing.

I would appreciate any help.

Thanks in advance.

-Bharat

Former Member
0 Kudos

Hi All,

I am able to get mail in SAP Inbox (IP type ID B)with Smartform body but when I use external mail (IP type ID U), User gets e-mail to company mail Id with smartform body <<Smart Forms.OTF>> . We are not able to open this OTF file.

I would appreciate any help.

Thanks in advance.

-Bharat

Former Member
0 Kudos

Bharat,

Check out your SAPConnect configuration (transaction SCOT). You need to specify which document extensions you want to send to your partners. You currently have .OTF (SAP internal SAPScript format) enabled so SAP wont do the conversion.

The config is slightly different between 4.6 and 4.7 (at first glance, it seems they have stripped some of the functionality in 4.7 to make it simpler) but essentially you need to choose the document type you wish to send to your partners according to the SAP document (Smartform, ABAP list, etc.).

This thread is starting to get a bit long, can I suggest that if you have further questions that you start a new one.

Cheers,

Brad

Message was edited by: Brad Williams

Former Member
0 Kudos

Hi Brad,

Thanks for your help. I am on SAP 4.6C. What's document type for Smartform? I don't see document type with Smartform description in table TOAVE.

Appreciate your help.

-Bharat

Former Member
0 Kudos

Bharat,

Smartforms are the same as a SAPScript - OTF.

If you have any further questions please kick off a new thread.

Brad

Former Member
0 Kudos

That was a typo on my part, I did try a 'C' and it doesn't work. Any other suggestions on how I can use this for a distribution list would be appreciated.

Former Member
0 Kudos

I forgot to mention that under call function 'CREATE_RECIPIENT_OBJ_PPF', I tried entering the distribution list under IP_MAILADDR and 'S' under IP_TYPE_ID, but this did not seem to work.

Former Member
0 Kudos

well I've never used a distribution list in this context but you may better use 'C' for general distribution list or 'P' for personal distribution list because I can't find any 'S' for IP_TYPE_ID in the value range of that domain.

Former Member
0 Kudos

I've got it working now - thanks for your help! One last question. I have already defined distribution lists in SAP. Is there somewhere that I can enter the distirbution list name to send the e-mail to rather than the individual e-mail addresses?

Former Member
0 Kudos

Is this in 4.6C? If not does anybody have any hints for me on how to email a smartform in 4.6C?

Former Member
0 Kudos

Sure!

greets Olaf

Former Member
0 Kudos

I can't get declaration

DATA: FOLDER TYPE SWC_OBJECT

to syntax check. "SWC_OBJECT is unknown" Which makes me think we are on different versions. I comment it out and everything else seems to be okay. Any help is greatly appreciated.

Thanks,

Mike

Former Member
0 Kudos

you have to add an Include at the beginning of the program to avoid an error in the syntax check:

<b>include <cntn01>.</b>

Your right it works without to declare the application object and passing it to the smartform.

At the moment I can't give you an explanation why.

Greets

Olaf

Former Member
0 Kudos

I am still missing something. I get the message "No address exists Message no. SO 666" in CALL FUNCTION 'CREATE_RECIPIENT_OBJ_PPF'. I'm thinking that in my smart form I need to have some sort of address defined, but I can't figure it out. Thanks in advance for your help.

Former Member
0 Kudos

Do you want to mail to a sap-user or to an external internet mail address?

- For sap-user as recipient you will have to change the

parameter for <b>ip_type_id</b> of the

function 'CREATE_RECIPIENT_OBJ_PPF' to either <b>B

</b> or <b>O</b>.

- the internet mail address has to be in complete form like name@company.com, in variable g_mail (as in my coding snippet)

kmoore007
Active Contributor
0 Kudos

I would also like to see some example code of how to email a smartform using the function generated by smartforms.

Former Member
0 Kudos

Hi,

well I try to explain what you need to mail a smartform.

Here is a part of the function call:


...
          g_cont_par-device = 'MAIL'.

* Get BOR-Objects for Recipient, Sender und Applikation 
          PERFORM mail_recipient_object CHANGING g_mail_rec_obj.
          PERFORM mail_sender_object    CHANGING g_mail_sen_obj.
          PERFORM mail_appl_object      CHANGING g_mail_app_obj.

* Calling Smartform 
          CALL FUNCTION fm_name
          EXPORTING
*   ARCHIVE_INDEX              =
*   ARCHIVE_INDEX_TAB          =
*   ARCHIVE_PARAMETERS         =
             control_parameters         = g_cont_par
             mail_appl_obj              = g_mail_app_obj
             mail_recipient             = g_mail_rec_obj
             mail_sender                = g_mail_sen_obj
             output_options             = g_output
             user_settings              = ' '

           IMPORTING

... rest of function  ...
Here are the Forms:
*&---------------------------------------------------------------------*
*&      Form  mail_recipient_object
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      <--P_G_MAIL_REC_OBJ  text
*----------------------------------------------------------------------*
FORM mail_recipient_object  CHANGING p_mail_rec_obj.
  CALL FUNCTION 'CREATE_RECIPIENT_OBJ_PPF'
   EXPORTING
*   IP_COUNTRY              =
*   IP_FAXNO                =
      ip_mailaddr             = g_mail "g_mail type 
                                       "SO_NAME.
      ip_type_id              = g_rectype " 'U'
    IMPORTING
      ep_recipient_id         = p_mail_rec_obj
*   EP_ADDRESS              =
*   ET_RECIPIENT            =
   EXCEPTIONS
     invalid_recipient       = 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.                    " mail_recipient_object
*&---------------------------------------------------------------------*
*&      Form  mail_sender_object
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      <--P_G_MAIL_SEN_OBJ  text
*----------------------------------------------------------------------*
FORM mail_sender_object  CHANGING p_mail_sen_obj.
  CALL FUNCTION 'CREATE_SENDER_OBJECT_PPF'
    EXPORTING
      ip_sender      = sy-uname
    IMPORTING
      ep_sender_id   = p_mail_sen_obj
    EXCEPTIONS
      invalid_sender = 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.                    " mail_sender_object
*&---------------------------------------------------------------------*
*&      Form  mail_appl_object
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      <--P_G_MAIL_APP_OBJ  text
*----------------------------------------------------------------------*
FORM mail_appl_object  CHANGING p_mail_app_obj.


  SELECT * FROM soud WHERE sapnam LIKE sy-uname AND deleted = ' '.
  ENDSELECT.
  IF sy-subrc NE 0.

    CALL FUNCTION 'SO_USER_AUTOMATIC_INSERT'
      EXPORTING
        sapname        = sy-uname
      EXCEPTIONS
        no_insert      = 1
        sap_name_exist = 2
        x_error        = 3
        OTHERS         = 4.
    IF sy-subrc NE 0.
      CLEAR soud.
    ELSE.
      SELECT * FROM soud WHERE sapnam LIKE sy-uname AND deleted = ' '.
      ENDSELECT.
    ENDIF.
  ENDIF.

  CLEAR sofmfol_key.
  sofmfol_key-type   = 'FOL'.
  sofmfol_key-year   = soud-inbyr.
  sofmfol_key-number = soud-inbno.
  bor_key = sofmfol_key.
  IF NOT bor_key IS INITIAL.
    swc_create_object folder 'SOFMFOL' bor_key.
    IF sy-subrc = 0.

      swc_object_to_persistent folder p_mail_app_obj.
      IF sy-subrc NE 0.
        CLEAR p_mail_app_obj.
      ENDIF.
    ENDIF.
  ELSE.
    CLEAR p_mail_app_obj.
  ENDIF.

ENDFORM.                    " mail_appl_object

Please also search for "email" in this forum concerning the connection from SAP to a mailsystem.

If everything works you can check the mailtraffic in TA SOST.

Hope this helps you a bit further

Olaf

Code Formatted by: Alvaro Tejada Galindo on Dec 26, 2008 11:14 AM

kmoore007
Active Contributor
0 Kudos

Olaf, thanks for the reply. Can you tell me what is the structure of sofmfol_key, bor_key, and folder for the form routine 'mail_appl_object' in your reply?

kmoore007
Active Contributor
0 Kudos

Olaf,

I cannot get FORM mail_appl_object to work. The code:

swc_create_object folder 'SOFMFOL' bor_key.

does not return sy-subrc = 0.

Former Member
0 Kudos

Hi,

sorry i forgot the declarations

data: g_mail_rec_obj type SWOTOBJID,

g_mail_sen_obj type SWOTOBJID,

g_mail_app_obj type SWOTOBJID,

FOLDER TYPE SWC_OBJECT,

BEGIN OF SOFMFOL_KEY,

FOLDERTYPE LIKE SOFM-FOLTP,

FOLDERYEAR LIKE SOFM-FOLYR,

FOLDERNUMBER LIKE SOFM-FOLNO,

TYPE LIKE SOFM-DOCTP,

YEAR LIKE SOFM-DOCYR,

NUMBER LIKE SOFM-DOCNO,

FORWARDER LIKE SOUB-USRNAM,

END OF SOFMFOL_KEY,

BOR_KEY LIKE SWOTOBJID-OBJKEY.

Please try again

kmoore007
Active Contributor
0 Kudos

Thanks, Olaf.

But I'm sorry, it is not working for me. I go to SCOT and nothing is there. We do already have SAPConnect working because we send emails from SAP.

I'll keep messing around and see if I can get it to work. Does seem like this process would be more simple - but then it wouldn't be SAP.

Former Member
0 Kudos

Hi Kenneth,

the only (and last) suggestion I have, is to make a "COMMIT WORK" directly after the SMARTFORMS-Function.

Don't give up!

kmoore007
Active Contributor
0 Kudos

Olaf - that was it! It now works! Thanks!

Former Member
0 Kudos

I love happy ends ...

Former Member
0 Kudos

hi,

thank you for your answer.

i have a one more question.

i want to write my own title to mail title and

write my own content to mail content.

please, can you tell me the way.

i will wait your answer.

Former Member
0 Kudos

within the output_options of the Smartforms function

you can give the mail title like this

g_output-tdtitle = titel.

(I refer to my code example upwards.)

You can create your specific titel before you call your function.

I don't think there is a possibility to add a mail content when mailing a smartform directly. If you have to give your own content to your mail, you will have to create a PDF-File out of your smartform before and mail it with fm SO_NEW_DOCUMENT_ATT_SEND_API1 afterwards.

There have been quite good hints for using this FM.

Regards Olaf

Former Member
0 Kudos

Hi Olaf,

Thakns for your example!!! It was very useful to me.

Now, I have a problem: the e-mail is sended OK, but the attach PDF file is empty.

Can you help with this?

kind regards,

Marisa

Former Member
0 Kudos

<<removed_by_moderator>>

Edited by: Vijay Babu Dudla on Dec 25, 2008 11:30 PM

Former Member
0 Kudos

Hi Olaf,

I used your code and it is working fine. But I can not able to send email body. Any idea of sending email body ? Your help is appreciated.

Thank you,

Surya

Former Member
0 Kudos

Hi,

I am in need of program code to send smartform as email.I have seen ur code on forum but is not complete.

Please help me.

Regards

Ankur Johri

Former Member
0 Kudos

Hi,

Please help me in sending smartform as email.I have seen ur discussion in the forum but unable to get some part of code.

Regards

Ankur Johri

<<removed_by_moderator>>

Edited by: Vijay Babu Dudla on Dec 25, 2008 11:24 PM

Former Member
0 Kudos

Hi, the fold type swc_object doesn't exist, what is the meaning of swc_create_object folder 'SOFMFOL' bor_key? thank you and merry christmas!

Former Member
0 Kudos

thank you very much! you are great and good luck to you!

Former Member
0 Kudos

please cold you post an example?

I need to send a PO smartforms by email and it continue not to work. I am able to print, send fax but not email. I'm working on a 4.6c

thank you all!

Former Member
0 Kudos

Well what I've used several times is the function CONVERT_OTFSPOOLJOB_2_PDF to convert the smartform spool output to a pdf and attach this one to the email. Unfortunately you have to transfer the output table of the function to a mail attachable format (the function returns a table of type tline, the email function SO_NEW_DOCUMENT_ATT_SEND_API1 needs a table of type solisti1).

Hope it helps...

Regards

Roger

Former Member
0 Kudos

Roger, thanks for your reply. Unfortunately I do not want to use the API1 fm. I would like to use the internal email parameters supplied with SMARTFORMS. Also I'm trying to show a graphic dynamically with no success so far. If that's not possible then show the URL of the graphic in a hypertext format.