cancel
Showing results for 
Search instead for 
Did you mean: 

Varibles in Bex

Former Member
0 Kudos

I'm creating a report that get data using statement like <u>Document Date <= VToDate or Billing doc. date <= VToDate</u>, so, I have 2 questions.

1. The standard logic to connect different restrictions seems like "and", not "or"

2. How to use the same variable for different restictions?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Hiatao,

Could you please be more specific..

Also if you create a variable on a characteristic you can have single,multiple single,range options.

Is it what you are looking for.

Hope this helps

-Doodle

Message was edited by: Doodle

Former Member
0 Kudos

Hi Doodle, thanks for your reply.

My problem is that I need the same user input value for both Order Date and Billing Date

Former Member
0 Kudos

Haitao,

Create 2 variables one for billing date -User i/p variable;another for doc date - customer exit variable.

when user enters a date for billing date , the customer exit for doc date will automatically gets populated with the same date as billing date entered earlier.

Hope thsi helps

-Doodle

Former Member
0 Kudos

Thanks Doodle, another question is how to use "or", for criteria (BILL_DATE is NULL or BILL_DATE < variable)

former_member188325
Active Contributor
0 Kudos

Hi,

(BILL_DATE == 0 OR BILL_DATE<Variable)

here == (is equal to) and 'OR' (logical OR) are available under boolean operators.

Thats what you are lookig for?

Thanks

Former Member
0 Kudos

For (BILL_DATE == 0 OR BILL_DATE<Variable), I can use restrict -> selection by 2 rows, then, how to build like (DOC_DATE < Variable OR BILL_DATE < Variable) under Query Designer, I couldn't find a way to define boolean between 2 Characteristics, thanks.

former_member188325
Active Contributor
0 Kudos

Hi,

try this:

Create 2 Formula variables with processing type as 'user entry/default value', and 'ready for input' checked(by default it would be there').

Then use these two in formula.

Thanks

former_member188325
Active Contributor
0 Kudos

Hi,

with reference to your 1st post

<i>I'm creating a report that get data using statement like Document Date <= VToDate or Billing doc. date <= VToDate, so, I have 2 questions.</i>

You would like to allow User to enter Document date and Billing Doc. date....Am i right?

and let me know whether VtoDate is Characteristic or KF in your Query?

Thanks

Former Member
0 Kudos

Thanks Murali.

I have 2 Chars, one is DOC_DATE, another is BILL_DATE, and I want to retrieve data from ODS using (DOC_DATE <= VToDate or BILL_DATE <= VToDate), here VToDate is a Variable I created for user to enter a specific date.

Now I know to use Customer Exit to populate a variable by another variable, and I still have prolem how to implement 'OR' in query designer.

Formula variable is only for KFs, am I right?

former_member188325
Active Contributor
0 Kudos

Hi Du,

Create two formula variables one for DOC_DATE and one for BILL_DATE processing type as 'replacement path' and in next screen select characteristic as DOC_DATE>next>replace variable with 'key'--->dimension Id as 'Date'.

while creating second formula variable for BILL_DATE,select Characteristic as BILL_DATE with same properties.

Now when you create formula (DOC_DATE <= VToDate OR BILL_DATE <= VToDate), you can see all under formula variables.

OR (logical OR) is available under Boolean operators.

Dont forget drag and drop DOC_DATE and BILL_DATE in rows and Hide them as you dont need (Context menu>properties>display as -->no diplay for both time chars).But if dont have them in rows,you will not get values for formula variables instead 'X'.

Got it? let me know.

Thanks

Former Member
0 Kudos

Hi Doodle,

I created 2 variables, one for billing date -User i/p variable(ZTODATE); another for doc date - customer exit variable(ZTODATE1), and set 'Copy personalization data from the variable' to ZTODATE.

When I executed the query, system prompted 'Abort No value could be determined for variable ZTODATE1', did I do something wrong?

Thanks.

Former Member
0 Kudos

Haitao,

You have to write ABAP Code in the customer exit to populate ztodate1. (ztodate1 then gets data from the user i/p variable ztodate.)

-Doodle

Former Member
0 Kudos

Doodle,

Could you give me a sample routine how to write this customer exit to populate variable? And, what is the name of the customer exit? I have never worked on this, thank you for your kind help.

Haitao

Former Member
0 Kudos

I found that the function module used is EXIT_SAPLRRS0_001. I defined ZTODATE as single value variable, which code I should insert to populate ZTODATE1(Customer Exit) from ZTODATE?

DATA: L_S_RANGE TYPE RSR_S_RANGESID.

CASE I_VNAM. " Variable name

WHEN 'SINGVAL'

CLEAR L_S_RANGE.

L_S_RANGE-LOW = ZTODATE. " Is it correct?

L_S_RANGE-SIGN = 'I'.

L_S_RANGE-OPT = 'EQ'

APPEND L_S_RANGE TO E_T_RANGE.

ENDCASE.

This is the first time for me to write enhancement, all resposes are greatly appreciated.

Former Member
0 Kudos

Haitao,

Will send you sample code soon

-Doodle

Former Member
0 Kudos

Hi Doodle,

I couldn't find out a way to populate ZTODATE1 from ZTODATE by now, my project is going to due today, I'm so anxious about it, could u pls help me? I'm waiting for the answer online.

Thx a lot!

Haitao

Former Member
0 Kudos

Haitao,

Pls check www.service.sap.com/bi

how to guides 2.x "derive variable from another variable"

Sorry for the delay.Dint check this link until now

-Doodle

Former Member
0 Kudos

Thx, Doodle, I will check that document.

Answers (0)