My program runs in background with job scheduling it will work by variant. But for testing purpose I have to create one more selection screen with the some slection fileds.
So My program has to run like this . If I run with test selection fields it has to work and if I run in background job with other selection also has to work. There are two slections and program should understand this.
You can modify your selection screen at "AT SELECTION SCREEN" event based on the fact whether is is running in background or foreground. In your selection screen give two modif id's: one for Plant and material ( 1st selection) say BATCH and another one for date and time (2nd Selection) say TEST. Now try implementing the following logic:
At selection-screen OUTPUT.
IF SY-BATCH ne X.
LOOP AT SCREEN.
IF screen-group1 = 'TEST'. *You can provide the screen name for date and time to populate only the date and Time fields.
screen-input = 0.