<?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 Open and Close Dataset problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-and-close-dataset-problem/m-p/2770347#M645478</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am facing a weird problem in transferring data to application server.&lt;/P&gt;&lt;P&gt;I have used Open dataset to write my file in text format to the application server.&lt;/P&gt;&lt;P&gt;Now everything works fine when small amount of data is there.When the number of records increases and when it takes lot of time , the format of the text file is completely distorted.&lt;/P&gt;&lt;P&gt;I have used tab as the delimiter. Please suggest me some solution for this.&lt;/P&gt;&lt;P&gt;Is this due to the time taken?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Sep 2007 13:34:08 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-14T13:34:08Z</dc:date>
    <item>
      <title>Open and Close Dataset problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-and-close-dataset-problem/m-p/2770347#M645478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am facing a weird problem in transferring data to application server.&lt;/P&gt;&lt;P&gt;I have used Open dataset to write my file in text format to the application server.&lt;/P&gt;&lt;P&gt;Now everything works fine when small amount of data is there.When the number of records increases and when it takes lot of time , the format of the text file is completely distorted.&lt;/P&gt;&lt;P&gt;I have used tab as the delimiter. Please suggest me some solution for this.&lt;/P&gt;&lt;P&gt;Is this due to the time taken?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Sep 2007 13:34:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-and-close-dataset-problem/m-p/2770347#M645478</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-14T13:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: Open and Close Dataset problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-and-close-dataset-problem/m-p/2770348#M645479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what find data ur using are u text mode or binary mode . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if it currency use binary mode .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;open dataset &amp;lt;name&amp;gt; for input in binary mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at&lt;/P&gt;&lt;P&gt;tranfer itab to dataset.&lt;/P&gt;&lt;P&gt;end loop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Sep 2007 23:27:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-and-close-dataset-problem/m-p/2770348#M645479</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-14T23:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: Open and Close Dataset problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-and-close-dataset-problem/m-p/2770349#M645480</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 am sending you my program in which i am transforing data from excel file to application server &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;by seeing this you can understand very clearly &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if usefull&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;parameter: file_nm type localfile.

types : begin of it_tab1,
        f1(20),
        f2(40),
        f3(20),
       end of it_tab1.


data : it_tab type table of ALSMEX_TABLINE with header line,
       file type rlgrap-filename.

data : it_tab2 type it_tab1 occurs 1,
       wa_tab2 type it_tab1,
       w_message(100)  TYPE c.


at selection-screen on value-request for file_nm.

CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
 EXPORTING
*   PROGRAM_NAME        = SYST-REPID
*   DYNPRO_NUMBER       = SYST-DYNNR
*   FIELD_NAME          = ' '
   STATIC              = 'X'
*   MASK                = ' '
  CHANGING
   file_name           = file_nm
 EXCEPTIONS
   MASK_TOO_LONG       = 1
   OTHERS              = 2
          .
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.


start-of-selection.

refresh it_tab2[].clear wa_tab2.

file = file_nm.

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
  EXPORTING
    filename                      = file
    i_begin_col                   = '1'
    i_begin_row                   =  '1'
    i_end_col                     = '10'
    i_end_row                     = '35'
  tables
    intern                        = it_tab
 EXCEPTIONS
   INCONSISTENT_PARAMETERS       = 1
   UPLOAD_OLE                    = 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.

loop at it_tab.

  case it_tab-col.

   when '002'.

    wa_tab2-f1 = it_tab-value.

   when '004'.

    wa_tab2-f2 = it_tab-value.

  when '008'.

    wa_tab2-f3 = it_tab-value.

 endcase.

 at end of row.

  append wa_tab2 to it_tab2.
 clear wa_tab2.
  endat.

endloop.

data : p_file TYPE  rlgrap-filename value 'TEST3.txt'.


OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
*--- Display error messages if any.
  IF sy-subrc NE 0.
    MESSAGE e001(zsd_mes).
    EXIT.
  ELSE.

*---Data is downloaded to the application server file path
    LOOP AT it_tab2 INTO wa_tab2.
      TRANSFER wa_tab2 TO p_file.
    ENDLOOP.
  ENDIF.

