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

Foreground Validation Only

Former Member
0 Likes
1,074

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.

6 REPLIES 6
Read only

Former Member
0 Likes
898

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.

Read only

Former Member
0 Likes
898

Seshu: it didn't work. Do you have any other suggestion?

Thanks anyway.

Read only

0 Likes
898

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'.

Read only

Former Member
0 Likes
898

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....

Read only

0 Likes
898

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

Read only

Former Member
0 Likes
898

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.