<?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: How to create instance : in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-instance/m-p/4014018#M959104</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think your question is that you do not write anywhere CREATE OBJECT and then how is the instance created or where does it come from?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is so, then it is a singleton concept where the method get_instance make sure that only one instance of the class is returned and you do not end up creating multiple instances.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. If you look at the attribute of the classs you should find a ref object to its own class.&lt;/P&gt;&lt;P&gt;2. In the method get_instance you will see that it checks if this attribute is bound or not and depending on it, it creates/returns the instance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this clarifies your doubt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Saurabh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Jun 2008 12:14:07 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-10T12:14:07Z</dc:date>
    <item>
      <title>How to create instance :</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-instance/m-p/4014016#M959102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai gurues,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                I have one modification project, in that one line is declared like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;              go_infty = cl_hrsen_read_infotype_fmri=&amp;gt;get_instance( ).&lt;/P&gt;&lt;P&gt;     &lt;/P&gt;&lt;P&gt;              Here i don't  know about which one is instance and how it's act etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;"Local Interface:&lt;/P&gt;&lt;P&gt;*"  IMPORTING&lt;/P&gt;&lt;P&gt;*"     VALUE(EMPLOYEE_NO) TYPE  P_PERNR&lt;/P&gt;&lt;P&gt;*"  TABLES&lt;/P&gt;&lt;P&gt;*"      ET_EMP_QUALIFICATION STRUCTURE  ZEMP_QUALIFICATION OPTIONAL&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: go_infty TYPE REF TO if_hrsen_read_infotype.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: gt_prelp_tab TYPE prelp_tab .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: gt_0024 TYPE TABLE OF p0024,&lt;/P&gt;&lt;P&gt;        wa_p0024 TYPE p0024,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        lt_t574b TYPE TABLE OF t574b,&lt;/P&gt;&lt;P&gt;        wa_t574b TYPE t574b,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        lt_t777q TYPE TABLE OF t777q,&lt;/P&gt;&lt;P&gt;        wa_t777q TYPE t777q.&lt;/P&gt;&lt;P&gt;  go_infty = cl_hrsen_read_infotype_fmri=&amp;gt;get_instance( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*---- Fetch the data from p0024----&lt;/P&gt;&lt;HR originaltext="-----------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD go_infty-&amp;gt;read&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      pernr         = employee_no&lt;/P&gt;&lt;P&gt;      infty         = '0024'&lt;/P&gt;&lt;P&gt;      begda         = '18000101'&lt;/P&gt;&lt;P&gt;      endda         = '99991231'&lt;/P&gt;&lt;P&gt;      no_auth_check = space&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      infotype_tab  = gt_prelp_tab&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      e_assertion   = 1&lt;/P&gt;&lt;P&gt;      OTHERS        = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------" /&gt;&lt;P&gt;Type conversion of Pnnnn structures into PRELP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD cl_hr_pnnnn_type_cast=&amp;gt;prelp_to_pnnnn_tab&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      prelp_tab = gt_prelp_tab&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      pnnnn_tab = gt_0024.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------" /&gt;&lt;P&gt;Qualification Names -&lt;/P&gt;&lt;HR originaltext="-------------------------" /&gt;&lt;P&gt;  IF gt_0024[] IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT * FROM t574b INTO TABLE lt_t574b&lt;/P&gt;&lt;P&gt;                  FOR ALL ENTRIES IN gt_0024&lt;/P&gt;&lt;P&gt;                  WHERE quali = gt_0024-quali AND&lt;/P&gt;&lt;P&gt;                        langu = sy-langu.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="--------" /&gt;&lt;P&gt;Proficiency Texts -&lt;/P&gt;&lt;HR originaltext="-------------------------" /&gt;&lt;P&gt;  IF gt_0024[] IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT  * FROM t777q INTO TABLE lt_t777q&lt;/P&gt;&lt;P&gt;                         FOR ALL ENTRIES IN gt_0024&lt;/P&gt;&lt;P&gt;                         WHERE chara = gt_0024-auspr AND&lt;/P&gt;&lt;P&gt;                               langu = sy-langu.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT gt_0024 INTO wa_p0024.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    READ TABLE lt_t574b INTO wa_t574b&lt;/P&gt;&lt;P&gt;                        WITH KEY quali = wa_p0024-quali&lt;/P&gt;&lt;P&gt;                                 langu = sy-langu BINARY SEARCH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    READ TABLE lt_t777q INTO wa_t777q&lt;/P&gt;&lt;P&gt;                        WITH KEY chara = wa_p0024-auspr&lt;/P&gt;&lt;P&gt;                                 langu = sy-langu BINARY SEARCH .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    et_emp_qualification-employeeno  = wa_p0024-pernr.&lt;/P&gt;&lt;P&gt;    et_emp_qualification-startdate   = wa_p0024-begda.&lt;/P&gt;&lt;P&gt;    et_emp_qualification-enddate     = wa_p0024-endda.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  ET_EMP_QUALIFICATION-QUALI_KEY   = wa_p0024-QUALI.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    et_emp_qualification-quali_text  = wa_t574b-qtext.&lt;/P&gt;&lt;P&gt;    et_emp_qualification-proficiency = wa_t777q-chara_text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    APPEND et_emp_qualification TO et_emp_qualification&lt;/P&gt;&lt;P&gt;                                 SORTED BY startdate .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFUNCTION.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jun 2008 12:29:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-instance/m-p/4014016#M959102</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-09T12:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to create instance :</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-instance/m-p/4014017#M959103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;go_infty is your instance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and it's created by:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;go_infty = cl_hrsen_read_infotype_fmri=&amp;gt;get_instance( ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It's used in your program by:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL METHOD go_infty-&amp;gt;read
EXPORTING
pernr = employee_no
infty = '0024'
begda = '18000101'
endda = '99991231'
no_auth_check = space
IMPORTING
infotype_tab = gt_prelp_tab
EXCEPTIONS
e_assertion = 1
OTHERS = 2.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What's the problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jun 2008 12:57:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-instance/m-p/4014017#M959103</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2008-06-09T12:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to create instance :</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-instance/m-p/4014018#M959104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think your question is that you do not write anywhere CREATE OBJECT and then how is the instance created or where does it come from?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is so, then it is a singleton concept where the method get_instance make sure that only one instance of the class is returned and you do not end up creating multiple instances.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. If you look at the attribute of the classs you should find a ref object to its own class.&lt;/P&gt;&lt;P&gt;2. In the method get_instance you will see that it checks if this attribute is bound or not and depending on it, it creates/returns the instance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this clarifies your doubt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Saurabh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jun 2008 12:14:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-instance/m-p/4014018#M959104</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-10T12:14:07Z</dc:date>
    </item>
  </channel>
</rss>

