<?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: syntax in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax/m-p/2680243#M619398</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mithun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can pass a record to a file using GUI_DOWNLOAD function module in case of presenation server and you will use TRANSFER statement in case of application server file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Aug 2007 12:05:10 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-28T12:05:10Z</dc:date>
    <item>
      <title>syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax/m-p/2680238#M619393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;which is a statement used to write a record to a file in ABAP?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 11:53:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax/m-p/2680238#M619393</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-28T11:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax/m-p/2680239#M619394</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;If the file is present in the presentation server use gui_download fm, or incase present at application server use open dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Navneeth K.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 11:56:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax/m-p/2680239#M619394</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-28T11:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax/m-p/2680240#M619395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If it is application server :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRANSFER&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLOSE DATASET.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can read the documentation on them for more info.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 11:57:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax/m-p/2680240#M619395</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-28T11:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax/m-p/2680241#M619396</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;Syntax &lt;/P&gt;&lt;P&gt;TRANSFER dobj TO dset [LENGTH len] &lt;/P&gt;&lt;P&gt;                      [NO END OF LINE]. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Extras: &lt;/P&gt;&lt;P&gt;1. ... LENGTH len &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. ... NO END OF LINE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This statement passes the content of data object dobj to the file specified in dset. For dobj, you can specify data objects with elementary data types and flat structures. In Unicode programs, dobj must be character-type if the file was opened as a text file (this restriction does not apply to legacy text files). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dset is expected to be a character-type data object that contains the platform-specific name of the file. The content is written to the file from the current file pointer. After the transfer, the file pointer is positioned after the data that was added. You can use addition LENGTH to restrict the number of characters or bytes transferred &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a Unicode program, the file for writing, appending, or changing must be open. Otherwise, a treatable exception occurs. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the file was not yet opened in a non-Unicode programm, it is implicitly opened using the statement &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET dset FOR OUTPUT IN BINARY MODE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as a binary file for writing. If the system accesses an invalid file, a treatable exception is raised. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Influence of Access Type &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The access type defined in statement OPEN DATASET has the following effect on the transfer: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A file opened for reading using FOR INPUT cannot be written in Unicode programs. In non-Unicode programs, TRANSFER writes in a file opened for reading using FOR INPUT in exactly the same way as a file openedfor changing using FOR UPDATE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a file opened for writing using FOROUTPUT, the system writes to the file from the current file pointer. If the file pointer is positioned after the current start of the file, the file is pre-filled with hexadecimal 0 from the start of the file to the file pointer. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a file opened for appending using FOR APPENDING, the system writes to the file from the current file pointer, which is always at the end of the file. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a file opened for changing using FOR UPDATE, the system writes to the file from the current file pointer. If the file pointer is positioned after the end of the file, the file is pre-filled with hexadecimal 0 between the end of the file and the file pointer position. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;Prior to release 6.10: If parts of a file were to be overwritten, it was only possible to write to a file opened for reading. This is not allowed in Unicode programs. As of release 6.10 and later, you can open a file for changing which is the recommended procedure also for non-Unicode programs. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Influence of Storage Type &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The transfer depends on the storage type used when the file is opened using the statement OPEN DATASET. If the specified storage type requires conversion, it is carried out before the write process. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the file was opened as a text file or a legacy text file, the trailing blank characters are deleted for all data objects, except for those of data type string. The line end marker defined when the file was opened is then added to the remaining content of the data object or to the result of the conversion, and the final result is written byte-by-byte to the file. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As of release 6.40, the appending of the end of line separator can be prevented using NO END OF LINE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the file was opened as a binary file or a legacy binary file, the content of the data object or the result of the conversion is written byte-by-byte to the file. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;Only character-type data objects should be written to text files. Only byte-type data objects should be written to binary files. To store numerical data objects or mixed structures, we recommend that you assign them to character-type or byte-type typed field symbols using the CASTING addition of the statement ASSIGN and save these field symbols. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 1 &lt;/P&gt;&lt;P&gt;... LENGTH len &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This addition determines how many characters or how many bytes of data object dobj are written to the file. len is expected to be a data object of type i that contains the number of characters or bytes. In text files, the content of len specifies the number of characters that are written from the storage. For binary files, legacy text file, and legacy binary files, len specifies the number of bytes that are written to the file. The first len characters or bytes are transferred and alignment gaps are included in the structures. If the addition LENGTH is not specified, all characters or bytes are transferred. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the value of len is less than or equal to 0, no characters or bytes are transferred. If the file is opened as a (legacy) text file, however, a line end marker is inserted into the file by default. If the value of len is greater than the number of characters or bytes in dobj, hexadecimal 0 or blank characters are transferred to the file instead of the missing bytes or characters, depending on whether the file was opened as a (legacy) text file or a (legacy) binary file. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 2 &lt;/P&gt;&lt;P&gt;... NO END OF LINE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This addition has the effect that no end of line separator is appended to the data transferred in text files or legacy text files. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;The binary data from database table SPFLI is transferred to a binary file flights.dat. The structure of the table rows transferred contains both character-type and numerical fields. Since the type-specific storage of mixed structures in files is not possible, the binary content of the structure is directly accessed using a typed field symbol . To attain the same result, you can directly transfer the structure wa, the recommended procedure is to use the field symbol, however, because it explicitly transfers a binary data type to a binary file. This type of storage is only recommended for short-term storage within the same system, because the byte-type content depends on the byte sequence and the current system code page. For long-term storage or for exchanging between systems, the data should be converted to character-type containers and stored as a text file. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: file TYPE string VALUE `flights.dat`, &lt;/P&gt;&lt;P&gt;      wa   TYPE spfli. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS TYPE x. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET file FOR OUTPUT IN BINARY MODE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * &lt;/P&gt;&lt;P&gt;       FROM spfli &lt;/P&gt;&lt;P&gt;       INTO wa. &lt;/P&gt;&lt;P&gt;  ASSIGN wa TO CASTING. &lt;/P&gt;&lt;P&gt;  TRANSFER TO file. &lt;/P&gt;&lt;P&gt;ENDSELECT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLOSE DATASET file. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exceptions &lt;/P&gt;&lt;P&gt;Catchable Exceptions &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CX_SY_CODEPAGE_CONVERTER_INIT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cause: The requested conversion is not supported (for example, due to the specification of a language that is not supported for the conversion using SET LOCALE LANGUAGE). &lt;/P&gt;&lt;P&gt;Runtime Error: CONVT_CODEPAGE_INIT (catchable) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CX_SY_CONVERSION_CODEPAGE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cause: Conversion is not possible. &lt;/P&gt;&lt;P&gt;Runtime Error: CONVT_CODEPAGE (catchable) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CX_SY_FILE_AUTHORITY &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cause: No authorization to access the file. &lt;/P&gt;&lt;P&gt;Runtime Error: OPEN_DATASET_NO_AUTHORITY (catchable) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CX_SY_FILE_IO &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cause: Error during writing to file. &lt;/P&gt;&lt;P&gt;Runtime Error: DATASET_WRITE_ERROR (catchable) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CX_SY_FILE_OPEN &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cause: File cannot be opened. &lt;/P&gt;&lt;P&gt;Runtime Error: DATASET_CANT_OPEN (catchable) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CX_SY_FILE_OPEN_MODE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cause: The file was opened in a Unicode program using OPEN DATASET ... FOR INPUT. Therefore, it cannot be written. You should use the addition FOR UPDATE or FOR OUTPUT to open the file. &lt;/P&gt;&lt;P&gt;Runtime Error: DATASET_READ_ONLY (catchable) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CX_SY_PIPE_REOPEN &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cause: The file was opened using the addition FILTER and since then a switch of the work process took place &lt;/P&gt;&lt;P&gt;Runtime Error: DATASET_PIPE_CLOSED &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CX_SY_TOO_MANY_FILES &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cause: The maximum number of open files is exceeded. &lt;/P&gt;&lt;P&gt;Runtime Error: DATASET_TOO_MANY_FILES (catchable)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 11:59:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax/m-p/2680241#M619396</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-28T11:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax/m-p/2680242#M619397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If this mean download here is to options&lt;/P&gt;&lt;P&gt;GUI_download.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;filename = lf_fname&lt;/P&gt;&lt;P&gt;filetype = 'ASC'&lt;/P&gt;&lt;P&gt;append = ' '&lt;/P&gt;&lt;P&gt;write_field_separator = 'X'&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;data_tab = lt_kna1.&lt;/P&gt;&lt;P&gt;IF sy-subrc EQ 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display the uploaded data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;LOOP AT lt_kna1 INTO lw_kna1.&lt;/P&gt;&lt;P&gt;WRITE:/ lw_kna1.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------" /&gt;&lt;P&gt;DATASET.&lt;/P&gt;&lt;P&gt;*&amp;amp; Writing Data to Files : *&lt;/P&gt;&lt;P&gt;*&amp;amp; To write data to a file on the application server, use the TRANSFER *&lt;/P&gt;&lt;P&gt;*&amp;amp; statement: *&lt;/P&gt;&lt;P&gt;*&amp;amp; TRANSFER &amp;lt;f&amp;gt; to &amp;lt;dsn&amp;gt; [LENGTH &amp;lt;len&amp;gt;].&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 12:04:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax/m-p/2680242#M619397</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-28T12:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax/m-p/2680243#M619398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mithun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can pass a record to a file using GUI_DOWNLOAD function module in case of presenation server and you will use TRANSFER statement in case of application server file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 12:05:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax/m-p/2680243#M619398</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-28T12:05:10Z</dc:date>
    </item>
  </channel>
</rss>

