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

Problem with Variant Creation

suresh_kumar53
Participant
0 Likes
3,135

HI all,

I need to create a Variant for my program. In Selection screen on date is Select options. I need to fill SY-DATUM - 60 for low and SY-DATUM + 150 for high. Whenever Variant is selected selection screen should fill with these values.

How can we do that. Please help me in this.

Thanks in advance,

Suresh

1 ACCEPTED SOLUTION
Read only

0 Likes
2,086

Hi Suresh,

Regarding Variant creation Issue ,

1) create a Variant with test data in selection screen.

2) At the time of filling the Variant description details. You can see few more options like

Field attributes

Required field

Switch GPA off

Save field without values

Selection variable >>>>>

Hide field 'BIS'

Hide field

Protect field

Field name Type P I N <b> L</b> P L O

Selection screen objects 1000

Plant P

Work Center S

MRP Controller P

<b>P_START P

P_END </b> P Date fields

Include Prod. Orders P

Production Orders S

Include Planned Orders P

Planned Orders S

Grid P

List P

After marking X in Date fields belong to selection variable (L).

Click the push button Selection variable .

T: Table variable from TVARV Selected

😧 Dynamic date calculation Not selected

B: User-defined variables Not supported

Selection criterion T D B

Variable name

P_START Click D

P_END Click D

Then Choose the drop down in P_Start and p_END thoose are Date fields.

YOu will Get options Like

Current date

Current date +/- ??? days

current date +/- ??? work days

First day of current month

nth working day of current month

First day of next month

First day of previous month

Last day of previous month

Last Day of Current Month

Choose the option Current date+/-??? Days.

This will solve ur Problem ....

Bye buddy...

Sureshkumar.AL

10 REPLIES 10
Read only

Former Member
0 Likes
2,086

Hi

You can't save the variant without the calculation of the exact dates

in the Initialization event write the logic

INITIALIZATION

s_date-low = sy-datum - 60.

s_date-high = sy-datum + 150.

when ever the program is executed this will work fine with the new dates

no need of variant

Regards

Anji

Read only

0 Likes
2,086

Hi Anji,

Thank you,

But this report should excute in back ground. So in job creation am giving a vriant. For that Variant i need to supply this values(some more fields also there). I have written in Initialization event also. But Variant over writing that one. Please help me in this

Read only

0 Likes
2,086

Hello Suresh,

you can achieve this in variant maintenance. Description below is for an ECC 6.0 system, on earlier releases, it works similar.

On selection screen, press Save to start create a new variant.

Enter variant name and description ("meaning").

Locate your field in the list. This should be of type S (select options). Then go to column Selection variable, and press F4. Do not bother that the field looks grayed out. Enter D here for dynamic date calculation.

Then go to column Name of variable. Again, it looks gray, do not bother. Press F4 to see the list of available options. Scroll down to the entry called "Current date - xxx,current date + yyy". Doubleclick that entry to see a small popup window where you can enter the values (in days) for xxx (60 in your case) and yyy (150).

Save the variant and feel free to use it in job definitions.

Hope that helps, points welcome

Csaba

Read only

Former Member
0 Likes
2,086

HI

u want to fill date-low value as SY-DATUM-60

date-high as SY-DATUM+150

SO u can write these at initialization event then they automatically come in date-low and high respectively.

for creating variant u have to give constant input values while exceuting and then save them as varaint.

but as per ur requirement write them at initialization event.

regards

sandya

Read only

JozsefSzikszai
Active Contributor
0 Likes
2,086

hi Suresh,

when you fill your selection screen (leave the date field empty), click save, now you select the lin with the date you want to dynamize. Menu: Environment / Maint. selection variables. Now you can select, how it should be calculated. You have to save it at the end.

hope this helps

ec

Read only

0 Likes
2,086

HI ec,

I tried according to your spefication. But am not able to do that. In menu Environment-->maitan selectionvariables. I didnt get any option to dynamize the field. Can you please provide me all steps.

Thanks in advance.

Regards,

Suresh

Read only

0 Likes
2,087

Hi Suresh,

Regarding Variant creation Issue ,

1) create a Variant with test data in selection screen.

2) At the time of filling the Variant description details. You can see few more options like

Field attributes

Required field

Switch GPA off

Save field without values

Selection variable >>>>>

Hide field 'BIS'

Hide field

Protect field

Field name Type P I N <b> L</b> P L O

Selection screen objects 1000

Plant P

Work Center S

MRP Controller P

<b>P_START P

P_END </b> P Date fields

Include Prod. Orders P

Production Orders S

Include Planned Orders P

Planned Orders S

Grid P

List P

After marking X in Date fields belong to selection variable (L).

Click the push button Selection variable .

T: Table variable from TVARV Selected

😧 Dynamic date calculation Not selected

B: User-defined variables Not supported

Selection criterion T D B

Variable name

P_START Click D

P_END Click D

Then Choose the drop down in P_Start and p_END thoose are Date fields.

YOu will Get options Like

Current date

Current date +/- ??? days

current date +/- ??? work days

First day of current month

nth working day of current month

First day of next month

First day of previous month

Last day of previous month

Last Day of Current Month

Choose the option Current date+/-??? Days.

This will solve ur Problem ....

Bye buddy...

Sureshkumar.AL

Read only

0 Likes
2,086

Hi Suresh,

Don't Keep the date in select option rather Create 2 date field in Parameter as soon in my above ex. and try to control it when creating the variant.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(33) text-100.

SELECTION-SCREEN POSITION 34.

PARAMETERS: p_start LIKE sy-datum DEFAULT sy-datum.

SELECTION-SCREEN COMMENT 46(4) text-101.

SELECTION-SCREEN POSITION 51.

PARAMETERS:p_end LIKE sy-datum DEFAULT '99991231' OBLIGATORY.

SELECTION-SCREEN END OF LINE.

text-100 = Order Scheduled Finish Date Range

text-101 = to

With regards,

Sureshkumar.AL

Read only

0 Likes
2,086

HI Suresh kumar,

Your answer is very helpful for me. But in my Selection screen date is Select-options. Am not able to set LOW and HIGH values at a time. Please help me in this.

Thanks in advance,

Regards,

Suresh.

Read only

0 Likes
2,086

u want variant

goto variant

select values ok