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

Initialization

Former Member
0 Likes
953

- Does initialization happend when the report is "scheduled?"

I have a report in which one parameters is a date. This date have be current+7 and his report is scheduled for everyday.

Can I just plan the job and Let initialization do his job?

- the same report is executed for another report using submit... the date field can be submitted, is it changed by initialization?

thx

6 REPLIES 6
Read only

Former Member
0 Likes
823

Hi,

Initialization event is fired before

report is executed .So can assign the value

date+7 in this event without any problem.

regards

Amole

Read only

Former Member
0 Likes
823

There are two way in which you can do this.

1. Like the way you have mentioned in the initialization you can set that to sy-datum + 7.

2. In the variant, you can set the dynamic vairant for that parameter and set it as current date + n.

FOr this while saving the variant check the check box against the parameter (SELECTION VARIABLE) and then you can specify the value for the same.

I would suggest the 2nd option as that is the elegant of doing and doesn't involve code changes if the parameter value changes tomorrow.

You can find the help for the same here

http://help.sap.com/saphelp_nw04/helpdata/en/c0/98038ce58611d194cc00a0c94260a5/content.htm

Regards,

Ravi

Message was edited by: Ravikumar Allampallam

Read only

0 Likes
823

Hi Stephan,

You can use Dynamic Variants. Here you need not to Do any coding.

First save the Vairant, while saving you select the Checkbox for the date field

<b>Selection Variable </b>

now Click on the Button Selection variables

now Select <b>D</b> and double click on the Lights button then this will become green lights. Now you can see one Down arrow kind of Button press that and Choose <b>Current date +/- ??? days

current date +/- ??? work days </b> one of them give 7 dyas here. and save the variant.

Regards

vijay

Read only

Former Member
0 Likes
823

yes it is possible

i have used the same logic it is working fine with the background report

Read only

Former Member
0 Likes
823

HI Stephan,

You can do a initial value check for that field.

initialization.

if p_date is initial.

p_date = sy-datum + 7.

endif.

This way the date will be set to date + 7 only if the date parameter is initially empty.

Regards,

ravi

Read only

rahulkavuri
Active Contributor
0 Likes
823

yeah initilisation will do the work

This event is triggered when you execute your program for the first time i.e., before selection screen is displayed.