cancel
Showing results for 
Search instead for 
Did you mean: 

No mail sent to SBWP thru smartforms

Former Member
0 Kudos

Hi All,

i am trying to send mail with pdf attached to SBWP.i dont want to send it to the reciever's mailbox but want to send it to sbwp.

how can i achieve this?

please let me know in detail....

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hi,

For the mail to appear in the SBWP , the user must be your login user (e.g. if SAPDEV01 is your login user id specify it in the recipient).

This way the mail appears in the inbox in Sap business work place.

Regards

Sharath

Former Member
0 Kudos

Hi.

As you said i mentioned over there but i am not geeting any mail nor any information message/

Former Member
0 Kudos

can you be more specific about from where you are trying to send the mail..?

regards

sharath

Former Member
0 Kudos

yes.

in reports i have displayed data as ALV and slecting some of the records and displaying in smartforms.. now im converting this data into PDF and sending a mail with attachment.

Former Member
0 Kudos

hi,

Follow the below given steps....

1) Converting smartform to PDF

use function module CONVERT_OTF_2_PDF

2) Download as a file

Use function module GUI_DOWNLOAD

3)

Sending PDF as mail

Function module : SO_DOCUMENT_SEND_API1

OR

Open SWDD workflow builder,

on the center panel

Right click> Mail> Opens a new window

> give the user: your login user id->

attach the pdf file from local server-->

check, activate and run your workflow.

You find a mail in your business workplace with the above attachment.

Regards

Sharath

Former Member
0 Kudos

hi,

i have followed all the three steps even then i am not getting this.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'Z_SD_SMARTFORMS'

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

FM_NAME = FNAME

  • 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.

w_cparam-no_dialog = 'X'.

w_cparam-preview = space. " Suppressing the dialog box

" for print preview

w_cparam-getotf = 'X'.

  • Printer name to be used is provided in the export parameter

  • OUTPUT_OPTIONS

w_outoptions-tddest = 'LP01'.

CALL FUNCTION FNAME

EXPORTING

CONTROL_PARAMETERS = w_cparam

OUTPUT_OPTIONS = w_outoptions

  • USER_SETTINGS = 'X'

IMPORTING

  • DOCUMENT_OUTPUT_INFO =

JOB_OUTPUT_INFO = T_OTF_FROM_FM

  • JOB_OUTPUT_OPTIONS = T_OTFDATA

TABLES

it_final1 = IT_FINAL1

  • 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.

t_otf[] = t_otf_from_fm-otfdata[].

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

FORMAT = 'PDF'

MAX_LINEWIDTH = 132

  • ARCHIVE_INDEX = ' '

  • COPYNUMBER = 0

  • ASCII_BIDI_VIS2LOG = ' '

  • PDF_DELETE_OTFTAB = ' '

IMPORTING

BIN_FILESIZE = W_BIN_FILESIZE

TABLES

otf = T_OTF

lines = T_PDF_TAB

  • EXCEPTIONS

  • ERR_MAX_LINEWIDTH = 1

  • ERR_FORMAT = 2

  • ERR_CONV_NOT_POSSIBLE = 3

  • ERR_BAD_OTF = 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.

LOOP AT T_pdf_tab.

  • Replacing space by ~

TRANSLATE T_pdf_tab USING ' ~'.

CONCATENATE w_buffer T_pdf_tab INTO w_buffer.

ENDLOOP.

  • Replacing ~ by space

TRANSLATE w_buffer USING '~ '.

DO.

i_record = w_buffer.

  • Appending 255 characters as a record

APPEND i_record.

SHIFT w_buffer LEFT BY 255 PLACES.

IF w_buffer IS INITIAL.

EXIT.

ENDIF.

ENDDO.

Refresh: i_reclist,

i_objtxt,

i_objbin,

i_objpack.

clear w_objhead.

    • Replacing ~ by space

TRANSLATE w_buffer USING '~ '.

DO.

i_record = w_buffer.

  • Appending 255 characters as a record

APPEND i_record.

SHIFT w_buffer LEFT BY 255 PLACES.

IF w_buffer IS INITIAL.

EXIT.

ENDIF.

ENDDO.

Refresh: i_reclist,

i_objtxt,

i_objbin,

i_objpack.

clear w_objhead.

  • Object with PDF.

i_objbin[] = i_record[].

DESCRIBE TABLE i_objbin LINES v_lines_bin.

  • Object with main text of the mail.

i_objtxt = 'Find attached the output of the smart form.'.

APPEND i_objtxt.

DESCRIBE TABLE i_objtxt LINES v_lines_txt.

  • Document information.

w_doc_chng-obj_name = 'Smartform'.

w_doc_chng-expiry_dat = sy-datum + 10.

w_doc_chng-obj_descr = 'Smart form output'.

w_doc_chng-sensitivty = 'F'. "Functional object

w_doc_chng-doc_size = v_lines_txt * 255.

  • Pack to main body as RAW.

  • Obj. to be transported not in binary form

CLEAR i_objpack-transf_bin.

  • Start line of object header in transport packet

i_objpack-head_start = 1.

  • Number of lines of an object header in object packet

i_objpack-head_num = 0.

  • Start line of object contents in an object packet

i_objpack-body_start = 1.

  • Number of lines of the object contents in an object packet

i_objpack-body_num = v_lines_txt.

  • Code for document class

i_objpack-doc_type = 'RAW'.

APPEND i_objpack.

  • Packing as PDF.

i_objpack-transf_bin = 'X'.

i_objpack-head_start = 1.

i_objpack-head_num = 1.

i_objpack-body_start = 1.

i_objpack-body_num = v_lines_bin.

i_objpack-doc_type = 'PDF'.

i_objpack-obj_name = 'Smart'.

CONCATENATE 'Smart' '.pdf'

INTO i_objpack-obj_descr.

i_objpack-doc_size = v_lines_bin * 255.

APPEND i_objpack.

  • Document information.

CLEAR i_reclist.

  • e-mail receivers.

i_reclist-receiver = 'ISCDEV70'.

i_reclist-express = 'X'.

i_reclist-rec_type = 'U'. "Internet address

APPEND i_reclist.

  • Sending mail.

CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

EXPORTING

document_data = w_doc_chng

put_in_outbox = 'X'

TABLES

packing_list = i_objpack

object_header = w_objhead

contents_bin = i_objbin

contents_txt = i_objtxt

receivers = i_reclist

EXCEPTIONS

too_many_receivers = 1

document_not_sent = 2

document_type_not_exist = 3

operation_no_authorization = 4

parameter_error = 5

x_error = 6

enqueue_error = 7

OTHERS = 8.

IF sy-subrc <> 0.

MESSAGE 'successful ' type 'I'.

ENDIF.

this is the code what i am using.

Former Member
0 Kudos

hi,

Better to use CONVERT_OTF_2_PDF rather than 'CONVERT_OTF'

Regards

Sharath

Former Member
0 Kudos

hi,,

the thing is the mail is in outbox. but y not in inbox?

Former Member
0 Kudos

hi,

CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = w_doc_chng
put_in_outbox = space   " In your code its been set thats the reason you are getting it in OUTBOX

Regards

Sharath

Former Member
0 Kudos

Hi Poonam,

There might be two reasons for not reaching the mail to the mailbox.

1) there may be no connection between the systems.

2) there may no basis configuration in your system.

please check the transaction sost . If your document is present in that,choose the document and sent.

if it is not able to sent means there is sufficient configuraion settings in your system.contact your basis team.

Former Member
0 Kudos

i did as you said, but im not getting it in inbox.