*--Close the Application server file (Mandatory).
  CLOSE DATASET p_file.

 loop at it_tab2 into wa_tab2.

  write : / wa_tab2-f1,wa_tab2-f2,wa_tab2-f3.

 endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Sep 2007 05:21:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-and-close-dataset-problem/m-p/2770349#M645480</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-15T05:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: Open and Close Dataset problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-and-close-dataset-problem/m-p/2770350#M645481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Shankar and Naresh..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have done the program and it is working fine. &lt;/P&gt;&lt;P&gt;I have some headings and data under it which is successfully written on to the application server. But the problem is when the file has large amount of data or when it runs for about more than 10 hours the format gets distorted as in the headings don' t appear, also the data is not in a proper format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So why does this haapens? Can you help me with this if you have encountered some thing like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kruti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Sep 2007 06:42:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-and-close-dataset-problem/m-p/2770350#M645481</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-17T06:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: Open and Close Dataset problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-and-close-dataset-problem/m-p/2770351#M645482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;in the above program , when i had created 1st i had same problem &lt;/P&gt;&lt;P&gt;then i had worte the logic likethis &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameter: file_nm type localfile.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;types : begin of it_tab1,&lt;/P&gt;&lt;P&gt;        f1(20),&lt;/P&gt;&lt;P&gt;        f2(40),&lt;/P&gt;&lt;P&gt;        f3(20),&lt;/P&gt;&lt;P&gt;       end of it_tab1.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;data : it_tab type table of ALSMEX_TABLINE with header line,&lt;/P&gt;&lt;P&gt;       file type rlgrap-filename.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;data : it_tab2 type it_tab1 occurs 1,&lt;/P&gt;&lt;P&gt;       wa_tab2 type it_tab1,&lt;/P&gt;&lt;P&gt;       w_message(100)  TYPE c.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;at selection-screen on value-request for file_nm.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CALL FUNCTION 'KD_GET_FILENAME_ON_F4'&lt;/P&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  PROGRAM_NAME        = SYST-REPID&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  DYNPRO_NUMBER       = SYST-DYNNR&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  FIELD_NAME          = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   STATIC              = 'X'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  MASK                = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CHANGING&lt;/P&gt;&lt;P&gt;   file_name           = file_nm&lt;/P&gt;&lt;P&gt; EXCEPTIONS&lt;/P&gt;&lt;P&gt;   MASK_TOO_LONG       = 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;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;refresh it_tab2[].clear wa_tab2.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;file = file_nm.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    filename                      = file&lt;/P&gt;&lt;P&gt;    i_begin_col                   = '1'&lt;/P&gt;&lt;P&gt;    i_begin_row                   =  '1'&lt;/P&gt;&lt;P&gt;    i_end_col                     = '10'&lt;/P&gt;&lt;P&gt;    i_end_row                     = '35'&lt;/P&gt;&lt;P&gt;  tables&lt;/P&gt;&lt;P&gt;    intern                        = it_tab&lt;/P&gt;&lt;P&gt; EXCEPTIONS&lt;/P&gt;&lt;P&gt;   INCONSISTENT_PARAMETERS       = 1&lt;/P&gt;&lt;P&gt;   UPLOAD_OLE                    = 2&lt;/P&gt;&lt;P&gt;   OTHERS                        = 3&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;&amp;lt;b&amp;gt;loop at it_tab.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  case it_tab-col.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;   when '002'.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    wa_tab2-f1 = it_tab-value.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;   when '004'.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    wa_tab2-f2 = it_tab-value.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  when '008'.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    wa_tab2-f3 = it_tab-value.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; endcase.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; at end of row.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  append wa_tab2 to it_tab2.&lt;/P&gt;&lt;P&gt; clear wa_tab2.&lt;/P&gt;&lt;P&gt;  endat.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;endloop.&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;data : p_file TYPE  rlgrap-filename value 'TEST3.txt'.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.&lt;/P&gt;&lt;P&gt;*--- Display error messages if any.&lt;/P&gt;&lt;P&gt;  IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;    MESSAGE e001(zsd_mes).&lt;/P&gt;&lt;P&gt;    EXIT.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*---Data is downloaded to the application server file path&lt;/P&gt;&lt;P&gt;    LOOP AT it_tab2 INTO wa_tab2.&lt;/P&gt;&lt;P&gt;      TRANSFER wa_tab2 TO p_file.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*--Close the Application server file (Mandatory).&lt;/P&gt;&lt;P&gt;  CLOSE DATASET p_file.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; loop at it_tab2 into wa_tab2.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  write : / wa_tab2-f1,wa_tab2-f2,wa_tab2-f3.&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with the bold letters above &lt;/P&gt;&lt;P&gt;i had wrote that logic for that &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if usefull&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Sep 2007 08:48:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-and-close-dataset-problem/m-p/2770351#M645482</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-17T08:48:41Z</dc:date>
    </item>
  </channel>
</rss>

