Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with SO_DOCUMENT_SEND_API1

Former Member
0 Kudos
480

Hi,

I am using this funtion module SO_DOCUMENT_SEND_API1 for sending email .

MOVE <fs_gt_final2>-field1 TO gs_iemailbody-line+1(16).

MOVE <fs_gt_final2>-field2 TO gs_iemailbody-line+17(13).

MOVE <fs_gt_final2>-field3 TO gs_iemailbody-line+31(40).

MOVE <fs_gt_final2>-field4 TO gs_iemailbody-line+72(11).

MOVE <fs_gt_final2>-field5 TO gs_iemailbody-line+84(15).

APPEND gs_iemailbody TO gt_iemailbody.

gs_doc_data-obj_descr = text-023.

  • gs_doc_data-DOC_SIZE = 5000.

*Insert the Email signature 'Kind Regards,'

CLEAR gs_iemailbody.

gs_iemailbody-line = text-022.

APPEND gs_iemailbody TO gt_iemailbody.

CLEAR : gs_iemailbody,lv_len.

DESCRIBE TABLE gt_iemailbody LINES lv_len.

  • Fill packing list

gs_pack-doc_type = 'RAW'. " text document

gs_pack-transf_bin = ' '. " non binary

gs_pack-obj_descr = gs_doc_data-obj_descr.

gs_pack-body_start = 1. " first (and only) object

gs_pack-body_num = lv_len. " set the length.

APPEND gs_pack TO gt_pack_list.

CALL FUNCTION 'SO_DOCUMENT_SEND_API1'

EXPORTING

document_data = gs_doc_data

sender_address = 'EMAIL'

sender_address_type = 'B'

commit_work = 'X'

TABLES

packing_list = gt_pack_list

contents_txt = gt_iemailbody

receivers = gt_ireceivers.

I am facing problem that in table gt_iemailbody it is taking below two fields in different line

MOVE <fs_gt_final2>-field4 TO gs_iemailbody-line+72(11).

MOVE <fs_gt_final2>-field5 TO gs_iemailbody-line+84(15).

-


Registered Date Mail Centre Driver Name

Driver ID Expiry Date

-


16.12.2010 xxxxxx DEFECT 3133

9860003532 23.12.2010

6 REPLIES 6

Former Member
0 Kudos
206

Hi Manisha,

Did you check the mail content via Transaction SOST . Check it out if it is perfect in that than the chances are that the mail client is not configured properly for the mail content width.

If it is not showing perfectly (I mean it showing in two different lines ) than try to use the HTML Tages in you mail content like:::

<.SPAN style="font-family:arial;font-size:10.5pt;color:blue".>

"All your content will be here

<.SPAN.>

So use get_emailbody will contain:

line 1 : <.SPAN style="font-family:arial;font-size:10.5pt;color:blue".>

line 2 : <.B.> Registered Date Mail Centre Driver Name Driver ID Expiry Date <./B.> <.BR.>

line 3: <.I.> 16.12.2010 xxxxxx DEFECT 3133 9860003532 23.12.2010 <./I.>

line 4 : <.SPAN.>

<.B.> : USed to display the text in bold

<.I.> : For italic

<.BR.> : Line break

Note : i have used Extra dot for the tags as this site will recognised this tags... So use < instead of <.

and > for .>

Thanks...

0 Kudos
206

Hi,

Thanks for the reply but I am not able to check mail contents via SOST as the mail folder is not created. I have checked it in debugging where the internal table was formatted correctly but email received is not formatted (splitting the contents in two lines). I am surprised to check sy-uline which is not splitted on different lines and how to apply HTML tags in the code. Please let me know .

Cheers.

0 Kudos
206

Hi ,

As i told you the gt_emailbody should contain the following content :

line 1 : <.SPAN style="font-family:arial;font-size:10.5pt;color:blue".>

line 2 : <.B.> Registered Date Mail Centre Driver Name Driver ID Expiry Date <./B.> <.BR.>

line 3: <.I.> 16.12.2010 xxxxxx DEFECT 3133 9860003532 23.12.2010 <./I.>

line 4 : <.SPAN.>

You can try out the string operation and make the content of the body as shown above,.,,,No configuration requires.

only thing make sure that you remove the extra dots which i have used.

You can google to know how HTML Tags work... Get back if u need any more details

Thnaks...

0 Kudos
206

Can you please give me example because i am not able to find the correct soln

0 Kudos
206

MOVE '<.SPAN style="font-family:arial;font-size:10.5pt;color:blue".>' to gs_iemailbody-line.

APPEND gs_iemailbody TO gt_iemailbody.

concatenate '<.B.>' <fs_gt_final2>-field1 into <fs_gt_final2>-field1.

"If the above thing does not work try to use string variables

MOVE <fs_gt_final2>-field1 TO gs_iemailbody-line+1(16).

MOVE <fs_gt_final2>-field2 TO gs_iemailbody-line+17(13).

MOVE <fs_gt_final2>-field3 TO gs_iemailbody-line+31(40).

MOVE <fs_gt_final2>-field4 TO gs_iemailbody-line+72(11).

concatenate <fs_gt_final2>-field5 '<./B.>' into <fs_gt_final2>-field5.

MOVE <fs_gt_final2>-field5 TO gs_iemailbody-line+84(15).

APPEND gs_iemailbody TO gt_iemailbody.

Same way construct the gt_iemailbody table which gived you the below content..

ine 1 : <.SPAN style="font-family:arial;font-size:10.5pt;color:blue".>

line 2 : <.B.> Registered Date Mail Centre Driver Name Driver ID Expiry Date <./B.> <.BR.>

line 3: <.I.> 16.12.2010 xxxxxx DEFECT 3133 9860003532 23.12.2010 <./I.>

line 4 : <.SPAN.>

Note ::::: :again as i said ::::: use only '<' instead of '<.' ("Remove dots from the tags.........")

0 Kudos
206

I have tried with the suggested HTML code but it is sending the email contents as a HTML attachment. I wan it to print direcly on the ext editor (like lotus notes). Any suggestions will be helpful.