Skip to Content
author's profile photo Former Member
Former Member

E mail subject line

Hi,

Here we are using email for order acknowledgement to the sales reps in PDF format. Whenever the email is generated the subject line is some thing not related to the transaction.

Now the client requires subject line to be changed to a sensible meaning so that the rep can understand the mail without going in to the mail.

The whole process is done Using the Output type XXXX with external send mode. We have debugged a lot but couldnot be able to find out the Function module which generates the Email.If any one had gone with the same problem earlier can surely suggest us the Function module or atleast the Field name which carries the subject line in VA01 or VA02. All we need is the Function Module name used in the VA02 or VA01 to generate the Email.

Thanks,

Venkat.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 22, 2007 at 10:06 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 22, 2007 at 10:06 AM

    Hi,

    Are you using the FM:SO_NEW_DOCUMENT_ATT_SEND_API1, if not try with this.

    See the sample Code related to this FM;

    ----


    • INCLUDE ZINCUSMAIL *

    ----


    include <symbol>.

    data : i_doc_data like sodocchgi1.

    data : begin of i_pack_list occurs 0.

    include structure sopcklsti1.

    data : end of i_pack_list.

    data : begin of i_receivers occurs 0.

    include structure somlreci1.

    data : end of i_receivers.

    data : begin of i_contents occurs 0.

    include structure solisti1.

    data : end of i_contents.

    data : begin of i_header occurs 0.

    include structure solisti1.

    data : end of i_header.

    data : begin of i_att occurs 0.

    include structure solisti1.

    data : end of i_att.

    • Internal Table for Internet address.

    data: begin of it_inad occurs 0,

    kunnr like kna1-kunnr, " Customer Code

    name1 like kna1-name1, " Customer Name

    ssobl like knkk-ssobl, " Security Deposit

    klimk like knkk-klimk, " Credit Limit

    opbal like bsid-wrbtr, " Opening Balance

    clbal like bsid-wrbtr, " Closing Balance

    smtp like adr6-smtp_addr, " Internet mail (SMTP) address

    end of it_inad.

    data : pdf_line(134),

    asdf like pdf_line occurs 0 with header line.

    data : pdf_table like tline occurs 0 with header line,

    pdf_fsize type i.

    data : stuff(65000),

    len type i,

    pos type i,

    tab_lines like sy-tabix.

    data: spoolid type tsp01-rqident,

    spdel type tsp01sys.

    data: v_gjahrt like bsid-gjahr,

    fmondest(10),

    tmondest(10),

    kunnr1 like kna1-kunnr,

    gjah(4),

    fmon(10).

    &----


    *& Form hide_write

    &----


    form hide_write.

    new-page print on

    line-size 160

    • line-count 58

    no-title

    no-heading

    destination 'LOCL'

    immediately ' '

    new list identification 'X'

    no dialog.

    set blank lines on.

    endform. " hide_write

    &----


    *& Form end_write

    &----


    form end_write using kunnr1.

    set blank lines off.

    new-page print off.

    ***Using Spoolid we are getting PDF formated file

    spoolid = spdel-rqident = sy-spono.

    spdel-sys = sy-sysid.

    call function 'CONVERT_ABAPSPOOLJOB_2_PDF'

    exporting

    src_spoolid = spoolid

    no_dialog = 'X'

    importing

    pdf_bytecount = pdf_fsize

    tables

    pdf = pdf_table

    exceptions

    others = 0.

    ***Delleting Spool request

    call function 'RSPO_IDELETE_SPOOLREQ'

    exporting

    spoolreq = spdel

    exceptions

    others = 2.

    ***Converting PDF table line size 134 into standard list size 255

    loop at pdf_table into pdf_line.

    if pos = 34170.

    perform attach.

    endif.

    stuff+pos(134) = pdf_line.

    add 134 to pos.

    endloop.

    if not ( stuff is initial ).

    perform attach.

    endif.

    clear pdf_line.

    clear pdf_table[].

    describe table i_att lines tab_lines.

    i_pack_list-transf_bin = 'X'.

    i_pack_list-head_start = '1'.

    i_pack_list-head_num = '1'.

    i_pack_list-body_start = '1'.

    i_pack_list-body_num = tab_lines.

    i_pack_list-doc_type = 'PDF'.

    i_pack_list-obj_name = 'LedgerMail'.

    concatenate fmon '-' gjah into i_pack_list-obj_descr.

    *i_pack_list-obj_descr = '2092-Oct03'.

    i_pack_list-obj_langu = 'E'.

    i_pack_list-doc_size = tab_lines * 255.

    append i_pack_list.

    ***Data for receivers list

    loop at it_inad where kunnr eq kunnr1.

    i_receivers-receiver = it_inad-smtp.

    i_receivers-rec_type = 'U'.

    i_receivers-rec_date = sy-datum.

    i_receivers-express = 'X'.

    i_receivers-com_type = 'INT'.

    i_receivers-notif_del = 'X'.

    append i_receivers.

    endloop.

    call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'

    exporting

    document_data = i_doc_data

    • PUT_IN_OUTBOX = ' '

    • IMPORTING

    • SENT_TO_ALL =

    • NEW_OBJECT_ID =

    tables

    packing_list = i_pack_list

    object_header = i_header

    contents_bin = i_att

    contents_txt = i_contents

    receivers = i_receivers

    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

    .

    refresh i_att. clear i_att.

    refresh i_receivers. clear i_receivers.

    delete i_pack_list where doc_type = 'PDF'.

    *refresh i_header.

    *refresh i_contents.

    *clear i_doc_data.

    endform. " end_write

    &----


    *& Form doc_data

    &----


    form doc_data using fmondest v_gjahrt.

    gjah = v_gjahrt.

    fmon = fmondest.

    ***Data for Document Data

    i_doc_data-obj_name = 'LedgerMail'.

    concatenate 'Customer Ledger for : ' fmondest gjah

    into i_doc_data-obj_descr separated by space.

    i_doc_data-obj_langu = 'E'.

    i_doc_data-obj_prio = '1'.

    i_doc_data-no_change = 'X'.

    i_doc_data-doc_size = '5101'.

    ***Data for Packing list

    i_pack_list-head_start = '1'.

    i_pack_list-head_num = '1'.

    i_pack_list-body_start = '1'.

    i_pack_list-body_num = '20'.

    i_pack_list-doc_type = 'RAW'.

    i_pack_list-obj_langu = 'E'.

    append i_pack_list.

    ***Data for Header

    i_header-line = 'Header'. append i_header.

    ***Data for contents

    i_contents-line = 'Dear Customer,'. append i_contents.

    i_contents-line = ' '. append i_contents.

    concatenate 'Please find your enclosed Ledger for the month of : '

    fmondest gjah into i_contents-line separated by space.

    append i_contents.

    i_contents-line = ' '. append i_contents.

    i_contents-line = 'This is a computer generated document and does not

    require a signature.'. append i_contents.

    i_contents-line = ' '. append i_contents.

    i_contents-line = 'Note : If you do not have Acrobat Reader please click

    on the below link.'. append i_contents.

    i_contents-line = ' '. append i_contents.

    i_contents-line = 'http://www.adobe.com/products/acrobat/readstep2.html'

    . append i_contents.

    i_contents-line = ' '. append i_contents.

    i_contents-line = ' '. append i_contents.

    i_contents-line = ' '. append i_contents.

    i_contents-line = ' '. append i_contents.

    i_contents-line = ' '. append i_contents.

    i_contents-line = ' '. append i_contents.

    i_contents-line = ' '. append i_contents.

    i_contents-line = ' '. append i_contents.

    i_contents-line = ' '. append i_contents.

    endform. " doc_data

    &----


    *& Form attach

    &----


    form attach.

    clear pos.

    len = strlen( stuff ).

    while len > 0.

    subtract 255 from len.

    i_att = stuff+pos(255).

    append i_att.

    add 255 to pos.

    endwhile.

    clear pos.

    clear stuff.

    endform. " attach

    Regards,

    Anji

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 22, 2007 at 10:08 AM

    It could be SO_OBJECT_SEND or something similar depending on the version of SAP you are on.

    However, emails can also be sent out using an ABAP Object. As far as I can recall you cannot change the subject line using the ABAP Object. Let me see if I can find out what class it is for.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 22, 2007 at 11:23 AM

    Hi All,

    Thanks for your answers, You all people have mentioned the Function Modules which are useful to generate the E mails if I were using an ABAP editor or the answers would meet the requirement if an Email has to be generated from the Report.

    But my requirement is different where already Email has been generated by using the Output type XXXX configured to VA01 or VA02 with external send mode, I just want to know the Function module name from which this particular Email has been generating in VA02 or VA01.I tried lot by Debugging but couldnot Succeed.

    I Searched the Function Modules given by You People in this regard but couldnot found them in VA02.

    Please help me out in this regard.

    Thanks,

    Venkat.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 27, 2007 at 09:36 AM

    Hi all,

    Now i found that the subject line for the emails is taken from the text line in out put condition type. This is the first tab in the output condition type configuration. "mail and texts". whatever we maintain here are taken as subject line for the email.

    Now my client needs to generate the subject line dynamically when the order is saved.

    That means subject line should be "company name, customer name and order number" all these values system has to capture from the document just created.

    How we can do this.

    thanking you

    Venkat.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.