‎2006 Jul 16 9:35 AM
Hi.
When i'm debugging the code it is not coming out of the loop statement.
Can anyone tell me the possible error i made.
Also i'm trying to clear the work area at the start of subroutine but it is not working as seen in debugging mode.
Rgds,
Simran
‎2006 Jul 16 9:38 AM
Hi.
When i'm debugging the following code it is not coming out of the loop statement.
FORM sub_dowload.
DATA: l_g_lt_dt TYPE dats,
l_g_lt_tm TYPE tims.
l_g_lt_dt = wa_update-last_run_dt.
l_g_lt_tm = wa_update-last_run_tm.
SELECT
prog_name
plant
last_run_dt
last_run_tm
INTO TABLE i_update
FROM z_download
FOR ALL ENTRIES IN i_t001w
WHERE plant EQ i_t001w-werks.
IF NOT i_update[] IS INITIAL.
LOOP AT i_update INTO wa_update.
*if last run date is blank
IF NOT l_g_lt_dt IS INITIAL.
wa_update-last_run_dt = l_g_lt_dt.
ELSE.
wa_update-last_run_dt = g_sysdate - 1.
ENDIF.
*if last run time is blank
IF NOT l_g_lt_tm IS INITIAL.
wa_update-last_run_tm = l_g_lt_tm.
ELSE.
wa_update-last_run_tm = g_systime.
ENDIF.
APPEND wa_update TO i_update.
ENDLOOP.
ENDIF.
ENDFORM. " sub_download
Can anyone tell me the possible error i made.
Also i'm trying to clear the work area at the start of subroutine but it is not working as seen in debugging mode.
Rgds,
Simran
‎2006 Jul 16 9:38 AM
Hi.
When i'm debugging the following code it is not coming out of the loop statement.
FORM sub_dowload.
DATA: l_g_lt_dt TYPE dats,
l_g_lt_tm TYPE tims.
l_g_lt_dt = wa_update-last_run_dt.
l_g_lt_tm = wa_update-last_run_tm.
SELECT
prog_name
plant
last_run_dt
last_run_tm
INTO TABLE i_update
FROM z_download
FOR ALL ENTRIES IN i_t001w
WHERE plant EQ i_t001w-werks.
IF NOT i_update[] IS INITIAL.
LOOP AT i_update INTO wa_update.
*if last run date is blank
IF NOT l_g_lt_dt IS INITIAL.
wa_update-last_run_dt = l_g_lt_dt.
ELSE.
wa_update-last_run_dt = g_sysdate - 1.
ENDIF.
*if last run time is blank
IF NOT l_g_lt_tm IS INITIAL.
wa_update-last_run_tm = l_g_lt_tm.
ELSE.
wa_update-last_run_tm = g_systime.
ENDIF.
APPEND wa_update TO i_update.
ENDLOOP.
ENDIF.
ENDFORM. " sub_download
Can anyone tell me the possible error i made.
Also i'm trying to clear the work area at the start of subroutine but it is not working as seen in debugging mode.
Rgds,
Simran
‎2006 Jul 16 9:52 AM
What you are doing is to append a new row for each row of the table, so the table is continously getting new rows, so apparently it will not come of out the loop.
I guess want to update the row rather than appending a new row.
MODIFY i_update FROM wa_update INDEX SY-INDEX.
OR
MODIFY I_UPDATE FROM WA_UPDATE WHERE XXX = XXXX.
Regards,
Ravi
Note : Please mark all the helpful answers
‎2006 Jul 16 10:32 AM
Hi.
If i want to get records greater than the last run date and last run time,from db table do i need give the range
i.e. GE last_run_dt
and LE sy-datum
or just the GE last_run_dt will retrieve all records uptill sy-datum.
Rgds,
Simran
‎2006 Jul 16 10:34 AM
Anything greater than the LAST_RUN_DT should give you everything till SY_DATUM.
regards,
Ravi
Note : Please close the thread if the issue is resolved.