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: 

Variant issue

Former Member
0 Kudos

I have a report that runs every month, there is a variant for it.

There is a field on selection screen that crresponds to a time period (say 1st of month to last of month).

Can we do something with the variant that it picks the period value relevant at the time of report run, dynamically (if run today , it has to pick the last months first date and last date)

right now we are changing the variant every month for the period field.

regards

Alok Pathak

1 ACCEPTED SOLUTION

Former Member
0 Kudos

1. Enter the values in the selection screen

2. Save the variant using the SAVE button

3. In the next screen for the date variable select the 'Selection variable' checkbox (L) and click on the button 'Selection variable' in the toolbar.

4. Now you will see this variable in the next screen with 3 types of buttons. Click on the middle button (ie. D - Dynamic date calculation).

5. Click on the down arrow button and select the option 'Current Date'.

6. Save the variant.

Kindly assign points if this is helpful.

5 REPLIES 5

Former Member
0 Kudos

1. Enter the values in the selection screen

2. Save the variant using the SAVE button

3. In the next screen for the date variable select the 'Selection variable' checkbox (L) and click on the button 'Selection variable' in the toolbar.

4. Now you will see this variable in the next screen with 3 types of buttons. Click on the middle button (ie. D - Dynamic date calculation).

5. Click on the down arrow button and select the option 'Current Date'.

6. Save the variant.

Kindly assign points if this is helpful.

0 Kudos

Hi Kishan

This will work fine if we have a date field ..which was my requirement. Thanx.

i observed though, if the field is for only the year and not the complete date we cannot create such variant, is that true?

regards

Alok Pathak

0 Kudos

ya ur rite but only for standard field. in custome field u use logic to achive it.

Former Member
0 Kudos

Hi,

In the selection screen set the time period based on the below logic.

from the sy-datum get the year.

Using <b>'BUILD_PERIOD_TABLE'</b> you can get the end date and start date of ur required month.

pass it to ur selection-screen fields as default.

Hope this helps you.

Regards,

Anjali

Former Member
0 Kudos

Hi alok,

Execute your report and press 'SAVE'.Give Variant name and text for variant.Next Check the check box(with heading 'L') for relevent selection-screen field(your date field in selection-screen). Next select 'SELECTION VARIABLES' button in Application tool bar.Then after click on 'D'(that is yellow traffic light)now you can able to see some down arrow button under 'T' and now it turned to yellow signal.Then after select that down arrow button and give 'Current Period'. This will fill the date automatically into your select options.

Please check the above way and if it meet your requirement then donot forget to give reward points.

Cheers,

Bujji.