Skip to Content
0
Jun 15, 2022 at 03:32 PM

MM Retrieve Material Documents from Archive Object MM_MATBEL

101 Views Last edit Jun 15, 2022 at 03:52 PM 3 rev

Dear All

We are in the process of Archiving the Material movement Inventory transactions.

Though SAP provides standard way of retrieving the archived data through Standard transactions like MIGO, MB5B There are some Z-reports where I need to incorporate this reading logic. Hence I was using the following FMs to read the archive data. However, the functions retrieve only one first record.

Athorization object : MM_MATBEL

Example : if the Archive object has 10 records archived, it fetches the first record only. not all 10.

The FMs I used are -

to get the handle

CALL FUNCTION 'ARCHIVE_GET_NEXT_OBJECT'
       EXPORTING
            archive_handle = lv_handle

To read the table

CALL FUNCTION 'ARCHIVE_GET_TABLE'
       EXPORTING
            archive_handle        =  lv_handle
            record_structure      = 'MKPF'
            all_records_of_object = 'X'
            automatic_conversion  = 'X'
       TABLES
            table                 = lt_mkpf.

In my example, the job 59 has three records archived.

In the above result table lt_mkpf - I was expecting 3 records, but it has only one record that is 1st record only

I do not know where I am missing.

Kindly help

Note : I tried with DO - ENDDO loop also

Please help me