‎2008 Mar 13 9:22 AM
Hello everybody,
I have the following ZJOBR table:
JOB_ID ¦ JOD_DATE ¦ STATUS_ID ¦ BW_PROCESS_CHAIN
-
-
98 ¦ 07.03.2008 ¦ F ¦ PC_CUST_DB
98 ¦ 08.03.2008 ¦ V ¦ PC_CUST_DB
98 ¦ 09.03.2008 ¦ V ¦ PC_CUST_DB
98 ¦ 10.03.2008 ¦ V ¦ PC_CUST_DB
When, i execute this ABAP Code:
select * from zjobr up to 1 rows
where bw_process_chain = 'PC_CUST_DB'
and status_id = 'V'.
endselect.
if sy-subrc = 0.
The precedent day should be correctly termitated - status F *
dt_1 = zjobr-job_date - 1.
select * from zjobr up to 1 rows
where job_id = zjobr-job_id
and job_date = dt_1
and status_id = 'F'.
endselect.
if sy-subrc <> 0.
p_subrc = 4.
else.
p_subrc = 0.
...
After execution, i have the following error: Routine for characteristic ... with sy-subrc 4 terminated.
However, this ABAP code should extract the following record:
98 ¦ 08.03.2008 ¦ V ¦ PC_CUST_DB
and then, verify if the precedent record has the Status F:
98 ¦ 07.03.2008 ¦ F ¦ PC_CUST_DB
I don't know why this routine exit with sy-subrc 4...
Could you give me suggestions how do this?
Thanks in advance.
Best Regards,
Rod.
Edited by: Rodolphe LALOUX on Mar 13, 2008 10:23 AM
‎2008 Mar 13 9:32 AM
Hi
declare an work area for the same and try
data : wa_zjobr type zjobr .
select *
into wa_zjobr
from zjobr zjobr up to 1 rows
where bw_process_chain = 'PC_CUST_DB'
and status_id = 'V'.
endselect.
if sy-subrc = 0.
The precedent day should be correctly termitated - status F *
dt_1 = wa_zjobr-job_date - 1.
select * from zjobr up to 1 rows
where job_id = wa_zjobr-job_id
and job_date = dt_1
and status_id = 'F'.
endselect.
if sy-subrc 0.
p_subrc = 4.
else.
p_subrc = 0.
Regards
Shiva
‎2008 Mar 13 9:31 AM
Hi,
I guess the code "where job_id = zjobr-job_id" in
select * from zjobr up to 1 rows
where job_id = zjobr-job_id
and job_date = dt_1
and status_id = 'F'.
endselect.
is wrong. U r comparing zjobr-jobid with zjobr-jobid . Remove it and try.
Reward if helpful.
Regards,
Ramya
‎2008 Mar 13 9:32 AM
Hi
declare an work area for the same and try
data : wa_zjobr type zjobr .
select *
into wa_zjobr
from zjobr zjobr up to 1 rows
where bw_process_chain = 'PC_CUST_DB'
and status_id = 'V'.
endselect.
if sy-subrc = 0.
The precedent day should be correctly termitated - status F *
dt_1 = wa_zjobr-job_date - 1.
select * from zjobr up to 1 rows
where job_id = wa_zjobr-job_id
and job_date = dt_1
and status_id = 'F'.
endselect.
if sy-subrc 0.
p_subrc = 4.
else.
p_subrc = 0.
Regards
Shiva
‎2008 Mar 13 9:41 AM