Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

simple programing

Former Member
0 Likes
516

Hi,

I have an ztable zgood say

at 10am I have 8(1,2,3,4,5,6,7,& 😎 records in zgood

and at 10.10am I have updated 2 more records(9 & 10) into zgood

so now totally I have 10 records in zgood

again at 10.20am I updated 4 more records(11,12,13 & 14) into zgood,

again at 10.30am I updated 6 more records(15,16,17,18,19 & 20) into zgood.

now I have to write program with a select statement to extract the records of the table zgood into internal table i_good

say when I execute the program at 10am it has to fetch first 8 records into internal table zgood

and when I execute the same program at 10.20am it has to fetch only the records which were updated between 10.10am and 10.20 am (i.e only 2 records (9 & 10)) into the internal table zgood

and when I execute it at 10.30am it has to fetch only the records which were updated between 10.20am and 10.30 am.

so please help me.

4 REPLIES 4
Read only

JozsefSzikszai
Active Contributor
0 Likes
495

hi Shilpa,

you should fields in the table (zgood), which indicate the creation date and time of the entry, that is the only way to do (for example check BKPF which has CPUDT and CPUTM).

ec

Read only

Former Member
0 Likes
495

Hi,

You need to retrive the details as per your requirement, but you need to have any key fields like (date and time) to identify the date and time at which the fields are updated.

Thanks,

Sriram Ponna.

Read only

Former Member
0 Likes
495

create a z table: ZTIME with mandt, date and time and mandt is a key field.

(only once - insert a record into ZTIME with current date and time:

let us say it has one record with date: 17.12.2007 and time: 10.00.00)

in program,after start -of-selection and before first select query, do this.

select zzdate zztime

from ZTIME

into (LV_zzdate, LV_ZZtime).

select *

from xxxx

into table it_XXXX

where date >=lv_zzdate and date <= sele_date

and time >= lv_time and time <=sele_time.

this is first query, u get 1 ....... 8 records.

modify Ztime with sy-datum and sy-uzeit.

now it would be same date 17.12.2007 and time would be 10.10

select zzdate zztime

from ZTIME

into (LV_zzdate, LV_ZZtime).

select *

from xxxx

into table it_XXXX

where date >=lv_zzdate and date <= sele_date

and time >= lv_time and time <=sele_time.

this is second query , u get 9 and 8 records.

the purpose z table : ZTIME is to maintain the last date and last time.

based on this u can change/modify ur requirements.

Read only

0 Likes
495

see you are saying to modify ZTIME every time but my program is running in background.

I started my program at 10.00am and made it to run periodically for every 10 minutes, at this movement how can I handle this situation.