<?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: Write/Read /Delete Programs-Data Archiving in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-read-delete-programs-data-archiving/m-p/5573174#M1271259</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this code&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: handle like sy-tabix,
buffer type arc_buffer,
sbook_wa like sbook,
number_of_records_read type i.

* open existing archive files
call function 'ARCHIVE_OPEN_FOR_READ'
exporting
object = 'BC_SBOOK01'
importing
archive_handle = handle
exceptions
others = 1.

if sy-subrc 0.
write: / 'No file can be accessed'(001).
stop.
endif.

clear number_of_records_read.
* loop to get the next data object from the archive file(s)
do.
call function 'ARCHIVE_GET_NEXT_OBJECT'
exporting
archive_handle = handle
exceptions
end_of_file = 1
others = 2.
if sy-subrc 0.
exit.
endif.

* get data records from the data container
do.
call function 'ARCHIVE_GET_NEXT_RECORD'
exporting
archive_handle = handle
importing
record = buffer-segment
record_structure = buffer-rname
exceptions
end_of_object = 1
others = 2.
if sy-subrc 0.
exit.
endif.

add 1 to number_of_records_read.
enddo.
enddo.

write: / 'Total number of records read: '(002), number_of_records_read.
skip.
write / 'Last record read: '(003).
skip.
case buffer-rname.
when 'SBOOK'.
sbook_wa = buffer-segment.
write: / 'CARRID :', sbook_wa-carrid,
/ 'BOOKID :', sbook_wa-bookid,
/ 'CONNID :', sbook_wa-connid,
/ 'FLDATE :', sbook_wa-fldate,
/ 'CUSTOMID :', sbook_wa-customid,
/ 'ORDER_DATE:', sbook_wa-order_date,
/ '...'.
* when ...
* If the archive object contained more than one table
* (different buffer-rname), more cases would be needed.
endcase.

* close the archive session
call function 'ARCHIVE_CLOSE_FILE'
exporting
archive_handle = handle.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and also chk this link&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/70be5c63-b9ea-2b10-8dad-b071fcbe09e6" target="test_blank"&gt;https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/70be5c63-b9ea-2b10-8dad-b071fcbe09e6&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Gayathri G on May 7, 2009 7:18 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 May 2009 05:17:47 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-07T05:17:47Z</dc:date>
    <item>
      <title>Write/Read /Delete Programs-Data Archiving</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-read-delete-programs-data-archiving/m-p/5573173#M1271258</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;Can any one provide sample code for write / delete and read programs for data archiving for Z objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;AMAL&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 May 2009 05:15:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-read-delete-programs-data-archiving/m-p/5573173#M1271258</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-07T05:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Write/Read /Delete Programs-Data Archiving</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-read-delete-programs-data-archiving/m-p/5573174#M1271259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this code&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: handle like sy-tabix,
buffer type arc_buffer,
sbook_wa like sbook,
number_of_records_read type i.

* open existing archive files
call function 'ARCHIVE_OPEN_FOR_READ'
exporting
object = 'BC_SBOOK01'
importing
archive_handle = handle
exceptions
others = 1.

if sy-subrc 0.
write: / 'No file can be accessed'(001).
stop.
endif.

clear number_of_records_read.
* loop to get the next data object from the archive file(s)
do.
call function 'ARCHIVE_GET_NEXT_OBJECT'
exporting
archive_handle = handle
exceptions
end_of_file = 1
others = 2.
if sy-subrc 0.
exit.
endif.

* get data records from the data container
do.
call function 'ARCHIVE_GET_NEXT_RECORD'
exporting
archive_handle = handle
importing
record = buffer-segment
record_structure = buffer-rname
exceptions
end_of_object = 1
others = 2.
if sy-subrc 0.
exit.
endif.

add 1 to number_of_records_read.
enddo.
enddo.

write: / 'Total number of records read: '(002), number_of_records_read.
skip.
write / 'Last record read: '(003).
skip.
case buffer-rname.
when 'SBOOK'.
sbook_wa = buffer-segment.
write: / 'CARRID :', sbook_wa-carrid,
/ 'BOOKID :', sbook_wa-bookid,
/ 'CONNID :', sbook_wa-connid,
/ 'FLDATE :', sbook_wa-fldate,
/ 'CUSTOMID :', sbook_wa-customid,
/ 'ORDER_DATE:', sbook_wa-order_date,
/ '...'.
* when ...
* If the archive object contained more than one table
* (different buffer-rname), more cases would be needed.
endcase.

* close the archive session
call function 'ARCHIVE_CLOSE_FILE'
exporting
archive_handle = handle.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and also chk this link&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/70be5c63-b9ea-2b10-8dad-b071fcbe09e6" target="test_blank"&gt;https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/70be5c63-b9ea-2b10-8dad-b071fcbe09e6&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Gayathri G on May 7, 2009 7:18 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 May 2009 05:17:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-read-delete-programs-data-archiving/m-p/5573174#M1271259</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-07T05:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: Write/Read /Delete Programs-Data Archiving</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-read-delete-programs-data-archiving/m-p/5573175#M1271260</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 pick the sample code sbooka .&lt;/P&gt;&lt;P&gt;whrn i ttry to execute Delete operation in SARA transaction, its thrwoing one message 'No data for Selection'.&lt;/P&gt;&lt;P&gt;where i want to check for correcting this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;AMAL.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 May 2009 05:24:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-read-delete-programs-data-archiving/m-p/5573175#M1271260</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-07T05:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: Write/Read /Delete Programs-Data Archiving</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-read-delete-programs-data-archiving/m-p/5573176#M1271261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;inorder for you to delete / archive any data from any object, the following steps needs to be carefully undrtaken :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Configure the Object ( technical settings ) Application specific settings ( if any )&lt;/P&gt;&lt;P&gt;2.Configure the archive/ storage server&lt;/P&gt;&lt;P&gt;3.in SARA, press the WRITE button and input the variant values and save them.&lt;/P&gt;&lt;P&gt;4. then run the write program.&lt;/P&gt;&lt;P&gt;5. run the delete/store program based on ur settings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in this way, u may be able to archive / delete the sap data as per the specs..&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, 08 May 2009 04:05:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-read-delete-programs-data-archiving/m-p/5573176#M1271261</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-08T04:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: Write/Read /Delete Programs-Data Archiving</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-read-delete-programs-data-archiving/m-p/5573177#M1271262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anyone who can help with the above question, please help. I am also will be doing the same thing for my custom tables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 09:46:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-read-delete-programs-data-archiving/m-p/5573177#M1271262</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-13T09:46:23Z</dc:date>
    </item>
  </channel>
</rss>

