<?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 Program for email notification for PO in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-email-notification-for-po/m-p/12747808#M2021522</link>
    <description>&lt;P&gt;Pull the PO's which are having ZTM1 Output type from the NAST table&lt;/P&gt;
  &lt;P&gt;and from those PO's need to check weather ASN is confirmed or not &lt;/P&gt;
  &lt;P&gt;If ASN not confirmed we need to send an email notification due date for 3 days prior&lt;/P&gt;
  &lt;P&gt;can you help me with code for this &lt;/P&gt;
  &lt;P&gt;Thanks in advance&lt;/P&gt;</description>
    <pubDate>Fri, 20 Oct 2023 06:22:13 GMT</pubDate>
    <dc:creator>karthikreddy8174</dc:creator>
    <dc:date>2023-10-20T06:22:13Z</dc:date>
    <item>
      <title>Program for email notification for PO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-email-notification-for-po/m-p/12747808#M2021522</link>
      <description>&lt;P&gt;Pull the PO's which are having ZTM1 Output type from the NAST table&lt;/P&gt;
  &lt;P&gt;and from those PO's need to check weather ASN is confirmed or not &lt;/P&gt;
  &lt;P&gt;If ASN not confirmed we need to send an email notification due date for 3 days prior&lt;/P&gt;
  &lt;P&gt;can you help me with code for this &lt;/P&gt;
  &lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2023 06:22:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-email-notification-for-po/m-p/12747808#M2021522</guid>
      <dc:creator>karthikreddy8174</dc:creator>
      <dc:date>2023-10-20T06:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: Program for email notification for PO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-email-notification-for-po/m-p/12747809#M2021523</link>
      <description>&lt;P&gt;which part are you having difficulties in?&lt;BR /&gt;- send mail using cl_bcs?&lt;BR /&gt;- logic to get the data based on your requirement?&lt;BR /&gt;- everything?&lt;/P&gt;&lt;P&gt;Paste your code so we could help test or analyze it.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2023 06:41:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-email-notification-for-po/m-p/12747809#M2021523</guid>
      <dc:creator>xiswanto</dc:creator>
      <dc:date>2023-10-20T06:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: Program for email notification for PO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-email-notification-for-po/m-p/12747810#M2021524</link>
      <description>&lt;P&gt;sorry I'm new to sap i didn't tried coding if you have any example code can you please send me . Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2023 06:54:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-email-notification-for-po/m-p/12747810#M2021524</guid>
      <dc:creator>karthikreddy8174</dc:creator>
      <dc:date>2023-10-20T06:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: Program for email notification for PO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-email-notification-for-po/m-p/12747811#M2021525</link>
      <description>&lt;P&gt;I see that in one your &lt;A href="https://answers.sap.com/questions/13974495/create-a-program-to-send-email-notification-for-th.html" target="_blank"&gt;post&lt;/A&gt; here you pasted the code which had mail function. Why not use that one as the sample code?&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2023 07:18:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-email-notification-for-po/m-p/12747811#M2021525</guid>
      <dc:creator>xiswanto</dc:creator>
      <dc:date>2023-10-20T07:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: Program for email notification for PO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-email-notification-for-po/m-p/12747812#M2021526</link>
      <description>&lt;P&gt;Yes we can use this &lt;/P&gt;&lt;P&gt;need change as per requirement&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*&amp;amp; Report ZRPMM_PO&lt;BR /&gt;*&amp;amp;---------------------------------------------------------------------*&lt;BR /&gt;*&amp;amp;&lt;BR /&gt;*&amp;amp;---------------------------------------------------------------------*&lt;BR /&gt;report zrpmm_po no standard page heading.&lt;BR /&gt;tables eket.&lt;BR /&gt;select-options so_eindt for eket-eindt.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;*-----------------------------------------&lt;BR /&gt;*DATA: LV_VALUE&lt;BR /&gt;*PREPARE MAIL OBJECT&lt;BR /&gt;data: lo_send_request type ref to cl_bcs. "VALUE IS INITIAL.&lt;BR /&gt;class cl_bcs definition load.&lt;BR /&gt;data: lo_document type ref to cl_document_bcs . "VALUE IS INITIAL. "DOCUMENT OBJECT&lt;BR /&gt;data : it_text type bcsy_text. "TABLE FOR BODY&lt;BR /&gt;data : wa_text like line of it_text. "WORK AREA FOR MESSAGE BODY&lt;BR /&gt;data: lo_sender type ref to if_sender_bcs. "VALUE IS INITIAL. "SENDER&lt;BR /&gt;data: lo_recipient type ref to if_recipient_bcs." VALUE IS INITIAL. "RECIPIENT&lt;BR /&gt;**SELECTION SCREEN&lt;BR /&gt;parameters : p_email type adr6-smtp_addr. "EMAIL INPUT&lt;BR /&gt;parameters: p_sub type char50. "EMAIL SUBJECT&lt;BR /&gt;parameters : p_send as checkbox. "SEND IMMEDIATELY FLAG&lt;BR /&gt;***ATTACHMENT DATA&lt;BR /&gt;data : lv_string type string,&lt;BR /&gt;lv_data_string type string,&lt;BR /&gt;lv_xstring type xstring.&lt;BR /&gt;data: lit_binary_content type solix_tab,&lt;BR /&gt;l_attsubject type sood-objdes.&lt;BR /&gt;&lt;BR /&gt;start-of-selection.&lt;BR /&gt;"CREATE OBJECT FOR SENDING EMAIL&lt;BR /&gt;&lt;BR /&gt;lo_send_request = cl_bcs=&amp;gt;create_persistent( ).&lt;BR /&gt;*****************************START OF BOCY***************************************************&lt;BR /&gt;"MESSAGE BODY&lt;BR /&gt;wa_text-line = '&amp;lt;HTML&amp;gt;&amp;lt;BODY&amp;gt;'.&lt;BR /&gt;append wa_text to it_text.&lt;BR /&gt;wa_text-line = 'DEAR RECEPIENT,'.&lt;BR /&gt;append wa_text to it_text.&lt;BR /&gt;wa_text-line = '&amp;lt;BR&amp;gt;&amp;lt;/BR&amp;gt;'.&lt;BR /&gt;append wa_text to it_text.&lt;BR /&gt;wa_text-line = 'PLEASE FIND THE PO DETAILS AS REQUESTED IN THE ATTACHMENT.'.&lt;BR /&gt;append wa_text to it_text.&lt;BR /&gt;wa_text-line = '&amp;lt;BR&amp;gt;&amp;lt;/BR&amp;gt;'.&lt;BR /&gt;append wa_text to it_text.&lt;BR /&gt;wa_text-line = 'THANKS &amp;amp; REGARDS , SENDER'.&lt;BR /&gt;append wa_text to it_text.&lt;BR /&gt;wa_text-line = '&amp;lt;/BODY&amp;gt;&amp;lt;/HTML&amp;gt;'.&lt;BR /&gt;append wa_text to it_text.&lt;BR /&gt;clear wa_text.&lt;BR /&gt;*************************END OF BODY*******************************************************&lt;BR /&gt;lo_document = cl_document_bcs=&amp;gt;create_document(&lt;BR /&gt;exporting "CREATE DOCUMENT&lt;BR /&gt;i_type = 'HTM' "TYPE OF DOCUMENT HTM, TXT ETC&lt;BR /&gt;i_text = it_text "EMAIL BODY INTERNAL TABLE&lt;BR /&gt;i_subject = p_sub ). "EMAIL SUBJECT HERE P_SUB INPUT PARAMETER&lt;BR /&gt;* PASS THE DOCUMENT TO SEND REQUEST&lt;BR /&gt;lo_send_request-&amp;gt;set_document( lo_document ).&lt;BR /&gt;***SET ATTACHMENT&lt;BR /&gt;select ebeln,&lt;BR /&gt;ebelp,&lt;BR /&gt;eindt from eket&lt;BR /&gt;into table @data(gt_eket)&lt;BR /&gt;where eindt in @so_eindt.&lt;BR /&gt;&lt;BR /&gt;*&lt;BR /&gt;loop at gt_eket into data(gs_eket).&lt;BR /&gt;concatenate gs_eket-ebeln gs_eket-ebelp gs_eket-eindt into lv_string separated by&lt;BR /&gt;cl_abap_char_utilities=&amp;gt;horizontal_tab.&lt;BR /&gt;concatenate lv_data_string lv_string into lv_data_string separated by cl_abap_char_utilities=&amp;gt;newline.&lt;BR /&gt;endloop.&lt;BR /&gt;***CONVERT STRING TO XSTRING&lt;BR /&gt;call function 'HR_KR_STRING_TO_XSTRING'&lt;BR /&gt;exporting&lt;BR /&gt;* CODEPAGE_TO = '8300'&lt;BR /&gt;unicode_string = lv_data_string&lt;BR /&gt;* OUT_LEN =&lt;BR /&gt;importing&lt;BR /&gt;xstring_stream = lv_xstring&lt;BR /&gt;exceptions&lt;BR /&gt;invalid_codepage = 1&lt;BR /&gt;invalid_string = 2&lt;BR /&gt;others = 3.&lt;BR /&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;BR /&gt;if sy-subrc = 1 .&lt;BR /&gt;elseif sy-subrc = 2 .&lt;BR /&gt;write:/ 'INVALID STRING ' .&lt;BR /&gt;endif.&lt;BR /&gt;endif.&lt;BR /&gt;***XSTRING TO BINARY&lt;BR /&gt;call function 'SCMS_XSTRING_TO_BINARY'&lt;BR /&gt;exporting&lt;BR /&gt;buffer = lv_xstring&lt;BR /&gt;tables&lt;BR /&gt;binary_tab = lit_binary_content.&lt;BR /&gt;**ADD ATTACHMENT&lt;BR /&gt;clear l_attsubject .&lt;BR /&gt;concatenate 'INNERCIRCLE_EXCEL' sy-datum into l_attsubject.&lt;BR /&gt;* CREATE ATTACHMENT&lt;BR /&gt;try.&lt;BR /&gt;lo_document-&amp;gt;add_attachment( exporting&lt;BR /&gt;i_attachment_type = 'XLS'&lt;BR /&gt;i_attachment_subject = l_attsubject&lt;BR /&gt;i_att_content_hex = lit_binary_content ).&lt;BR /&gt;catch cx_document_bcs into data(lx_document_bcs).&lt;BR /&gt;endtry.&lt;BR /&gt;try.&lt;BR /&gt;lo_sender = cl_sapuser_bcs=&amp;gt;create( sy-uname ). "SENDER IS THE LOGGED IN USER&lt;BR /&gt;* SET SENDER TO SEND REQUEST&lt;BR /&gt;lo_send_request-&amp;gt;set_sender(&lt;BR /&gt;exporting&lt;BR /&gt;i_sender = lo_sender ).&lt;BR /&gt;* CATCH CX_ADDRESS_BCS.&lt;BR /&gt;****CATCH EXCEPTION HERE&lt;BR /&gt;endtry.&lt;BR /&gt;**SET RECIPIENT&lt;BR /&gt;lo_recipient = cl_cam_address_bcs=&amp;gt;create_internet_address( p_email ). "HERE RECIPIENT IS EMAIL INPUT P_EMAIL&lt;BR /&gt;try.&lt;BR /&gt;lo_send_request-&amp;gt;add_recipient(&lt;BR /&gt;exporting&lt;BR /&gt;i_recipient = lo_recipient&lt;BR /&gt;i_express = 'X' ).&lt;BR /&gt;* CATCH CX_SEND_REQ_BCS INTO BCS_EXCEPTION .&lt;BR /&gt;**CATCH EXCEPTION HERE&lt;BR /&gt;endtry.&lt;BR /&gt;"SCHEDUEL WHEN YOU WANT SEND THE EMAIL&lt;BR /&gt;try.&lt;BR /&gt;call method lo_send_request-&amp;gt;set_send_immediately&lt;BR /&gt;exporting&lt;BR /&gt;i_send_immediately = p_send. "HERE SELECTION SCREEN INPUT P_SEND&lt;BR /&gt;* CATCH CX_SEND_REQ_BCS INTO BCS_EXCEPTION .&lt;BR /&gt;**CATCH EXCEPTION HERE&lt;BR /&gt;endtry.&lt;BR /&gt;try.&lt;BR /&gt;** SEND EMAIL&lt;BR /&gt;lo_send_request-&amp;gt;send(&lt;BR /&gt;exporting&lt;BR /&gt;i_with_error_screen = 'X' ).&lt;BR /&gt;commit work.&lt;BR /&gt;if sy-subrc = 0. "MAIL SENT SUCCESSFULLY&lt;BR /&gt;write &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; 'MAIL SENT SUCCESSFULLY'.&lt;BR /&gt;endif.&lt;BR /&gt;* CATCH CX_SEND_REQ_BCS INTO BCS_EXCEPTION .&lt;BR /&gt;*CATCH EXCEPTION HERE&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;endtry.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Oct 2023 08:30:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-email-notification-for-po/m-p/12747812#M2021526</guid>
      <dc:creator>karthikreddy8174</dc:creator>
      <dc:date>2023-10-20T08:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: Program for email notification for PO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-email-notification-for-po/m-p/12747813#M2021527</link>
      <description>&lt;P&gt;Since you have the code, now you can try coding, no?&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2023 10:34:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-email-notification-for-po/m-p/12747813#M2021527</guid>
      <dc:creator>xiswanto</dc:creator>
      <dc:date>2023-10-20T10:34:26Z</dc:date>
    </item>
  </channel>
</rss>

