on 02-08-2011 1:24 PM
Hi Gurus,
I am getting error while opening project throgh the
t code CJ02.
Error: System error in program SAPLCJDW (RC026)->F1
Message noCJ895.
Version is 4.7.
What may be the reason to appear these kind of error?
How to rectify the issue?
Thanks in advance...
Regards,
Arumugam S.
This message was moderated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Guys,
Its a system error and its is caused by an invalid record in table PRHI.
The reason for the record creation could not be determined so far.
Solution
Create correction reports RCJCHK04, RCJCHK05 and ZZPRHIS1 in your system with the following attributes:
Report Parameters
Title: Correct (standard) WBS element structure records
Attributes: Type 1
Status
Application C
Authorization group RCJCHK04 or RCHCHK05 or ZZPRHIS1
Development class $TMP
Create the source code of report RCJCHK04, RCJCHK05 and ZZPRHIS1 that are specified under 'Corrections - Non-R/3
Standard'.
Report RCJCHK04 corrects the ´defective records for operative WBS elements while reports RCJCHK05 and ZZPRHIS1 correct defective records for standard structures.
*&----
*
*& Title: Correct wbs element structure records *
*&----
*
REPORT RCJCHK04 MESSAGE-ID CJ.
TABLES: PROJ, PRPS, PRHI.
DATA: ITAB_PRHI LIKE PRHI OCCURS 0 WITH HEADER LINE,
SORTAB_PRHI LIKE PRHI OCCURS 0 WITH HEADER LINE,
TFILL LIKE SY-TFILL,
END_OF_GLOBAL_DATA.
PARAMETERS PSPID LIKE PROJ-PSPID MEMORY ID PSP.
SELECT * FROM PROJ WHERE PSPID = PSPID.
WRITE: 'Projectdefinition'(001), PROJ-PSPID, PROJ-POST1.
SELECT * INTO TABLE ITAB_PRHI FROM PRHI WHERE PSPHI = PROJ-PSPNR.
WRITE: / SY-DBCNT, 'records found'(002).
SKIP.
EXIT.
ENDSELECT.
IF NOT SY-SUBRC IS INITIAL.
WRITE: / 'Projectdefinition'(101), PSPID, 'not found'(102).
ENDIF.
CHECK SY-SUBRC IS INITIAL.
WRITE: / 'invalid records:'(005).
SORTAB_PRHI[] = ITAB_PRHI[].
SORT SORTAB_PRHI BY POSNR.
DETAIL.
LOOP AT ITAB_PRHI.
IF ITAB_PRHI-RIGHT IS INITIAL.
DELETE ITAB_PRHI.
ELSE.
READ TABLE SORTAB_PRHI WITH KEY POSNR = ITAB_PRHI-RIGHT.
IF SY-SUBRC IS INITIAL.
DELETE ITAB_PRHI.
ELSE.
CLEAR ITAB_PRHI-RIGHT.
MODIFY ITAB_PRHI.
ENDIF.
ENDIF.
ENDLOOP.
DESCRIBE TABLE ITAB_PRHI LINES TFILL.
IF TFILL IS INITIAL.
WRITE: 'no invalid records found'(003).
ELSE.
SKIP.
SUMMARY.
WRITE: / TFILL, 'invalid records found'(004),
/ 'F5 = correct'(006).
ENDIF.
AT PF5.
IF NOT TFILL IS INITIAL.
UPDATE PRHI FROM TABLE ITAB_PRHI.
COMMIT WORK.
MESSAGE I001 WITH SY-DBCNT 'records changed'.
CLEAR TFILL.
ENDIF.
*&----
*
*& Title: Correct standard wbs element structure records *
*&----
*
REPORT RCJCHK05 MESSAGE-ID CJ.
TABLES: PROJS, PRPSS, PRHIS.
DATA: ITAB_PRHI LIKE PRHIS OCCURS 0 WITH HEADER LINE,
SORTAB_PRHI LIKE PRHIS OCCURS 0 WITH HEADER LINE,
TFILL LIKE SY-TFILL,
END_OF_GLOBAL_DATA.
PARAMETERS PSPID LIKE PROJS-PSPID MEMORY ID PSP.
SELECT * FROM PROJS WHERE PSPID = PSPID.
WRITE: 'Project definition'(001), PROJS-PSPID, PROJS-POST1.
SELECT * INTO TABLE ITAB_PRHI FROM PRHIS WHERE PSPHI = PROJS-PSPNR.
WRITE: / SY-DBCNT, 'records found'(002).
SKIP.
EXIT.
ENDSELECT.
IF NOT SY-SUBRC IS INITIAL.
WRITE: / 'Project'(101), PSPID, 'not found'(102).
ENDIF.
CHECK SY-SUBRC IS INITIAL.
WRITE: / 'invalid records:'(005).
SORTAB_PRHI[] = ITAB_PRHI[].
SORT SORTAB_PRHI BY POSNR.
DETAIL.
LOOP AT ITAB_PRHI.
IF ITAB_PRHI-UP = 0.
DELETE ITAB_PRHI.
ELSE.
READ TABLE SORTAB_PRHI WITH KEY POSNR = ITAB_PRHI-UP.
IF SY-SUBRC IS INITIAL.
DELETE ITAB_PRHI.
ELSE.
WRITE / ITAB_PRHI-POSNR.
ENDIF.
ENDIF.
ENDLOOP.
DESCRIBE TABLE ITAB_PRHI LINES TFILL.
IF TFILL IS INITIAL.
WRITE: 'no invalid records found'(003).
ELSE.
SKIP.
SUMMARY.
WRITE: / TFILL, 'invalid records found'(004),
/ 'F5 = correct'(006).
ENDIF.
AT PF5.
IF TFILL IS INITIAL.
MESSAGE I001 WITH TEXT-M01.
ELSE.
LOOP AT ITAB_PRHI.
CLEAR: ITAB_PRHI-UP, ITAB_PRHI-LEFT, ITAB_PRHI-RIGHT.
MODIFY ITAB_PRHI.
ENDLOOP.
UPDATE PRHIS FROM TABLE ITAB_PRHI.
COMMIT WORK.
MESSAGE I001 WITH SY-DBCNT 'records changed'.
CLEAR TFILL.
ENDIF.
*&----
*
*& Title: Correct standard wbs element structure records *
*&----
*
REPORT ZZPRHIS1 .
TABLES: PROJS, PRPSS, PRHIS.
Nach Mandantencopy befinden sich in der PRHIS ggfs. sinnlose
Einträge, die später zu Verbuchungsabbrüchen oder Online-Abbrüchen
führen
Um die fehlerhaften PRHIS-Sätze zu löschen, muss
*
1) Jeder PRHIS-Satz gelöscht werden, der eine laut PROJS nicht
existierende Projektnummer enthält.
2) Jeder PRHIS-Satz gelöscht werden, der zwar eine gültige Projekt-
nummer enthält, aber keinen korrespondierenden Datz in der PRPSS
hat.
*
PARAMETERS: TEST DEFAULT 'X'.
DATA: BEGIN OF ITAB_PROJS OCCURS 0,
PSPNR LIKE PROJS-PSPNR,
END OF ITAB_PROJS.
DATA: BEGIN OF ITAB_PRPSS OCCURS 0,
PSPNR LIKE PRPSS-PSPNR,
PSPHI LIKE PRPSS-PSPHI,
END OF ITAB_PRPSS.
DATA: ITAB_PRHIS LIKE PRHIS OCCURS 0 WITH HEADER LINE.
DATA: ITAB_PRHIS_DEL LIKE PRHIS OCCURS 0 WITH HEADER LINE.
SELECT PSPNR FROM PROJS
INTO CORRESPONDING FIELDS OF TABLE ITAB_PROJS.
SELECT PSPNR PSPHI FROM PRPSS
INTO CORRESPONDING FIELDS OF TABLE ITAB_PRPSS.
SELECT * FROM PRHIS INTO TABLE ITAB_PRHIS.
SORT ITAB_PROJS BY PSPNR.
SORT ITAB_PRPSS BY PSPNR.
1) Delete all files in PRHIS w/o valid project
Sort itab_prhis by PSPHI for that manner
SORT ITAB_PRHIS BY PSPHI.
LOOP AT ITAB_PRHIS.
READ TABLE ITAB_PROJS WITH KEY PSPNR = ITAB_PRHIS-PSPHI
BINARY SEARCH.
IF NOT SY-SUBRC IS INITIAL.
PRHIS file not found in PROJS -> error
WRITE: / 'PRHIS file w/ non existing standard project: ',
ITAB_PRHIS-POSNR, ITAB_PRHIS-PSPHI.
MOVE-CORRESPONDING ITAB_PRHIS TO ITAB_PRHIS_DEL.
APPEND ITAB_PRHIS_DEL.
DELETE ITAB_PRHIS.
ENDIF.
ENDLOOP.
2) Delete alls files in PRHIS w/o corresponding file in PRPSS
Sort itab_prhis by POSNR for that manner
SORT ITAB_PRHIS BY POSNR.
LOOP AT ITAB_PRHIS.
READ TABLE ITAB_PRPSS WITH KEY PSPNR = ITAB_PRHIS-POSNR
BINARY SEARCH.
IF NOT SY-SUBRC IS INITIAL.
PRHIS file not found in PRPSS -> error
WRITE: / 'PRHIS file w/ non existing standard WBS element: ',
ITAB_PRHIS-POSNR, ITAB_PRHIS-PSPHI.
MOVE-CORRESPONDING ITAB_PRHIS TO ITAB_PRHIS_DEL.
APPEND ITAB_PRHIS_DEL.
DELETE ITAB_PRHIS.
ENDIF.
ENDLOOP.
IF ITAB_PRHIS_DEL[] IS INITIAL.
WRITE: / 'No erroneous files found in PRHIS.'.
EXIT.
ENDIF.
should not be necessary but to be sure...
SORT ITAB_PRHIS_DEL BY POSNR.
DELETE ADJACENT DUPLICATES FROM ITAB_PRHIS_DEL.
IF TEST IS INITIAL.
update
CHECK NOT ITAB_PRHIS_DEL[] IS INITIAL.
DELETE PRHIS FROM TABLE ITAB_PRHIS_DEL.
ENDIF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please check the following SAP notes
544740
74424
149698
Tnx.
Abdul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
8 | |
7 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.