<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic alignment problem with SO_NEW_DOCUMENT_SEND_API1 FM in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alignment-problem-with-so-new-document-send-api1-fm/m-p/5855317#M1320443</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im using the SO_NEW_DOCUMENT_SEND_API1 FM for sending mail to user. In the mail content, i need to specify various information in a table form. so, i used sy-uline and sy-vline for separating the information as rows and columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the columns are NOT getting displayed properly. i have specified the same offset and length (Example 2(10)) for the headings as well as the mail content. Even then , the next field is not gettinng started at the same column what i mentioned. Depending upon the length of the data, it is getting changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone tell me how to get proper alignment (every column need to start at the same position) iin the mail content using this Bapi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shanthi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Jun 2009 06:35:48 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-06-22T06:35:48Z</dc:date>
    <item>
      <title>alignment problem with SO_NEW_DOCUMENT_SEND_API1 FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alignment-problem-with-so-new-document-send-api1-fm/m-p/5855317#M1320443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im using the SO_NEW_DOCUMENT_SEND_API1 FM for sending mail to user. In the mail content, i need to specify various information in a table form. so, i used sy-uline and sy-vline for separating the information as rows and columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the columns are NOT getting displayed properly. i have specified the same offset and length (Example 2(10)) for the headings as well as the mail content. Even then , the next field is not gettinng started at the same column what i mentioned. Depending upon the length of the data, it is getting changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone tell me how to get proper alignment (every column need to start at the same position) iin the mail content using this Bapi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shanthi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2009 06:35:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alignment-problem-with-so-new-document-send-api1-fm/m-p/5855317#M1320443</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-22T06:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: alignment problem with SO_NEW_DOCUMENT_SEND_API1 FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alignment-problem-with-so-new-document-send-api1-fm/m-p/5855318#M1320444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PART - I&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  zsendemail                    .
PARAMETERS: psubject(40) type c default  'Hello',
            p_email(40)   type c default 'WRITE EMAIL ADDRESS' .

data:   it_packing_list like sopcklsti1 occurs 0 with header line,
        it_contents like solisti1 occurs 0 with header line,
        it_receivers like somlreci1 occurs 0 with header line,
        it_attachment like solisti1 occurs 0 with header line,
        gd_cnt type i,
        gd_sent_all(1) type c,
        gd_doc_data like sodocchgi1,
        gd_error type sy-subrc.

data:   it_message type standard table of SOLISTI1 initial size 0
                with header line.
*START-OF-SELECTION.
START-OF-SELECTION.
Perform populate_message_table.
*Send email message, although is not sent from SAP until mail send
*program has been executed(rsconn01)
PERFORM send_email_message.
*Instructs mail send program for SAPCONNECT to send email(rsconn01)
perform initiate_mail_execute_program.
form populate_message_table.
  Append 'Email line 1' to it_message.
  Append 'Email line 2' to it_message.
  Append 'Email line 3' to it_message.
  Append 'Email line 4' to it_message.
endform.                    " POPULATE_MESSAGE_TABLE
form send_email_message.
* Fill the document data.
  gd_doc_data-doc_size = 1.

* Populate the subject/generic message attributes
  gd_doc_data-obj_langu = sy-langu.
  gd_doc_data-obj_name  = 'SAPRPT'.
  gd_doc_data-obj_descr = psubject.
  gd_doc_data-sensitivty = 'F'.

* Describe the body of the message
  clear it_packing_list.
  refresh it_packing_list.
  it_packing_list-transf_bin = space.
  it_packing_list-head_start = 1.
  it_packing_list-head_num = 0.
  it_packing_list-body_start = 1.
  describe table it_message lines it_packing_list-body_num.
  it_packing_list-doc_type = 'RAW'.
  append it_packing_list.

* Add the recipients email address
  clear it_receivers.
  refresh it_receivers.
  it_receivers-receiver = p_email.
  it_receivers-rec_type = 'U'.
  it_receivers-com_type = 'INT'.
  it_receivers-notif_del = 'X'.
  it_receivers-notif_ndel = 'X'.
  append it_receivers.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2009 12:55:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alignment-problem-with-so-new-document-send-api1-fm/m-p/5855318#M1320444</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-23T12:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: alignment problem with SO_NEW_DOCUMENT_SEND_API1 FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alignment-problem-with-so-new-document-send-api1-fm/m-p/5855319#M1320445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PART - II&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

* Call the FM to post the message to SAPMAIL
  call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
       exporting
            document_data              = gd_doc_data
            put_in_outbox              = 'X'
       importing
            sent_to_all                = gd_sent_all
       tables
            packing_list               = it_packing_list
            contents_txt               = it_message
            receivers                  = it_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.

* Store function module return code
  gd_error = sy-subrc.

* Get it_receivers return code
  loop at it_receivers.
  endloop.
endform.                    " SEND_EMAIL_MESSAGE

form initiate_mail_execute_program.
  wait up to 2 seconds.
  if gd_error eq 0.
      submit rsconn01 with mode = 'INT'
                    with output = 'X'
                    and return.
  endif.
