<?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: Calling a method in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method/m-p/922822#M59291</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   I have to call a method (save dialogue box) before I download the final table to an excel sheet... I found out that I have to use... CL_GUI_FRONTEND_SERVICE &amp;amp; file_save_dialogue... but what of these have to be used as an instance or class or a method... Please elaborate it...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;-S.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Mar 2005 16:17:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-03-03T16:17:13Z</dc:date>
    <item>
      <title>Calling a method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method/m-p/922818#M59287</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;   I want to use CALL METHOD in my prg for giving a choice for path before I download my final table... How can I call a CALL METHOD in my prg?... which menu or which push button I need to use??..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You,&lt;/P&gt;&lt;P&gt;-S.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2005 15:46:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method/m-p/922818#M59287</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-03T15:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method/m-p/922819#M59288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Click Pattern, click the radiobutton for AABAP Objects patterns, click green check icon.  You will get a dialog, type the name of the instance, the class, and the method, and click the green check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2005 15:53:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method/m-p/922819#M59288</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-03-03T15:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method/m-p/922820#M59289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are calling a static method, then you don't have to fill in the instance field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2005 15:55:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method/m-p/922820#M59289</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-03-03T15:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method/m-p/922821#M59290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  You can call a method by clicking the Patterns button as mentioned by one the Developers above. In that choose the ABAP Objects radiobutton, Then a screen will be displayed with many options like call method, constructor..etc. &lt;/P&gt;&lt;P&gt;For further reference on how to call a method,click the link below...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vara&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2005 16:13:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method/m-p/922821#M59290</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-03T16:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method/m-p/922822#M59291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   I have to call a method (save dialogue box) before I download the final table to an excel sheet... I found out that I have to use... CL_GUI_FRONTEND_SERVICE &amp;amp; file_save_dialogue... but what of these have to be used as an instance or class or a method... Please elaborate it...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;-S.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2005 16:17:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method/m-p/922822#M59291</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-03T16:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method/m-p/922823#M59292</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;  I also wanted to know how can I display the column names in the excel sheet after downlading (GUI_DOWNLOAD) my final table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You,&lt;/P&gt;&lt;P&gt;-S.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2005 17:17:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method/m-p/922823#M59292</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-03T17:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method/m-p/922824#M59293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; I found out that I have to use...&lt;/P&gt;&lt;P&gt;&amp;gt; CL_GUI_FRONTEND_SERVICE &amp;amp; file_save_dialogue... but&lt;/P&gt;&lt;P&gt;&amp;gt; what of these have to be used as an instance or class&lt;/P&gt;&lt;P&gt;&amp;gt; or a method... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure that I understand your question here, but I'll try to help.  Usually with that class, CL_GUI_FRONTEND_SERVICES, I do not bother creating a instance or object of the class.  I usually just call the static method of the class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like so.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

call method cl_gui_frontend_services=&amp;gt;file_save_dialog
*  EXPORTING
*    WINDOW_TITLE      =
*    DEFAULT_EXTENSION =
*    DEFAULT_FILE_NAME =
*    FILE_FILTER       =
*    INITIAL_DIRECTORY =
  changing
    filename          =
    path              =
    fullpath          =
*    USER_ACTION       =
*  EXCEPTIONS
*    CNTL_ERROR        = 1
*    ERROR_NO_GUI      = 2
*    others            = 3
        .
if sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the ABAP objects pattern,  I filled in the CLASS name as CL_GUI_FRONTEND_SERVICES,  then did a drop down on the method field,  selected the method and clicked green check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2005 17:39:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method/m-p/922824#M59293</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-03-03T17:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method/m-p/922825#M59294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And how do I display the column names in the downloaded excel sheet??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-S.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2005 18:55:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method/m-p/922825#M59294</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-03T18:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method/m-p/922826#M59295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are other ways of doing it, but, what I've done in the past is declared my "output" itab as all character fields....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: begin of itab occurs 0,
      field1(50) type c,
      field2(50) type c,
      field3(50) type c,
      end of itab.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then when writing to the output itab, write out the column headings in the first row of the itab.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
clear itab.
itab-field1 = 'Material'.
itab-field2 = 'Plant'.
itab-field3 = 'Description'.
append itab.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then fill in the rest of the itab with your data.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
loop at x.
clear itab.
itab-field1 = x-matnr.
itab-field2 = x-werks.
itab-field3 = x-matkx.
append itab.

endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now use the GUI_DOWNLOAD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2005 19:09:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method/m-p/922826#M59295</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-03-03T19:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method/m-p/922827#M59296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is another example of writing headings to excel, this one actually opens up excel at the same time.  Not sure that this will work for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0002 .

data: begin of itab occurs 0,
      field1(10) type c,
      field2(10) type c,
      field3(10) type c,
      end of itab.

data: begin of itabfn occurs 0,
      fieldname(10) type c,
      end of itabfn.

* Set column headings.
itabfn-fieldname = 'Field 1'.
append itabfn.
itabfn-fieldname = 'Field 2'.
append itabfn.
itabfn-fieldname = 'Field 3'.
append itabfn.

* set data
do 10 times.
  clear itab.
  itab-field1 = 'field1'.
  itab-field2 = 'field2'.
  itab-field3 = 'field3'.
  append itab.
enddo.

call function 'EXCEL_OLE_STANDARD_DAT'
  exporting
    file_name                       = 'C:abapstext'
*   CREATE_PIVOT                    = 0
*   DATA_SHEET_NAME                 = ' '
*   PIVOT_SHEET_NAME                = ' '
*   PASSWORD                        = ' '
*   PASSWORD_OPTION                 = 0
 tables
*   PIVOT_FIELD_TAB                 =
   data_tab                        = itab
   fieldnames                      = itabfn
* EXCEPTIONS
*   FILE_NOT_EXIST                  = 1
*   FILENAME_EXPECTED               = 2
*   COMMUNICATION_ERROR             = 3
*   OLE_OBJECT_METHOD_ERROR         = 4
*   OLE_OBJECT_PROPERTY_ERROR       = 5
*   INVALID_FILENAME                = 6
*   INVALID_PIVOT_FIELDS            = 7
*   DOWNLOAD_PROBLEM                = 8
*   OTHERS                          = 9
          .
if sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2005 19:57:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-a-method/m-p/922827#M59296</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-03-03T19:57:42Z</dc:date>
    </item>
  </channel>
</rss>

