<?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 Data uploading through MOdule pool in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-uploading-through-module-pool/m-p/4981566#M1160751</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       I have a  requirement in module pool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to create a table contol with 2 buttons 1&amp;gt;upload 2&amp;gt; save.&lt;/P&gt;&lt;P&gt;Now when i click on the upload button i can able to access a local file and when select that local file all the data should display on the table control.&lt;/P&gt;&lt;P&gt;After that when i click on the save button the whole data should update in the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Upto now i have created the Table control and able to access the local file by using F4_FILENAME(FM)  in the PAI. Now when i select the local file the the program is going to  exit. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone put some idea on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Baidyanath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Jan 2009 06:43:26 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-01-16T06:43:26Z</dc:date>
    <item>
      <title>Data uploading through MOdule pool</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-uploading-through-module-pool/m-p/4981566#M1160751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       I have a  requirement in module pool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to create a table contol with 2 buttons 1&amp;gt;upload 2&amp;gt; save.&lt;/P&gt;&lt;P&gt;Now when i click on the upload button i can able to access a local file and when select that local file all the data should display on the table control.&lt;/P&gt;&lt;P&gt;After that when i click on the save button the whole data should update in the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Upto now i have created the Table control and able to access the local file by using F4_FILENAME(FM)  in the PAI. Now when i select the local file the the program is going to  exit. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone put some idea on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Baidyanath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 06:43:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-uploading-through-module-pool/m-p/4981566#M1160751</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-16T06:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: Data uploading through MOdule pool</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-uploading-through-module-pool/m-p/4981567#M1160752</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;After taking the file from the system using &lt;STRONG&gt;F4_FILENAME&lt;/STRONG&gt;, use &lt;STRONG&gt;FM GUI_UPLOAD&lt;/STRONG&gt; to populate an internal table of same structure as you have records in the flat file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make a text file with all the records.&lt;/P&gt;&lt;P&gt;Fields separated by tabs and one record in one line.&lt;/P&gt;&lt;P&gt;save this file as &lt;STRONG&gt;.txt&lt;/STRONG&gt; and use this file when using &lt;STRONG&gt;F4_FILENAME&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      FILENAME                     = 'c:\file.txt' "file path/use parameter value here
     FILETYPE                      = 'DAT'
*     HAS_FIELD_SEPARATOR           = ' '
*     HEADER_LENGTH                 = 0
*     READ_BY_LINE                  = 'X'
*     DAT_MODE                      = ' '
*     CODEPAGE                      = ' '
*     IGNORE_CERR                   = ABAP_TRUE
*     REPLACEMENT                   = '#'
*     CHECK_BOM                     = ' '
*     VIRUS_SCAN_PROFILE            =
*     NO_AUTH_CHECK                 = ' '
*   IMPORTING
*     FILELENGTH                    =
*     HEADER                        =
    TABLES
      DATA_TAB                      = it_ekpo
* 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.
* 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;Now in PBO, read this internal table into the table control, and your table control will be populated with the flat file records.&lt;/P&gt;&lt;P&gt;At screen logic:-&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
PROCESS BEFORE OUTPUT.
  MODULE status_8002.

  LOOP WITH CONTROL po_tab. "po_tab is table control
    MODULE pass_data. "pass data to table control form internal table
  ENDLOOP.

PROCESS AFTER INPUT.
  MODULE user_command_8002. "say you get file name here and upload your internal table

  LOOP WITH CONTROL po_tab.
  ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;PBO,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  PASS_DATA  OUTPUT
*&amp;amp;---------------------------------------------------------------------*
MODULE pass_data OUTPUT.
  READ TABLE it_ekpo into wa_ekpo INDEX po_tab-current_line.
ENDMODULE.                 " PASS_DATA  OUTPUT
&lt;/CODE&gt;&lt;/PRE&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;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Tarun Gambhir&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Tarun Gambhir on Jan 16, 2009 12:27 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 06:56:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-uploading-through-module-pool/m-p/4981567#M1160752</guid>
      <dc:creator>I355602</dc:creator>
      <dc:date>2009-01-16T06:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Data uploading through MOdule pool</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-uploading-through-module-pool/m-p/4981568#M1160753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tarun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     I have done like this.&lt;/P&gt;&lt;P&gt;But when i check in the debugging mode.....After the PAI(When the internal table is filled with excel file), program goes out of the module (module user_command_0100)  and exit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here u can see my code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;process before output.
 module status_0100.
   loop  with control tc100.
     module display_data.
   endloop.

process after input.
   module user_command_0100.
   loop  with control tc100.
   endloop. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PBO......&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;module display_data output.

  READ TABLE t_upload into wa_t_upload INDEX TC100-current_line.

endmodule.                 " display_data  OUTPUT &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PAI.......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CASE ok_code.
    WHEN  'UPD'.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
        IMPORTING
          file_name     = file1.


      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                = file1
          i_begin_col             = 1
          i_begin_row             = 1
          i_end_col               = 13
          i_end_row               = 10000
        TABLES
          intern                  = itab1
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          OTHERS                  = 3.
      IF sy-subrc &amp;lt;&amp;gt; 0.

      ENDIF..
     ENDCASE.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check this.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Baidyanath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 07:13:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-uploading-through-module-pool/m-p/4981568#M1160753</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-16T07:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: Data uploading through MOdule pool</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-uploading-through-module-pool/m-p/4981569#M1160754</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;Check in the &lt;STRONG&gt;attributes of the screen&lt;/STRONG&gt;, the value in the &lt;STRONG&gt;next screen&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Give this value as the same screen number you are currently working on.&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;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Tarun Gambhir&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 07:26:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-uploading-through-module-pool/m-p/4981569#M1160754</guid>
      <dc:creator>I355602</dc:creator>
      <dc:date>2009-01-16T07:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: Data uploading through MOdule pool</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-uploading-through-module-pool/m-p/4981570#M1160755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tarun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Thanks for ue reply.&lt;/P&gt;&lt;P&gt;Now i have changed the screen attributes .&lt;/P&gt;&lt;P&gt;but still the problem continues....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do u think my code is correct? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Baidyanath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 08:39:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-uploading-through-module-pool/m-p/4981570#M1160755</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-16T08:39:52Z</dc:date>
    </item>
  </channel>
</rss>

