cancel
Showing results for 
Search instead for 
Did you mean: 

Variable with conditional value

Former Member
0 Kudos

Hi everybody,

Is it possible to have a variable that gets its value depending on a condition?

For instance:

If Attribute of Characteristic = TRUE then

Variable = Not asigned (#)

Else

Variable= Time period

Thanks a lot!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Why dont you create a BEx variable of type Exit?

Former Member
0 Kudos

Hi,

I would need an example of an exit that make reference to global variable.

The sample code tha I've got I think is related to older versions because it referes to planning area, level, etc. I don't know if this has changed in IP (BW 7.0)

Can you point me to any samples of code related to the use of global variables?

Thank you very much!

Former Member
0 Kudos

Hi,

You can read the value of a variable from Table RSZGLOBV.

If the variable being read is used in the query, you can also read it from the internal table <i>i_t_bex_var</i> (name needs to be checked).

Former Member
0 Kudos

I guess that with the internal table I'll get the value for the actual instance of the query (I mean the value for the actual user who is executing it).

I'll try to do it with my programmer.

Thank you very much!

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Alfred,

I think you can write the same logic in a FOX...similar to what you have mentioned.

could be something like....

Data AAA type I/F...(depending on the char).

AAA = ATRV(attribure,Char).

If AAA = TRUE

Variable = Not asigned (#)

Else.

Variable= Time period

Endif.

Try and let us know if you face any issues.

Regards

Former Member
0 Kudos

Hi,

Yes, I thought the same but, how do you assign a value in the FOX formula to a global variable? (I know how to do it in a local variable but not a global one)

is there an easy way to do it? or you need to use an ABAP call?

Maybe I've to use a symbol as & or % with the variable name, I don't know how and it makes me crazy.

Thank you for your help!

Former Member
0 Kudos

Hi Alfred,

I thonght you are talking abt a local variable....sorry. I'm not sure how to do this for a global variable.

Regards

Former Member
0 Kudos

Anyway, thank you for your interest.