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

Question about Initialization when the program is run via batch job

Former Member
0 Likes
2,741

Hi Guys,

In the initialization event of the program, we set the entry date as:

s_cpudt-high = sy-datum.

s_cpudt-low = sy-datum - 1.

s_cpudt-option = 'EQ'.

s_cpudt-sign = 'I'

APPEND s_cpudt.

So we are expecting that it will retrieve the entries from table MKPF whose entry date falls between yesterday and today.

The Batch Job is scheduled to run every 10:00 GMT daily.

The problem is that the the program only retrieves the data where the entry time is between 00:00 to 10:00 GMT. Beyond 10:00 GMT is not being considered when the batch job is run the next day.

Need advice. Thanks.

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
1,405

As the report executes in background, it has a variant, the parameters are changed between INITIALIZATION and AT SELECTION-SCREEN OUTPUT with those of the variant, so your range is erased with the variant value.

Try to save the variant with the flag "Save field without values" for this parameter/select-options.

Regards,

Raymond

5 REPLIES 5
Read only

Former Member
0 Likes
1,405

Hi,

Write as :

s_cpudt-high = sy-datum.

s_cpudt-low = sy-datum - 1.

s_cpudt-option = 'BT' <-- should be between ... BT

s_cpudt-sign = 'I'

APPEND s_cpudt.

Regards,

Srini.

Read only

0 Likes
1,405

Hi Srini,

Thanks for that!

But I think that the values will still be changed once it comes into the selection screen. But I am note sure if it does not apply when the program is run via batch job. Please advice.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,405

Instead of all this you can set a dynamic date range in variant and use it in background job.

Thats the right way to do

Read only

0 Likes
1,405

Thanks for that! But that is actually the current setting of the variant, it is dynamic.

Read only

RaymondGiuseppi
Active Contributor
1,406

As the report executes in background, it has a variant, the parameters are changed between INITIALIZATION and AT SELECTION-SCREEN OUTPUT with those of the variant, so your range is erased with the variant value.

Try to save the variant with the flag "Save field without values" for this parameter/select-options.

Regards,

Raymond