2009 Mar 13 10:14 AM
Hello..
I have a report which has date as select option..
This report executes both in foreground and in background...
In foreground it runs for the date the user enters...
In background I want it should run for the current system date..The report will be scheduled daily at 11 pm. so each day it should take the current date as its input ...
How is this possible???
2009 Mar 13 10:20 AM
Hi,
If you are using SAP 4.7 versions, while saving the variant:
Give the variant name and description.
Then for the date variable , in the field attributes, click check box Selection variable. Then press selection variables button. Press Dynamic date calculation (Traffic light for D column will turn green).
Then click the list box, and select Current date.
Save the variant.
Best Regards,
Suresh
Hello..
I have a report which has date as select option..
This report executes both in foreground and in background...
In foreground it runs for the date the user enters...
In background I want it should run for the current system date..The report will be scheduled daily at 11 pm. so each day it should take the current date as its input ...
How is this possible???
2009 Mar 13 10:17 AM
At initialization.
p_date = sy-datum.
start-of-selection.
check sy-batch value and proceed.
2009 Mar 13 10:18 AM
Set the the default date in selection screen by using Default Sy-datum.
2009 Mar 13 10:18 AM
Hi
USe this piece of code:
INITIALIZATION.
if sy-batch = 'X'.
s_date-low = sy-datum.
endif.
Cheers
Ravish
2009 Mar 13 10:19 AM
Just change the program where u used the select-options, there set the default value as sy-datum.
then if u run the report in background then it will take the current date.
SELECT-OPTIONS: date FOR sy-datum DEFAULT sy-datum.
2009 Mar 13 10:20 AM
Hi,
Set the default value of date field as current date. Use INITIALIZATION event
SELECT-OPTIONS : s_datum FOR sy-datum.
INITIALIZATION.
IF sy-batch = 'X'.
s_datum-low = sy-datum.
ENDIF.
Hope this helps you.
Regards,
Tarun
2009 Mar 13 10:20 AM
Hi
At Initialization section,you can set the selection-screen date field as you required and validate the same using sy-batch for background processing and else for foreground processing.
Regards,
Sreeram Kumar Madisetty
2009 Mar 13 10:20 AM
Hi,
If you are using SAP 4.7 versions, while saving the variant:
Give the variant name and description.
Then for the date variable , in the field attributes, click check box Selection variable. Then press selection variables button. Press Dynamic date calculation (Traffic light for D column will turn green).
Then click the list box, and select Current date.
Save the variant.
Best Regards,
Suresh
2009 Mar 13 10:25 AM
2009 Mar 13 10:27 AM
Hi All...
All the answers were of gr8 help...I got two solutions to my problem..
Thank u all...
2009 Mar 13 10:27 AM
Hi,
If you are using SAP 4.7 versions, while saving the variant:
Give the variant name and description.
Click the check box, only for background processing.
Then for the date variable , in the field attributes, click check box Selection variable. Then press selection variables button. Press Dynamic date calculation (Traffic light for D column will turn green).
Then click the list box, and select Current date.
Save the variant.
If it is ECC 6.0,
Click the check box, only for background processing.
Then in the selection variable column for the DATE field, There will be an F4 help. Select D - Dynamic date calculation.
Then in name of variable (Input only using F4 column), press F4 and choose 'Current date'.
This is an easy solution by using Variants. There is no need to change your code, if you use this method.
Best Regards,
Suresh
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |