<?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 problem with function gui_upload - getting error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-function-gui-upload-getting-error/m-p/4862818#M1137030</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;when i execute this function i got a error:&lt;/P&gt;&lt;P&gt;"Access via 'NULL' object reference not possible"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what is that mean?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my code is this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of ztemp,&lt;/P&gt;&lt;P&gt;text type string,&lt;/P&gt;&lt;P&gt;end of ztemp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: itab standard table of ztemp.&lt;/P&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 = 'c:\dana\test.txt'&lt;/P&gt;&lt;P&gt;filetype = 'ASC'&lt;/P&gt;&lt;P&gt;tables&lt;/P&gt;&lt;P&gt;data_tab = itab&lt;/P&gt;&lt;P&gt;exceptions&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;thank you,&lt;/P&gt;&lt;P&gt;dana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 23 Nov 2008 07:25:37 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-11-23T07:25:37Z</dc:date>
    <item>
      <title>problem with function gui_upload - getting error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-function-gui-upload-getting-error/m-p/4862818#M1137030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;when i execute this function i got a error:&lt;/P&gt;&lt;P&gt;"Access via 'NULL' object reference not possible"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what is that mean?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my code is this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of ztemp,&lt;/P&gt;&lt;P&gt;text type string,&lt;/P&gt;&lt;P&gt;end of ztemp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: itab standard table of ztemp.&lt;/P&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 = 'c:\dana\test.txt'&lt;/P&gt;&lt;P&gt;filetype = 'ASC'&lt;/P&gt;&lt;P&gt;tables&lt;/P&gt;&lt;P&gt;data_tab = itab&lt;/P&gt;&lt;P&gt;exceptions&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;thank you,&lt;/P&gt;&lt;P&gt;dana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Nov 2008 07:25:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-function-gui-upload-getting-error/m-p/4862818#M1137030</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-23T07:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: problem with function gui_upload - getting error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-function-gui-upload-getting-error/m-p/4862819#M1137031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi dana,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Basically you have to capture the exceptions. then you will get the correct error.&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;At that above issue will not come.&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plz try this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  YTEST                         .

DATA: W_TEXTOUT LIKE T100-TEXT.

TYPES: BEGIN OF ZTEMP,
TEXT TYPE STRING,
END OF ZTEMP.

DATA: ITAB TYPE STANDARD TABLE OF ZTEMP.

CALL FUNCTION 'GUI_UPLOAD'
  EXPORTING
    FILENAME                      = 'c:\dana\test.txt'
    FILETYPE                      = 'ASC'
*   HAS_FIELD_SEPARATOR           = ' '
*   HEADER_LENGTH                 = 0
*   READ_BY_LINE                  = 'X'
*   DAT_MODE                      = ' '
*   CODEPAGE                      = ' '
*   IGNORE_CERR                   = ABAP_TRUE
*   REPLACEMENT                   = '#'
*   CHECK_BOM                     = ' '
*   VIRUS_SCAN_PROFILE            =
* IMPORTING
*   FILELENGTH                    =
*   HEADER                        =
  TABLES
    DATA_TAB                      = ITAB
 EXCEPTIONS
   FILE_OPEN_ERROR               = 1
   FILE_READ_ERROR               = 2
   NO_BATCH                      = 3
   GUI_REFUSE_FILETRANSFER       = 4
   INVALID_TYPE                  = 5
   NO_AUTHORITY                  = 6
   UNKNOWN_ERROR                 = 7
   BAD_DATA_FORMAT               = 8
   HEADER_NOT_ALLOWED            = 9
   SEPARATOR_NOT_ALLOWED         = 10
   HEADER_TOO_LONG               = 11
   UNKNOWN_DP_ERROR              = 12
   ACCESS_DENIED                 = 13
   DP_OUT_OF_MEMORY              = 14
   DISK_FULL                     = 15
   DP_TIMEOUT                    = 16
   OTHERS                        = 17
          .
