‎2007 Jun 21 3:05 PM
Hi all,
I will like to validate a field only if the program is executed in foreground. I am using the following code, but it is validating for both foreground and background.
Can someone help me??
at selection-screen.
if SY-BATCH ne 'X'.
if S_BUDAT is initial.
message E908 with TEXT-002.
exit.
endif.
endif.
‎2007 Jun 21 3:14 PM
try like this :
at selection-screen on s_budat.
if SY-BATCH ne 'X'.
if S_BUDAT = ''.
message E908 with TEXT-002.
exit.
endif.
endif.
‎2007 Jun 21 3:20 PM
Seshu: it didn't work. Do you have any other suggestion?
Thanks anyway.
‎2007 Jun 21 3:37 PM
See the below code and i am using one of my program
Tested and works great.
select-options s_budat for sy-datum.
at selection-screen.
if SY-BATCH eq space.
if S_BUDAT-low is initial.
message E908(zwave) with TEXT-002.
exit.
endif.
endif.
start-of-selection.
write:/ 'hello'.
‎2007 Jun 21 3:51 PM
Unfortunately it is not working for me.
How the sy-batch ne 'X' would be checked under selection-screen? Is this validation possible at this stage (AT SELECTION SCREEN EVENT)?
Because if I move the validation code to start-of-selection event, then the validation will work but when the message appears kick me out of the program.
Help Please....
‎2007 Jun 21 4:01 PM
Just fill the values in selection-screen and save as variant ..
now run with variant and use background mode ,next step would be run without values..
you could write start-of-selection or at select-screen event.
I am using one program and which should run only background.
see that code :
----
Validate Selection Screen
----
at selection-screen.
if sy-batch eq space.
if sy-ucomm = 'ONLI'.
message e000(zwave) with
'Delivery Create Program can'
'ONLY be run in Background mode!!'.
stop.
endif.
endif.
the above code i did not have any selection-screen validation.
if it is not working then continue on start-of-selection(both are same for ur case).
Thanks
Seshu
‎2007 Jun 21 7:49 PM
I found the solution. I move the validation code to the start of selection and write an information message. That way it will come be to the selection screen.
start-of-selection.
if SY-BATCH eq SPACE.
if S_BUDAT is initial.
message I124 with TEXT-002.
exit.
endif.
endif.
Thanks anyway.