Application Development 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: 

Calculate time and load the file

Former Member
0 Kudos

I have a custom program ZLOAD scheduled at 6:00 12:00 and 18:00 daily M-F which loads a file.

If I get a file ,saying to load the file at 5:30 pm(load time is part of the file ) ,the file should not get loaded between/at 6 and 12 but the file should get loaded at 18:00 hrs .

If the file to load time is 11:30 am then it should get loaded at 12;00 pm

How to achiveve this in the program ZLOAD without scheduling a job at 5:30 pm or 11:30 am.

Can you please let me know your thoughts and better solution?

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos

There are couple of things you might need to do.

1. In ZLOAD, create a selection screen parameter .. WHich can help to indentify the job nature e.g. 18:00 job or 12:00 job

2. Read all the files. Check if your time is in the desired time range.

If yes, than process the file. And move that file to another folder.

If no, don't process the file. And end check for the next file.

Do this activity till you get finished your files.

Regards,

Naimesh Patel

4 REPLIES 4

naimesh_patel
Active Contributor
0 Kudos

There are couple of things you might need to do.

1. In ZLOAD, create a selection screen parameter .. WHich can help to indentify the job nature e.g. 18:00 job or 12:00 job

2. Read all the files. Check if your time is in the desired time range.

If yes, than process the file. And move that file to another folder.

If no, don't process the file. And end check for the next file.

Do this activity till you get finished your files.

Regards,

Naimesh Patel

0 Kudos

The selection screen parameter with time may not work .

How to identify on the selection screen if it is 6 or 12 or 18 job.

Same thing cannot be acheived with ranges too

I feel.

Since the job is scheduled three times a day (6,12,18),the 4:00 load time on file should load at 18:00 hrs and not either at 6 or 12.

Similarly for eg the 10:30 am should load at 12 :00 and not at 18:00 again.

0 Kudos

Hello,

The selection screen parameter can be fillled by the variant that is used when you create the job. The job scheduled to run at 18:00 would set the parameter to indicate that. Then just follow Naimesh's good advice to select the appropriate files.

Regards

Greg Ker

Former Member
0 Kudos

I figured it out but awarded couple of points to each of you.

if file-load-time > 12000.

if sy-uzeit le '120000'."Sy-uzeit will *have time as 060000/120000/180000 during *the job load.

continue.

endif.

endif.