<?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: Function module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/2665299#M615089</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can not upload an XLS file using GUI_UPLOAD. Please use following FM to upload XLS files:\&lt;/P&gt;&lt;P&gt;UPLOAD fm is the old function module which is now obsolete. From 4.6C onwards SAP has delivered new FM's for uploading and that is GUI_UPLOAD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the diff is UPLOAD pops up a box during runtime to accept the file path the GUI_UPLOAD does not pop up any box during runtime instead takes the path as a paramter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what SAP HELP SAYS&lt;/P&gt;&lt;P&gt;Files on the Presentation Server &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WS_UPLOAD and WS_DOWNLOAD, the function modules used until now are not part of the standard set of ABAP commands. They are used to display the file interface on the presentation server. WS_UPLOAD and WS_DOWNLOAD are not compatible with USs and have been replaced by GUI_UPLOAD and GUI_DOWNLOAD. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The new function modules, GUI_UPLOAD and GUI_DOWNLOAD, have an interface that also allows you to write Unicode format to the local hard drive. For a description of these interfaces, refer to the documentation for each function module, available under SAP Easy Access " Development " Function Builder " Goto " Documentation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of using the function modules, you can use the static methods GUI_UPLOAD and GUI_DOWNLOAD of the global class CL_GUI_FRONTEND_SERVICES.&lt;/P&gt;&lt;P&gt;FORM GUI_UPLOAD .&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'GUI_UPLOAD'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;FILENAME = 'C:\siva\bdcflatfile.TXT'&lt;/P&gt;&lt;P&gt;FILETYPE = 'ASC'&lt;/P&gt;&lt;P&gt;HAS_FIELD_SEPARATOR = 'X'&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;DATA_TAB = IT_TAB&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;&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;FAA_FILE_UPLOAD_EXCEL&lt;/P&gt;&lt;P&gt;TEXT_CONVERT_XLS_TO_SAP&lt;/P&gt;&lt;P&gt;ALSM_EXCEL_TO_INTERNAL_TABLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In ALSM_EXCEL_TO_INTERNAL_TABL, you have to format the uploaded date before using it. So, use FAA_FILE_UPLOAD_EXCEL which internally calls ALSM_EXCEL_TO_INTERNAL_TABL, formats data and gives back formatted data in an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, use '\' instead of '/' in C:/myfile.xls'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also call a FM 'F4_FILENAME' to get the file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Aug 2007 04:38:24 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-14T04:38:24Z</dc:date>
    <item>
      <title>Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/2665295#M615085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  What is the Function module to get the file from desktop through program?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2007 04:34:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/2665295#M615085</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-14T04:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/2665296#M615086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;gui_upload&lt;/P&gt;&lt;P&gt;ws_upload&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2007 04:36:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/2665296#M615086</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-14T04:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/2665297#M615087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Uday.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of itab_string occurs 0,&lt;/P&gt;&lt;P&gt;      record type char255,&lt;/P&gt;&lt;P&gt;      end of itab_string.&lt;/P&gt;&lt;P&gt;data:  L_FILETABLE TYPE FILETABLE,&lt;/P&gt;&lt;P&gt;L_FILETAB_H TYPE FILETABLE WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: p_file1 type string.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;selection screen .&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;PARAMETERS: P_FILE TYPE LOCALFILE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;initialization.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at selection-screen on value-request for P_FILE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; IF THE USER SELECT EXTENTION BUTTON IT WILL OPEN THE LOCAL DIRECTORY FOR SELECTING THE FILE LOCATION.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL METHOD CL_GUI_FRONTEND_SERVICES=&amp;gt;FILE_OPEN_DIALOG&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   WINDOW_TITLE            =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   DEFAULT_EXTENSION       = 'CSV'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   DEFAULT_FILENAME        = 'C:\Documents and Settings\196093\Desktop\STATUS.csv'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   FILE_FILTER             =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   INITIAL_DIRECTORY        = 'C:\Documents and Settings\196093\Desktop\'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   MULTISELECTION          =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   WITH_ENCODING           =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CHANGING&lt;/P&gt;&lt;P&gt;    FILE_TABLE              = L_FILETABLE&lt;/P&gt;&lt;P&gt;    RC                      = RC&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   USER_ACTION             =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   FILE_ENCODING           =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  EXCEPTIONS&lt;/P&gt;&lt;P&gt;    FILE_OPEN_DIALOG_FAILED = 1&lt;/P&gt;&lt;P&gt;    CNTL_ERROR              = 2&lt;/P&gt;&lt;P&gt;    ERROR_NO_GUI            = 3&lt;/P&gt;&lt;P&gt;    NOT_SUPPORTED_BY_GUI    = 4&lt;/P&gt;&lt;P&gt;    others                  = 5&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;&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT l_filetable INTO L_FILETAB_H.&lt;/P&gt;&lt;P&gt;P_FILE = L_FILETAB_H-FILENAME.&lt;/P&gt;&lt;P&gt;move p_file to p_file1.&lt;/P&gt;&lt;P&gt;EXIT.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;passing the selected file name to gui_upload for loading the data&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;into internal table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'GUI_UPLOAD'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    FILENAME                      = p_file1&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  FILETYPE                      = 'ASC'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  HAS_FIELD_SEPARATOR           = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  HEADER_LENGTH                 = 0&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  READ_BY_LINE                  = 'X'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  DAT_MODE                      = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  CODEPAGE                      = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  IGNORE_CERR                   = ABAP_TRUE&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  REPLACEMENT                   = '#'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  CHECK_BOM                     = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  NO_AUTH_CHECK                 = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  FILELENGTH                    =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  HEADER                        =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    DATA_TAB                      = itab_string&lt;/P&gt;&lt;P&gt; EXCEPTIONS&lt;/P&gt;&lt;P&gt;   FILE_OPEN_ERROR               = 1&lt;/P&gt;&lt;P&gt;   FILE_READ_ERROR               = 2&lt;/P&gt;&lt;P&gt;   NO_BATCH                      = 3&lt;/P&gt;&lt;P&gt;   GUI_REFUSE_FILETRANSFER       = 4&lt;/P&gt;&lt;P&gt;   INVALID_TYPE                  = 5&lt;/P&gt;&lt;P&gt;   NO_AUTHORITY                  = 6&lt;/P&gt;&lt;P&gt;   UNKNOWN_ERROR                 = 7&lt;/P&gt;&lt;P&gt;   BAD_DATA_FORMAT               = 8&lt;/P&gt;&lt;P&gt;   HEADER_NOT_ALLOWED            = 9&lt;/P&gt;&lt;P&gt;   SEPARATOR_NOT_ALLOWED         = 10&lt;/P&gt;&lt;P&gt;   HEADER_TOO_LONG               = 11&lt;/P&gt;&lt;P&gt;   UNKNOWN_DP_ERROR              = 12&lt;/P&gt;&lt;P&gt;   ACCESS_DENIED                 = 13&lt;/P&gt;&lt;P&gt;   DP_OUT_OF_MEMORY              = 14&lt;/P&gt;&lt;P&gt;   DISK_FULL                     = 15&lt;/P&gt;&lt;P&gt;   DP_TIMEOUT                    = 16&lt;/P&gt;&lt;P&gt;   OTHERS                        = 17&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 I000(Z00) WITH 'PLEASE PROVIDE CORRECT FILE NAME'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward points to all helpful answers &lt;/P&gt;&lt;P&gt;kiran.M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2007 04:37:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/2665297#M615087</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-14T04:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/2665298#M615088</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;U can Use &amp;lt;b&amp;gt;GUI_UPLOAD&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Padmam.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2007 04:38:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/2665298#M615088</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-14T04:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/2665299#M615089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can not upload an XLS file using GUI_UPLOAD. Please use following FM to upload XLS files:\&lt;/P&gt;&lt;P&gt;UPLOAD fm is the old function module which is now obsolete. From 4.6C onwards SAP has delivered new FM's for uploading and that is GUI_UPLOAD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the diff is UPLOAD pops up a box during runtime to accept the file path the GUI_UPLOAD does not pop up any box during runtime instead takes the path as a paramter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what SAP HELP SAYS&lt;/P&gt;&lt;P&gt;Files on the Presentation Server &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WS_UPLOAD and WS_DOWNLOAD, the function modules used until now are not part of the standard set of ABAP commands. They are used to display the file interface on the presentation server. WS_UPLOAD and WS_DOWNLOAD are not compatible with USs and have been replaced by GUI_UPLOAD and GUI_DOWNLOAD. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The new function modules, GUI_UPLOAD and GUI_DOWNLOAD, have an interface that also allows you to write Unicode format to the local hard drive. For a description of these interfaces, refer to the documentation for each function module, available under SAP Easy Access " Development " Function Builder " Goto " Documentation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of using the function modules, you can use the static methods GUI_UPLOAD and GUI_DOWNLOAD of the global class CL_GUI_FRONTEND_SERVICES.&lt;/P&gt;&lt;P&gt;FORM GUI_UPLOAD .&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'GUI_UPLOAD'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;FILENAME = 'C:\siva\bdcflatfile.TXT'&lt;/P&gt;&lt;P&gt;FILETYPE = 'ASC'&lt;/P&gt;&lt;P&gt;HAS_FIELD_SEPARATOR = 'X'&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;DATA_TAB = IT_TAB&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;&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;FAA_FILE_UPLOAD_EXCEL&lt;/P&gt;&lt;P&gt;TEXT_CONVERT_XLS_TO_SAP&lt;/P&gt;&lt;P&gt;ALSM_EXCEL_TO_INTERNAL_TABLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In ALSM_EXCEL_TO_INTERNAL_TABL, you have to format the uploaded date before using it. So, use FAA_FILE_UPLOAD_EXCEL which internally calls ALSM_EXCEL_TO_INTERNAL_TABL, formats data and gives back formatted data in an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, use '\' instead of '/' in C:/myfile.xls'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also call a FM 'F4_FILENAME' to get the file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2007 04:38:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/2665299#M615089</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-14T04:38:24Z</dc:date>
    </item>
  </channel>
</rss>

