<?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>Question Re: Error while sending  email using custom email template using ABAP program. in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/error-while-sending-email-using-custom-email-template-using-abap-program/qaa-p/14324750#M4936715</link>
    <description>Have you solved the issue? I assume so, as it seems easy if you know the values of IT_DATA_KEY and IR_DATA of the terminated method CL_SMTG_EMAIL_RENDERER -&amp;gt; APPLY (those are visible in the dump).</description>
    <pubDate>Mon, 09 Feb 2026 20:40:00 GMT</pubDate>
    <dc:creator>Filipp</dc:creator>
    <dc:date>2026-02-09T20:40:00Z</dc:date>
    <item>
      <title>Error while sending  email using custom email template using ABAP program.</title>
      <link>https://community.sap.com/t5/technology-q-a/error-while-sending-email-using-custom-email-template-using-abap-program/qaq-p/14276565</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I have created an email template using CDS View and calling the email Template using ABAP and using below code to send email where I am getting " No data supplied to the template" error. Here is the Code Dump. Any suggestions?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ABAP Code:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;    DATA : email_template_name TYPE smtg_tmpl_id VALUE 'ZZ1_DEMO_TEMP',
           sales_order_id TYPE VBAK-VBELN VALUE '0000000040'.


    DATA(bcs) = cl_bcs=&amp;gt;create_persistent( ).

    DATA(email_api) =  cl_smtg_email_api=&amp;gt;get_instance(
            iv_template_id = email_template_name  ).

	DATA(sales_order_cds_key) =
             VALUE if_smtg_email_template=&amp;gt;ty_gt_data_key(
                  ( name = 'SalesDocument'
                    value = sales_order_id ) ).

    TRY.

        " Integrate E-Mail subject and body with email instance
        email_api-&amp;gt;render_bcs(
                  io_bcs = bcs
                 iv_language = 'E'
                  iv_language_default = 'E'
                  it_data_key =  sales_order_cds_key

                 ).


        DATA(email_receipient)  =
                   cl_cam_address_bcs=&amp;gt;create_internet_address(
                          'test@email.com' ).

        bcs-&amp;gt;add_recipient(
                    EXPORTING i_recipient  = email_receipient    ).

        bcs-&amp;gt;send( ) .

        COMMIT WORK .

      CATCH cx_bcs INTO DATA(lx_bcs).
        " Handle the exception, e.g., log or output error message
        out-&amp;gt;write( lx_bcs-&amp;gt;get_text( ) ).
    ENDTRY.&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;Code Dump&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;An exception has occurred in class "CX_SMTG_EMAIL_COMMON". This exception was not caught&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in procedure "IF_OO_ADT_CLASSRUN~MAIN" "(METHOD)" or propagated by a RAISING clause.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Since the caller of the procedure could not have anticipated this&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;exception, the current program was terminated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The reason for the exception occurring was:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The reason for the exception is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;No data supplied to render email template "ZZ1_DEMO_TEMP"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H4 id="TERMINATION"&gt;Information on where terminated&lt;/H4&gt;&lt;P&gt;&lt;SPAN&gt;The termination occurred in ABAP program or include "CL_SMTG_EMAIL_RENDERER========CP", in "APPLY". The&lt;BR /&gt;main program was "SAPMSSY1".&lt;BR /&gt;&lt;BR /&gt;In the source code, the termination point is in line 55 of include "CL_SMTG_EMAIL_RENDERER========CM001".&lt;BR /&gt;include "CL_SMTG_EMAIL_RENDERER========CM001".&lt;BR /&gt;The termination is due to exception "CX_SMTG_EMAIL_COMMON" occurring in procedure "IF_OO_ADT_CLASSRUN~MAIN" "(METHOD)",&lt;BR /&gt;but not being handled locally there or being declared in the RAISING&lt;BR /&gt;clause.&lt;BR /&gt;The procedure is in program "ZABAP_TEMP=============CP". Its source code begins in line 1 of&lt;BR /&gt;include "ZABAP_TEMP=============CM001".&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Nov 2025 01:56:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-while-sending-email-using-custom-email-template-using-abap-program/qaq-p/14276565</guid>
      <dc:creator>kiran_jakkaraju</dc:creator>
      <dc:date>2025-11-25T01:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: Error while sending  email using custom email template using ABAP program.</title>
      <link>https://community.sap.com/t5/technology-q-a/error-while-sending-email-using-custom-email-template-using-abap-program/qaa-p/14280052#M4932679</link>
      <description>Can you try to handle the exception? CATCH cx_smtg_email_common INTO DATA(lo_stmg_error). Also, is the sales order existing? How did you create the template ZZ1_DEMO_TEMP? Is it based on a pre-delivered template with a CDS data source?</description>
      <pubDate>Fri, 28 Nov 2025 16:06:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-while-sending-email-using-custom-email-template-using-abap-program/qaa-p/14280052#M4932679</guid>
      <dc:creator>rammel_sapdev</dc:creator>
      <dc:date>2025-11-28T16:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Error while sending  email using custom email template using ABAP program.</title>
      <link>https://community.sap.com/t5/technology-q-a/error-while-sending-email-using-custom-email-template-using-abap-program/qaa-p/14282187#M4932883</link>
      <description>&lt;P&gt;&lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/150549"&gt;@rammel_sapdev&lt;/a&gt;Correct, the ZZ1_DEMO_TEMP is based on existing pre-delivered template.&lt;/P&gt;&lt;P&gt;I am passing the Sales Order # required to be shown in the email from the program (just for testing).&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;sales_order_id TYPE VBAK-VBELN VALUE '0000000040'.&lt;/LI-CODE&gt;&lt;P&gt;Mostly I may get the data from actual DB later.&lt;/P&gt;&lt;P&gt;The trycatch for CX_SMTG_EMAIL_COMMON gives same error "No data supplied to render email template"&lt;/P&gt;</description>
      <pubDate>Tue, 02 Dec 2025 15:16:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-while-sending-email-using-custom-email-template-using-abap-program/qaa-p/14282187#M4932883</guid>
      <dc:creator>kiran_jakkaraju</dc:creator>
      <dc:date>2025-12-02T15:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: Error while sending  email using custom email template using ABAP program.</title>
      <link>https://community.sap.com/t5/technology-q-a/error-while-sending-email-using-custom-email-template-using-abap-program/qaa-p/14324750#M4936715</link>
      <description>Have you solved the issue? I assume so, as it seems easy if you know the values of IT_DATA_KEY and IR_DATA of the terminated method CL_SMTG_EMAIL_RENDERER -&amp;gt; APPLY (those are visible in the dump).</description>
      <pubDate>Mon, 09 Feb 2026 20:40:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-while-sending-email-using-custom-email-template-using-abap-program/qaa-p/14324750#M4936715</guid>
      <dc:creator>Filipp</dc:creator>
      <dc:date>2026-02-09T20:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: Error while sending  email using custom email template using ABAP program.</title>
      <link>https://community.sap.com/t5/technology-q-a/error-while-sending-email-using-custom-email-template-using-abap-program/qaa-p/14435372#M4945376</link>
      <description>I am getting error for using if_smtg_email_template interface, saying the use of if_smtg_email_template interface is not permitted. What is the alternative?</description>
      <pubDate>Tue, 07 Jul 2026 13:29:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-while-sending-email-using-custom-email-template-using-abap-program/qaa-p/14435372#M4945376</guid>
      <dc:creator>shubham_booking</dc:creator>
      <dc:date>2026-07-07T13:29:54Z</dc:date>
    </item>
  </channel>
</rss>

