<?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 Archiving Object PP_ORDER - Retrieve data in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/archiving-object-pp-order-retrieve-data/m-p/6676059#M1448800</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;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  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.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 
    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.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Feb 2010 07:32:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-02-25T07:32:51Z</dc:date>
    <item>
      <title>Archiving Object PP_ORDER - Retrieve data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/archiving-object-pp-order-retrieve-data/m-p/6676059#M1448800</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;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  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.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 
    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.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Feb 2010 07:32:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/archiving-object-pp-order-retrieve-data/m-p/6676059#M1448800</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-25T07:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: Archiving Object PP_ORDER - Retrieve data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/archiving-object-pp-order-retrieve-data/m-p/6676060#M1448801</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;You speak about table &lt;STRONG&gt;RESB&lt;/STRONG&gt;  but i see in your code you get table structure &lt;STRONG&gt;RESBD&lt;/STRONG&gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it just ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Feb 2010 09:57:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/archiving-object-pp-order-retrieve-data/m-p/6676060#M1448801</guid>
      <dc:creator>StMou</dc:creator>
      <dc:date>2010-02-25T09:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: Archiving Object PP_ORDER - Retrieve data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/archiving-object-pp-order-retrieve-data/m-p/6676061#M1448802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stéphane,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried both RESB and RESBD. Both cannot work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Feb 2010 00:28:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/archiving-object-pp-order-retrieve-data/m-p/6676061#M1448802</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-26T00:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: Archiving Object PP_ORDER - Retrieve data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/archiving-object-pp-order-retrieve-data/m-p/6676062#M1448803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can use FM - P_COMP_ARCHIVE_GET_TABLE&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Oct 2010 09:08:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/archiving-object-pp-order-retrieve-data/m-p/6676062#M1448803</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-28T09:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: Archiving Object PP_ORDER - Retrieve data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/archiving-object-pp-order-retrieve-data/m-p/6676063#M1448804</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;I understand that this is very old post. I had the same issue, tried finding a solution with SDN and no luck &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; 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 '&lt;STRONG&gt;&lt;EM&gt;ARCHIVE_GET_TABLE&lt;/EM&gt;&lt;/STRONG&gt;' 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. &lt;/P&gt;&lt;P&gt;Later in code, found another FM '&lt;STRONG&gt;&lt;EM&gt;ARCHIVE_GET_INFORMATION&lt;/EM&gt;&lt;/STRONG&gt;', which pulls the actual FM name which could get the data from archived folder you are looking for.  Following is the standard code&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  CALL FUNCTION 'ARCHIVE_GET_INFORMATION'
    EXPORTING
      archive_handle = v_handle
    TABLES
      used_classes   = lt_classes.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;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. &lt;/P&gt;&lt;P&gt;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 '&lt;STRONG&gt;&lt;EM&gt;ARCHIVE_GET_TABLE&lt;/EM&gt;&lt;/STRONG&gt;'. &lt;/P&gt;&lt;P&gt;So, if you are looking for COSS, then its corresponding class is K_KOSTS. So the FM for retrieving COSS is '&lt;STRONG&gt;&lt;EM&gt;K_KOSTS_ARCHIVE_GET_TABLE&lt;/EM&gt;&lt;/STRONG&gt;'. Same way you can find for others and use it in your program. &lt;/P&gt;&lt;P&gt;In my case, I'm looking for JEST and JSTO. I found these tables under class STATUS. So for me the FM would be '&lt;STRONG&gt;&lt;EM&gt;STATUS_ARCHIVE_GET_TABLE&lt;/EM&gt;&lt;/STRONG&gt;'.&lt;/P&gt;&lt;P&gt;I understand this is very old post, however if someone else is looking for an answer, I really hope that this helps. &lt;/P&gt;&lt;P&gt;Cheers&lt;BR /&gt;Nachi.RM&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 23:15:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/archiving-object-pp-order-retrieve-data/m-p/6676063#M1448804</guid>
      <dc:creator>rmnachi_kx</dc:creator>
      <dc:date>2019-05-16T23:15:33Z</dc:date>
    </item>
  </channel>
</rss>