IF SY-SUBRC &amp;lt;&amp;gt; 0.

  CALL FUNCTION 'MESSAGE_TEXT_BUILD'
    EXPORTING
      MSGID               = SY-MSGID
      MSGNR               = SY-MSGNO
      MSGV1               = SY-MSGV1
      MSGV2               = SY-MSGV2
      MSGV3               = SY-MSGV3
      MSGV4               = SY-MSGV4
    IMPORTING
      MESSAGE_TEXT_OUTPUT = W_TEXTOUT.

  IF SY-SUBRC = 0.
    WRITE W_TEXTOUT.
  ENDIF.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anver&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Anversha s on Nov 23, 2008 1:02 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Nov 2008 07:31:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-function-gui-upload-getting-error/m-p/4862819#M1137031</guid>
      <dc:creator>anversha_s</dc:creator>
      <dc:date>2008-11-23T07:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: problem with function gui_upload - getting error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-function-gui-upload-getting-error/m-p/4862820#M1137032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i tried that and its not working because there is a dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i run this function in bsp application (hrrcf_app_e_ext)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in class: cl_hrrcf_app_e_ext_appl_data_m&lt;/P&gt;&lt;P&gt;in method: save_attachments&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i run this code in a y_test program its work fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maybe its not aloud to execute this program in that method?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there other function that do the same that meybe i can use?&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;thank you very much,&lt;/P&gt;&lt;P&gt;dana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Nov 2008 07:42:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-function-gui-upload-getting-error/m-p/4862820#M1137032</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-23T07:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: problem with function gui_upload - getting error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-function-gui-upload-getting-error/m-p/4862821#M1137033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  Use this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPES:  BEGIN OF T_TAB,
        MATNR   LIKE ZMARA-MATNR,
        ERSDA  LIKE ZMARA-ERSDA,
        ERNAM  LIKE ZMARA-ERNAM,
        END OF T_TAB.

DATA :  T_UPLOAD  TYPE STANDARD TABLE OF T_TAB WITH HEADER LINE ,
              IT_RAW TYPE TRUXS_T_TEXT_DATA.  "work table internal table


* Uploading the data in the file into internal table
  CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
  EXPORTING
*   I_FIELD_SEPERATOR =
*   I_LINE_HEADER  = 'X'
    I_TAB_RAW_DATA = IT_RAW
    I_FILENAME     = P_FILE
  TABLES
    I_TAB_CONVERTED_DATA = T_UPLOAD[]
  EXCEPTIONS
    CONVERSION_FAILED = 1
    OTHERS            = 2.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Krishna..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Nov 2008 03:10:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-function-gui-upload-getting-error/m-p/4862821#M1137033</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-24T03:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: problem with function gui_upload - getting error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-function-gui-upload-getting-error/m-p/4862822#M1137034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dana Touty,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, enter your records into your excel file and then save as TEXT DELIMITED (save as type).&lt;/P&gt;&lt;P&gt;This will result in a text file with your records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, use this code to upload your text file data into internal table.&lt;/P&gt;&lt;P&gt;Its working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use header for the name of the columns in your excel file then remember to delete the first row from the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ZTG_VENDRP&lt;/P&gt;&lt;P&gt;       NO STANDARD PAGE HEADING LINE-SIZE 255.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES : BEGIN OF VENDOR,&lt;/P&gt;&lt;P&gt;        LIFNR LIKE RF02K-LIFNR,&lt;/P&gt;&lt;P&gt;        BUKRS LIKE RF02K-BUKRS,&lt;/P&gt;&lt;P&gt;        EKORG LIKE RF02K-EKORG,&lt;/P&gt;&lt;P&gt;        KTOKK LIKE RF02K-KTOKK,&lt;/P&gt;&lt;P&gt;        ANRED LIKE LFA1-ANRED,&lt;/P&gt;&lt;P&gt;        NAME1 LIKE LFA1-NAME1,&lt;/P&gt;&lt;P&gt;        SORTL LIKE LFA1-SORTL,&lt;/P&gt;&lt;P&gt;        LAND1 LIKE LFA1-LAND1,&lt;/P&gt;&lt;P&gt;        SPRAS LIKE LFA1-SPRAS,&lt;/P&gt;&lt;P&gt;        WAERS LIKE LFM1-WAERS,&lt;/P&gt;&lt;P&gt;        END OF VENDOR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : VENDOR_TAB TYPE STANDARD TABLE OF VENDOR INITIAL SIZE 10 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&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                     = 'c:\vendors.txt'&lt;/P&gt;&lt;P&gt;     FILETYPE                      = 'DAT'&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      DATA_TAB                      = VENDOR_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;This will populate your internal table with all the records.&lt;/P&gt;&lt;P&gt;Now, you can manipulate this data as per your requirements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this solves your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Tarun Gambhir.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Nov 2008 04:10:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-function-gui-upload-getting-error/m-p/4862822#M1137034</guid>
      <dc:creator>I355602</dc:creator>
      <dc:date>2008-11-24T04:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: problem with function gui_upload - getting error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-function-gui-upload-getting-error/m-p/4862823#M1137035</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;You are using TXT file to upload the data, Use DAT as filetype in FM instead of ASC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try This.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Nov 2008 04:16:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-function-gui-upload-getting-error/m-p/4862823#M1137035</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-24T04:16:51Z</dc:date>
    </item>
  </channel>
</rss>

