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: 

Difference between sy-datm and sysdate in a variant of a report

Former Member
0 Kudos

hi,

I am working on a report which fills the database and i had assigned variant called SYSDATE -1 bcoz it will update the database table for all the plants for the previous date. can anybody guide me that whether i should use the variable SYSDATE- 1 or the sy-datum-1 ,so that uploading the data can be performed.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

While saving the variant try to have Selection Variable as 'D' and then you can set the date dynamically from any of the options in "Name of Variable" field.

Revert if you need anything further.

9 REPLIES 9

Former Member
0 Kudos

While saving the variant try to have Selection Variable as 'D' and then you can set the date dynamically from any of the options in "Name of Variable" field.

Revert if you need anything further.

0 Kudos

Hi,

I didn't understood. I had checked the variant i am just taking Plant field and the date is set blank bcoz the schedular of the table is updates the table daily but it is not updating right now. plzz provide me guidelines to sove this problem.

0 Kudos

You need some help in configuring the variant or the program ?

If the program had been running before and nothing has been changed then why the error ?

Could you reframe your problem a bit more clearly?

0 Kudos

hi Ankesh,

I am saving a variant with having plant field filled and the date field parameter is left blank. I want to know how the program will update the data in to the database table with having Date field remains blank when the variant is saved for it.

If i specify the date field while saving the variant it will run always for that date only which is saved in variant. *What type of variant * to be saved so that execution of the program should run for everyday.

Please provide me guidelines for the solution of this problem.

0 Kudos

use sy-datum for the current date which will show you the system date

SY-DATUM D System: Date. YYYYMMDD. (Appl.Server)

0 Kudos

You want a dynamic variant that means.

All you have to do is save the variant and while doing so on the variant page make your date field "Save field without values" and "Selection Variable" = 'D' and "Name of variable" as current date +- days specifying whatever u want.

These settings are made in the variant of the program. The screen that opens when you press save on the selection screen. If I am still not clear please do tell me.

Also the reason your date field is getting blank is because you have saved it with blank and in yur program you must have written VALUES sy-datum - 1. You could simply Save the variant with "Save field without values" (Tick this field) and your problem would be sorted.

0 Kudos

hi,

I am using just filling the Plant Selection screen and the Date parameters are being left blank and i am declaring vairant as SY-DATUM - 1 and saving it as it is.

I am not ticking any coloumn . please provide me guidelines for solving the problem.

0 Kudos

Did u follow any of my instructions ? It is step by step if you try once.

Former Member
0 Kudos

These are few options you may try

1. Create a wrapper program which will first modify date in variant and save it again. FM RS_VARIANT_CONTENTS, RS_CHANGE_CREATED_VARIANT and

RS_CREATE_VARIANT, RS_VARIANT_DELETE will be useful.

Submit program with this changed variant.

2. Same as above except variant change program can be scheduled and dependent step can be created to run from that variant.

3. While saving the variant you may assign "Selection Variable". This will fetch data from table TVARVC. You will need to periodically update value of your date field in this table.

Regards,

Mohaiyuddin