Application Development 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: 

Variant_Check

Former Member
0 Kudos

Hello,

I am facing an issue in finding whether my program is executed with variant or not.

My main objective is that if my program is running in background mode without using an Variant it should

giver error message.

Eg-1. If thorugh SE38 i selected Run In Background mode without selecting any variant it should give error message.

2.If through SM36 i schedule a job without selecting any Variant again it should give error message.

3, if variant is selected in both the above methods then program will get executed.

4.if run in foreground mode then program should get executed without checking for variant.

2 REPLIES 2

Former Member
0 Kudos

Hi,

When your execute a report by choosing - Execute in background it will not give you any error unless you make a field obligatory or check the field is filled in at-selection-screen event.

The same holds good for running in fore ground as well.

Regards

Ram

Former Member
0 Kudos

Try this...


At Selection-Screen.

  If SY-BATCH eq 'X' and SY-SLSET is initial.
    Message E208(00) with 'Cannot run in background without variant'.
  endif.