cancel
Showing results for 
Search instead for 
Did you mean: 

Variable Type - Selection option

Former Member
0 Kudos

Hi All,

I am trying to include a varibale which has Selection option. Can you please have the variable default selection automatically DEFAULT to u201CEXCLUDEu201D ???

Currently, its taking "INCLUDE".

Please suggest.

Regards,

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

I believe you can do that with an exit variable ready for input.

Then in the code in the step 1 (step just before the variable entry) you can insert the value(s) you want with the selection option = 'E' (exclude).

There you go,

Diogo.

Former Member
0 Kudos

Hi,

Can you give me the ABAP Code, how this can be achieved?

Regards,

Richa

Former Member
0 Kudos

Hi,

The way around is take the input and restrict it as exclude at the query level and put the description infront of the variable that the selections are exculded.

I know this is the not what u want but this is the easiest way and mostly used.

but as said try for exit variables and here all you have have to do is in place of EQ you have to put NEQ thats all !

Thanks

Ajeet

Former Member
0 Kudos

Ok,

This is a very simple example:

l_s_range should be defined as a global variable like this:


DATA: l_s_range TYPE rsr_s_rangesid.


WHEN 'VAR_NAME'.
     IF i_step = 1.
 
         CLEAR l_s_range.
         l_s_range-sign     =  'E'.
         l_s_range-low      =  '1234'.
         l_s_range-opt      =  'EQ'.
         APPEND l_s_range TO e_t_range.
     ENDIF.

Create a user exit variable ready for input and with the example above when the selection screen appears of the variable entry of the query the variable with the name VAR_NAME is gonna be filled by default with the value different (excluded EQ) than 1234.

Hope this helps,

Diogo.

Former Member
0 Kudos

Hi Diogo,

The l_s_range-low = '1234' need not necessary has to be a constant value. So instead of that what can I use?

Regards,

Richa

Former Member
0 Kudos

Hi,

You can use whatever you want!

I just throw an example of the value '1234'.

You could read that value from a table for example. What do you need to enter?

Diogo.

Former Member
0 Kudos

Hi Diogo,

Hope by using the above code, the dafault value while executing the query in web will show the selection as Exclude instead of Include?

Regards,

Richa

Former Member
0 Kudos

Hi,

I never tried, but I believe is possible.

Try it and let it know in here if it helps.

Diogo.

Former Member
0 Kudos

Hi,

Try this.

Goto Bex analyzer and open your query. Right click and select Restrict on the infoobject. Right click on your variable then you can see the default values.

In the sign option, select "Exclude values". In the default value, enter the value to exclude.

Hope this helps.

Former Member
0 Kudos

I tried to select the default value as Exclude. But it is not taking Exclude by deafult.

This doesn't seems to solve the problem.

Regards.

Former Member
0 Kudos

try and exclude values in the free selections and change them later in the report.

There isn't a way to change the default to EXCLUDE.

I believe it can be done as Diogo mentioned. never did it myself.

Edited by: Raj Coppar on Sep 2, 2008 9:59 AM

Former Member
0 Kudos

Hi

Yes, You can have the default value.

Goto Bex analyser and open your query and goto your infoobject restriction and right click on your variable then you can see the default value. Just provide the defualt value and save.

Regards,

Chama.