‎2006 Nov 09 7:39 PM
Hello friends,
I have to run the program in background and sometimes manually.
But the selection criteria changes based on the type ot run and also the selection screen changes.
When I run the program in background the Date field in the selection-screen should not be required field but when i run it manually it should be a required field.
Can i use a If statement for a selection screen and if so what condition should it be.
any Advice will be a great help.
Madhu.
‎2006 Nov 09 7:49 PM
Hi,
You don't have to declare two dates..
Check my reply for how to validate for the online processing..
THanks,
Naren
‎2006 Nov 09 7:41 PM
‎2006 Nov 09 7:41 PM
Hi,
Try this..
Check if the SY-BATCH is initial for online..
PARAMETERS: P_DATE TYPE SYDATUM.
AT SELECTION-SCREEN.
MAKE THE FIELD MANDATORY ONLY FOR ONLINE.
IF SY-BATCH IS INITIAL AND SY-UCOMM = 'ONLI'.
IF P_DATE IS INITIAL.
MESSAGE E208(00) WITH 'DATE IS REQUIRED FOR ONLINE'.
ENDIF.
ENDIF.
Thanks,
Naren
‎2006 Nov 09 7:48 PM
Thanks Naren and Rich,
I have my code in this way,
SELECTION-SCREEN : BEGIN OF BLOCK blk WITH FRAME TITLE text.
IF sy-batch = 'X'.
PARAMETERS : <b>p_date</b> LIKE rlgrap-filename.
ELSE.
PARAMETERS : <b>p_date</b> LIKE rlgrap-filename OBLIGATORY.
ENDIF.
SELECTION-SCREEN : END OF BLOCK blk.
But it has errors because p_date is repeated. so I cahanged it to ,
SELECTION-SCREEN : BEGIN OF BLOCK blk WITH FRAME TITLE text.
IF sy-batch = 'X'.
PARAMETERS : <b>p_date</b> LIKE rlgrap-filename.
ELSE.
PARAMETERS : <b>p1_date</b> LIKE rlgrap-filename OBLIGATORY.
ENDIF.
SELECTION-SCREEN : END OF BLOCK blk.
I hope this is correct.
let me know..
Madhu.
‎2006 Nov 09 7:51 PM
‎2006 Nov 09 7:49 PM
Hi,
You don't have to declare two dates..
Check my reply for how to validate for the online processing..
THanks,
Naren
‎2006 Nov 09 7:54 PM
Thanks Naren.
Works good for Online but is there a way that i could debug for the batch and check sy-batch = 'X'.
thanks again.
madhu.
‎2006 Nov 09 7:58 PM
‎2006 Nov 09 8:03 PM
I believe in you guys.
Its not that...
Anyways thanks for all the help and advice.
Madhu.