<?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 Re: ERROR : CX_SY_REF_IS_INITIAL - When calling a method from a program? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-cx-sy-ref-is-initial-when-calling-a-method-from-a-program/m-p/12068223#M1969867</link>
    <description>&lt;P&gt;Which line (method call) are you getting this exception at?&lt;/P&gt;</description>
    <pubDate>Wed, 20 Nov 2019 08:39:53 GMT</pubDate>
    <dc:creator>Mithun_Kr</dc:creator>
    <dc:date>2019-11-20T08:39:53Z</dc:date>
    <item>
      <title>ERROR : CX_SY_REF_IS_INITIAL - When calling a method from a program?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-cx-sy-ref-is-initial-when-calling-a-method-from-a-program/m-p/12068222#M1969866</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;I am trying to call a method which is used to trigger mail .I am getting the above exception.

DATA : sendrequest TYPE REF TO cl_bcs.

DATA : myrecipient TYPE REF TO cl_cam_address_bcs.

DATA : email_text TYPE bcsy_text.

DATA : exref TYPE REF TO CX_ADDRESS_BCS.

DATA : EXREF2 TYPE REF TO CX_SEND_REQ_BCS.

DATA : EXREF3 TYPE REF TO CX_DOCUMENT_BCS.

DATA : EXREF4 TYPE REF TO CX_SY_REF_IS_INITIAL.



DATA: sender_emailaddress TYPE REF TO if_sender_bcs.

DATA : email_text_final TYPE C.

DATA : mail TYPE String.

DATA : document TYPE REF TO cl_document_bcs."Data types for Mail sending

DATA :emal_cont TYPE bcsy_text.



*      WRITE DLMAIL.

*      CONCATENATE   DLMAIL  INTO MAIL.

      data: input_dl TYPE ADR6-SMTP_ADDR.

      input_dl = DLMAIL.

      TRY.

      MYRECIPIENT = cl_cam_address_bcs=&amp;gt;create_internet_address( 'email1' ).

      SENDER_EMAILADDRESS = CL_CAM_ADDRESS_BCS=&amp;gt;CREATE_INTERNET_ADDRESS('email 2').

      CALL METHOD sendrequest-&amp;gt;ADD_RECIPIENT

      EXPORTING

      i_recipient = MYRECIPIENT.

      



      document = cl_document_bcs=&amp;gt;create_document(

      I_TYPE = 'RAW'

      I_TEXT =  MAIL_TEXT

      I_SUBJECT = ' Notification' ).



      CALL METHOD SENDREQUEST-&amp;gt;SET_DOCUMENT( document ).

      CALL METHOD SENDREQUEST-&amp;gt;SET_SENDER( SENDER_EMAILADDRESS ).

                 " WRITE ccount.

      sendrequest-&amp;gt;send( ).

      CATCH CX_ADDRESS_BCS INTO EXREF.

       " WRITE EXREF-&amp;gt;GET_TEXT().

        WRITE 'CX ADDRESS BCS ERROR'.

      CATCH CX_SEND_REQ_BCS INTO EXREF2.

        "WRITE EXREF2-&amp;gt;GET_TEXT().

       WRITE 'ERROR 2'.

      CATCH CX_DOCUMENT_BCS INTO EXREF3.

        "WRITE EXREF3-&amp;gt;GET_TEXT().

        WRITE 'ERROR3'.

      CATCH CX_SY_REF_IS_INITIAL INTO EXREF4.

        WRITE 'ERROR 4'.

      

"                Raising CX_SY_REF_IS_INITIAL.

       ENDTRY.

      COMMIT WORK.

      SUBMIT RSCONN01 with mode = 'INT' with output = 'X' AND RETURN.

  endmethod.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Nov 2019 08:32:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-cx-sy-ref-is-initial-when-calling-a-method-from-a-program/m-p/12068222#M1969866</guid>
      <dc:creator>former_member798</dc:creator>
      <dc:date>2019-11-20T08:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR : CX_SY_REF_IS_INITIAL - When calling a method from a program?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-cx-sy-ref-is-initial-when-calling-a-method-from-a-program/m-p/12068223#M1969867</link>
      <description>&lt;P&gt;Which line (method call) are you getting this exception at?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2019 08:39:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-cx-sy-ref-is-initial-when-calling-a-method-from-a-program/m-p/12068223#M1969867</guid>
      <dc:creator>Mithun_Kr</dc:creator>
      <dc:date>2019-11-20T08:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR : CX_SY_REF_IS_INITIAL - When calling a method from a program?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-cx-sy-ref-is-initial-when-calling-a-method-from-a-program/m-p/12068224#M1969868</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;CALLMETHOD sendrequest-&amp;gt;ADD_RECIPIENT&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Nov 2019 08:51:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-cx-sy-ref-is-initial-when-calling-a-method-from-a-program/m-p/12068224#M1969868</guid>
      <dc:creator>former_member798</dc:creator>
      <dc:date>2019-11-20T08:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR : CX_SY_REF_IS_INITIAL - When calling a method from a program?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-cx-sy-ref-is-initial-when-calling-a-method-from-a-program/m-p/12068225#M1969869</link>
      <description>&lt;P&gt;Instantiation of the send request object is missing:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;sendrequest = cl_bcs=&amp;gt;create_persistent( ).&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Nov 2019 08:58:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-cx-sy-ref-is-initial-when-calling-a-method-from-a-program/m-p/12068225#M1969869</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-11-20T08:58:31Z</dc:date>
    </item>
  </channel>
</rss>

