Hi Sai,
You never try to archive the unclosed purchasing documents. This is the basic principle should follow to archiving the purchasing documents.
A documents needs to be completed or closed business point of view. If you find any difference or not closed, this document not ready to archived.
I have already explained one of the threads to archiving the Po's and pre conditions.
Check the below information once again before archiving the PO's.
- All PO’s are needs to be set the deletion indicator at Header Level (in EKKO). Unable to archive the PO’s without deletion flag
- Need to check the tolerance period for PO’s. it means need to check the table T161R
Need to check the residence time 2 : ( 0030 days ).
Example: PO creation date is less than the (system date – residence time 2 = PO comparison date
IF PO creation date is greater than the PO comparison date we can’t able to archive the PO’s.
Put the break point on the below report and statement you will get the problem RM06EW47
if t161r-bstyp ne ekko-bstyp or
t161r-bsart ne ekko-bsart or
t161r-pstyp ne ekpo-pstyp.
* t161r-tage2 is initial. " 1024764
select single * from t161r where bstyp = ekko-bstyp
and bsart = ekko-bsart
and pstyp = ekpo-pstyp.
if sy-subrc <> 0.
call function 'ARCHIVE_PROTOCOL_COLLECT_APPL'
exporting
i_object = ekko-ebeln
i_msgtype = '02'
i_text = text-011.
* clear is necessary for correct message in calling program.
clear t161r. "1024764
clear p_archive.
exit.
endif.
endif.
Check the Jurgen comments in the below link:
SAP has provided OSS notes for more information.
OSS note 588463 - Importance of residence times during archiving
OSS note 335800 - SARA: Deletion indicator not set, but why?
OSS note401318 - Archiving: Additional information
Don't forget to check the http://scn.sap.com/thread/3468109
Rg, Kiran