Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Improving performance inside loop statement for retrieving Archived Data

Former Member
0 Likes
820

Dear Experts,

My requirement is that i need to archive and archived files must be fetched using function modules 'ARCHVE_READ_OBJECT', 'ARCHIVE_GET_NEXT_RECORD', 'ARCHIVE_OPEN_FOR_READ', 'ARCHIVE_GET_NEXT_OBJECT'. These function modules are called inside loop statements which 'ARCHIVE_READ_OBJECT' will return handle based on object, archivekey and archiveofs. 'ARCHIVE_GET_NEXT_RECORD' is used to read records based on handle i got from 'ARCHIVE_READ_OBJECT'. Finally using 'ARCHIVE_OPEN_FOR_READ' is used to open all the other objects and 'ARCHIVE_GET_NEXT_OBJECT' inside do enddo statements to read one by one object to get handle to get further records using 'ARCHIVE_GET_NEXT_RECORD'. How to improve the performance of coding inside loop statements when archiving records needs to be fetched based on the function modules above. The problem is that loop statements is time taking and because of it performance issue arises.

Regards,

Nagarajan

4 REPLIES 4
Read only

Former Member
0 Likes
621

I have done something similar, but using a different flow:

ARCHIVE_READ_OBJECT

ARCHIVE_GET_TABLE (for header data)

ARCHIVE_GET_TABLE (for item data)

ARCHIVE_CLOSE_FILE

Rob

Read only

0 Likes
621

Hi Rob,

Thanks for ur immediate reply. Can u send me a sample code as how to use the function modules for retrieving header and items. Or any Standard SAP Programs available.

Regards,

Nagarajan

Read only

Former Member
0 Likes
621

Dear Rob,

Can u plz send me a sample code as to how to use function modules 'ARCHIVE_READ_OBJECT', 'ARCHIVE_GET_TABLE' for header and item.

Regards,

Nagarajan

Read only

0 Likes
621

These FMs are all documented. You can also do a where used list to see how SAP uses them. So try coding it yourself, and if you still have problems, then get back to the forum.

Rob