endform.                    " INITIATE_MAIL_EXECUTE_PROGRAM

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2009 12:56:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alignment-problem-with-so-new-document-send-api1-fm/m-p/5855319#M1320445</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-23T12:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: alignment problem with SO_NEW_DOCUMENT_SEND_API1 FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alignment-problem-with-so-new-document-send-api1-fm/m-p/5855320#M1320446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of displaying the data in RAW format..you can display in HTML format for overcomming the alignment problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer to this link..http://docs.google.com/Doc?id=dfv2hmgs_6hf8nm5f4&amp;amp;hl=en&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2009 13:01:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alignment-problem-with-so-new-document-send-api1-fm/m-p/5855320#M1320446</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-23T13:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: alignment problem with SO_NEW_DOCUMENT_SEND_API1 FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alignment-problem-with-so-new-document-send-api1-fm/m-p/5855321#M1320447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I also faced similar problem. What I did was I created a dictionary structure and then used it in the probram for populating the table contents. Please find the code below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ZMMAILBODY_FORMAT was the dictionary structure I created with two fields &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FIELD	CHAR25	CHAR	25	0	User field for cluster PC (national)
VALUE	CHAR50	CHAR	50	0	Comment.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KR Jaideep,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2009 13:02:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alignment-problem-with-so-new-document-send-api1-fm/m-p/5855321#M1320447</guid>
      <dc:creator>jaideepsharma</dc:creator>
      <dc:date>2009-06-23T13:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: alignment problem with SO_NEW_DOCUMENT_SEND_API1 FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alignment-problem-with-so-new-document-send-api1-fm/m-p/5855322#M1320448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;

DESCRIBE FIELD lwa_zmmailbody_format-field
            LENGTH lv_length IN CHARACTER MODE.

    DO lv_length TIMES.
      CONCATENATE c_hyphen lwa_zmmailbody_format-field INTO
                           lwa_zmmailbody_format-field.
    ENDDO.

    DESCRIBE FIELD lwa_zmmailbody_format-value
            LENGTH lv_length IN CHARACTER MODE.
    DO lv_length TIMES.
      CONCATENATE c_hyphen lwa_zmmailbody_format-value INTO
                           lwa_zmmailbody_format-value.
    ENDDO.

    APPEND lwa_zmmailbody_format TO li_zmmailbody_format.
    CLEAR lwa_zmmailbody_format.

    lwa_zmmailbody_format-field = text-002.

*---Check if it's a one time vendor then fetch Vendor name from Invoice
*---header

    IF NOT wa_rbkp-xcpdk IS INITIAL.
      CONCATENATE wa_rbkp-lifnr wa_rbkp-name1 INTO
                  lwa_zmmailbody_format-value
      SEPARATED BY ':'.
    ELSE.
*---Check if it's not a one time vendor then fetch name from Vendor
*---Master
      READ TABLE li_lfa1 INTO lwa_lfa1 WITH KEY lifnr = wa_rbkp-lifnr.
      IF sy-subrc EQ 0.
        CONCATENATE wa_rbkp-lifnr lwa_lfa1-name1 INTO
                    lwa_zmmailbody_format-value
        SEPARATED BY '-'.
      ENDIF."IF sy-subrc EQ 0.

    ENDIF."IF NOT wa_rbkp-xcpdk IS INITIAL.

    APPEND lwa_zmmailbody_format TO li_zmmailbody_format.
    lwa_zmmailbody_format-field = text-003.

    lwa_zmmailbody_format-value = wa_rbkp-bukrs.
    APPEND lwa_zmmailbody_format TO li_zmmailbody_format.

    lwa_zmmailbody_format-field = text-009.

    READ TABLE li_ekpo INTO lwa_ekpo WITH KEY ebeln = wa_rseg-ebeln
                                              ebelp = wa_rseg-ebelp.
    IF sy-subrc EQ 0.
      lwa_zmmailbody_format-value = lwa_ekpo-afnam.
    ENDIF.
    APPEND lwa_zmmailbody_format TO li_zmmailbody_format.

*---Fill line in mail body

    DO lv_length TIMES.
      CONCATENATE c_hyphen lwa_zmmailbody_format-field INTO
                           lwa_zmmailbody_format-field.
    ENDDO.

    DESCRIBE FIELD lwa_zmmailbody_format-value
            LENGTH lv_length IN CHARACTER MODE.
    DO lv_length TIMES.
      CONCATENATE c_hyphen lwa_zmmailbody_format-value INTO
                           lwa_zmmailbody_format-value.
    ENDDO.

    APPEND lwa_zmmailbody_format TO li_zmmailbody_format.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KR Jaideep,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2009 13:10:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alignment-problem-with-so-new-document-send-api1-fm/m-p/5855322#M1320448</guid>
      <dc:creator>jaideepsharma</dc:creator>
      <dc:date>2009-06-23T13:10:18Z</dc:date>
    </item>
  </channel>
</rss>

