2013 Dec 10 10:21 AM
Dear Experts,
I have a requirement to archive EKKO, EKPO tables. When i tried doing it using MM_EKKO object, im getting error that "Retention period is not maintained". But I have maintained the retention period in SPRO Tx. I have given residence time 1 and residence time 2 as '1' . Though the last changed date is far behind the current date, i'm getting this issue. Please help me out.
Thanks in advance
Regards,
Shanthi
2013 Dec 10 10:57 AM
Hi,
Check the below information once again before archiving the PO's.
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.
2013 Dec 10 10:25 AM
Hi Shanthi
Have you maintained the residence time based on purchasing document category/document type / item category in table T161R
Nabheet
2013 Dec 10 10:40 AM
Hi Nabheet
Ya i have maintained the residence times in SPRO Tx and checked in T161R table too. The values have got reflected over there.
Regards,
Shanthi
2013 Dec 10 10:57 AM
Hi,
Check the below information once again before archiving the PO's.
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.
2013 Dec 10 11:04 AM
Hi Kiran,
I have checked the dates. Actually the PO creation date is 22.01.2013 i have given both residence time1 and 2 as "1". I tried archiving today. So PO creation date is lesser than the PO comparison date
Regards,
Shanthi
2013 Dec 10 11:11 AM
Can you please put a breakpoint as mentioned above. Please cross check the purchasing document which you are using its document type/category etc is maintained. Please debug it
Nabheet
2013 Dec 10 11:15 AM
As highlighted the code above, the error is triggered particular piece of code only.
2013 Dec 10 11:35 AM
Im getting the issue in preprocessing stage. Anyway i have set the debugger in the write program also as you suggested. But it is showing zero log messages. The control didn't reach the breakpoint
2013 Dec 10 11:50 AM
Hi,
Put the break point on the below perform go step by step please
* EKPO
perform check_ekpo changing l_archive.
2013 Dec 10 12:09 PM
Actually the loekz value is not set to 'L' for the POs. The field is empty.
SELECT ebeln FROM ekko INTO TABLE lt_sekko
WHERE ebeln IN er_ebeln
AND ekorg IN er_ekorg
AND bstyp IN er_bstyp
AND bedat IN er_bedat
AND bsart IN er_bsart
AND ekgrp IN er_ekgrp
AND loekz = 'L'
ORDER BY ebeln.
When the above query is executed, lt_sekko internal table is empty and control is not reaching there.
2013 Dec 10 1:14 PM
Hi Shanthi,
I have clearly written on the first point
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
2013 Dec 11 4:37 AM
The problem is with the preprocessing step. I think only this program sets the deletion indicator for POs at header level. But when i run this program, i'm getting issues that retention period is not maintained and the deletion indicator is not set. Is there any other way to flag the POs at header level?
2013 Dec 10 1:41 PM
Just want to advise you not to do anything foolish with the deletion indicators.
Those indicators are set with the pre-processing step. And you should check the log if the deletion indicator was not set, there you can find the reasons why it was not set.
The residence time alone does not decide if a document can be archived. A document has to be closed from a business point of view. if you have for example a difference between invoice and goods receipt then this document is not ready to be archived, even the residence time is over
2013 Dec 11 4:39 AM
Hi Jurgen
When i ran the preprocessing step, the log contains only one message that retention period is not maintained. But they are already set. As this is not successful the deletion indicator is not set.
2013 Dec 11 9:38 AM
Does it really talk about retention period? or about residence time?
the logic is explained in OSS note 588463 - Importance of residence times during archiving
you have to have an entry for each combination or purchasing document type and iten category in table T161R
if you are certain that you have one, then have a look into OSS note 335800 - SARA: Deletion indicator not set, but why?
it explains how and where to debug .
further reasons that prevent setting a deletion flag are explained in OSS note 401318 - Archiving: Additional information
2013 Dec 11 12:27 PM
Ya the log message is "Retention period is not maintained". I think there is some data inconsistency.
2013 Dec 11 3:09 PM
I think the word Retention period and Residence time is just the same meaning here, probably translated by 2 different persons. Because in ERP system you can only customize Residence time.
This means who long the documents will stay in the table space. After archiving, you still have to keep the archive for several years and this is the retention period. For example Residence time 30 days, and a retention period in total is 10 years as those documents are audit relevant. But these 10 years period is not maintained in ERP system, this is a setting in your content repository or ILM system
2013 Dec 11 6:58 AM
Is it necessary that the document must be closed in order to archive the PO data. Can't we do it at any stage we want?
2013 Dec 11 7:09 AM
Hi Shanthi,
No you can't do it! document must be closed. If you are not close the document, it should be the major impact on the business.
For example, You created delivery with reference to PO. The goods are in transit with reference to your PO. So how can you archive the PO without closing the delivery. If you archive the PO, there is no reference document to receive the goods.
I hope you understand the situation.
Thanks,
Kiran.
2013 Dec 11 7:34 AM
2013 Dec 11 7:34 AM