Skip to Content
0
Former Member
Mar 31, 2015 at 08:50 AM

Archiving custom database table problem when READ.

64 Views

Hi BigGods,

I encounter a archiving problem. i need archive several custom tables. And In my write program, this is process flow:

LOOP main_itab.

SELECT *

INTO sub_itab1

FROM db1

PACKAGE SIZE p_size(from selection screen)

WHERE....

SELECT * INTO sub_itab2 FROM db2 FOR ENTRIES IN sub_itab1.

CALL FUNCTION 'ARCHIVE_NEW_OBJECT'

EXPORTING

archive_handle = lv_handle.

CALL FUNCTION 'ARCHIVE_PUT_TABLE'

EXPORTING

archive_handle = lv_handle

record_structure = 'DB1'

TABLES

table = sub_itab1.

CALL FUNCTION 'ARCHIVE_PUT_TABLE'

EXPORTING

archive_handle = lv_handle

record_structure = 'DB2'

TABLES

table = sub_itab2.

CALL FUNCTION 'ARCHIVE_SAVE_OBJECT'

EXPORTING

archive_handle = lv_handle.

ENDSELECT.

ENDLOOP.

CALL FUNCTION 'ARCHIVE_WRITE_STATISTICS'

EXPORTING

archive_handle = lv_handle.

* write protocol

CALL FUNCTION 'ARCHIVE_PROTOCOL_WRITE'.

* close archiving session

CALL FUNCTION 'ARCHIVE_CLOSE_FILE'

EXPORTING

archive_handle = lv_handle.

All above 'WRITE' program run with successfully, generated a archive file in server.

After i run my 'DELETE' program, all the related contents in db1 and db2 also be deleted, seems good.

But when i run 'READ' program, only contents in last package be read to show in ALV.

For example, in DB1 totally have 10 rows data, and my p_size set as 7, 'SELECT.... ENDSELECT' will run twice, right.

So only the second run, those last 3 rows can be read in 'READ' program.

If i set p_size as 8, then 2 rows will be read, if greater than 10, then all 10 rows will be read.

I try to download archived file( abcd.archive ) to local using CG3Y to see what structure exactly in this .archive file, but open with unreadable messy code.

I need show all 10 contents in 'READ' program, Any hits to this problem? thank you very much.

Regards,

Archer