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

Archiving Object PP_ORDER - Retrieve data

Former Member
0 Likes
1,244

Hi ,

Anyone has example to retrieve archived data from object PP_ORDER? I tried but dunno why it cannot get the data from RESB table. The below is my codes. Please help. Many thanks.


  MOVE v_AUFNR TO l_rsdsselopt-low.
  MOVE 'EQ' TO l_rsdsselopt-option.
  MOVE 'I' TO l_rsdsselopt-sign.
  APPEND l_rsdsselopt TO l_frange-selopt_t.
  APPEND l_frange TO lt_frange.
  CLEAR l_frange.
  REFRESH t_AFKO[].
  CALL FUNCTION 'AS_API_READ'
       EXPORTING
            i_fieldcat          = v_fieldcat
            i_selections        = lt_frange
            i_obligatory_fields = lt_oblfields[]
       IMPORTING
            e_result            = t_AFKO[]
       EXCEPTIONS
            no_infostruc_found  = 0.

 
    CALL FUNCTION 'ARCHIVE_READ_OBJECT'
         EXPORTING
              object         = 'PP_ORDER'
              object_id      = space
              archivkey      = l_AFKO-archivekey
              offset         = l_AFKO-archiveofs
         IMPORTING
              archive_handle = l_handle
         EXCEPTIONS
              OTHERS         = 1.
    IF NOT sy-subrc IS INITIAL.
      APPEND l_AFKO TO lt_AFKO_read.
      CONTINUE.
    ENDIF.
    CALL FUNCTION 'ARCHIVE_GET_TABLE'
         EXPORTING
              archive_handle        = l_handle
              record_structure      = 'RESBD'
              all_records_of_object = 'X'
         TABLES
              table                 = t_resb.

4 REPLIES 4
Read only

StMou
Active Participant
0 Likes
934

Hi,

You speak about table RESB but i see in your code you get table structure RESBD.

Is it just ?

Rgds

Read only

Former Member
0 Likes
934

Hi Stéphane,

I have tried both RESB and RESBD. Both cannot work.

Read only

Former Member
0 Likes
934

Can use FM - P_COMP_ARCHIVE_GET_TABLE

Read only

rmnachi_kx
Explorer
934

Hello All,

I understand that this is very old post. I had the same issue, tried finding a solution with SDN and no luck 😞 I started my debugging with SARI transaction as SARI was providing all the information related to my sales document. While doing SARI, program first calls 'ARCHIVE_GET_TABLE' FM to fetch details of first 21 tables, which I have direct access. Tables like status, costs, etc.. were not added in this first 21 fetch.

Later in code, found another FM 'ARCHIVE_GET_INFORMATION', which pulls the actual FM name which could get the data from archived folder you are looking for. Following is the standard code

  CALL FUNCTION 'ARCHIVE_GET_INFORMATION'
    EXPORTING
      archive_handle = v_handle
    TABLES
      used_classes   = lt_classes.

lt_class from here holds 3 fields. In which, 1st and 3rd fields are what we are looking for. 1st field (CLASS) holds the FM starting word (Later you need to concatenate this with archive_get_table. Read further......) and the 3rd fields contains its corresponding table names.

For ex : I'm looking for COSS table. So I deep dive inside 3rd field which is a table type. COSS is found under CLASS field 'K_KOSTS' (Actually, under K_KOSTS my data holds 14 table information which includes COBK, COEJ, COEP, COSS, COSP, etc....) Once you found your table, you need to concatenate the class name with 'ARCHIVE_GET_TABLE'.

So, if you are looking for COSS, then its corresponding class is K_KOSTS. So the FM for retrieving COSS is 'K_KOSTS_ARCHIVE_GET_TABLE'. Same way you can find for others and use it in your program.

In my case, I'm looking for JEST and JSTO. I found these tables under class STATUS. So for me the FM would be 'STATUS_ARCHIVE_GET_TABLE'.

I understand this is very old post, however if someone else is looking for an answer, I really hope that this helps.

Cheers
Nachi.RM