cancel
Showing results for 
Search instead for 
Did you mean: 

populate BEx date variable dynamically from VB

Former Member
0 Kudos

Hi,

We've a requirement to use SAPBEXsetVariables from within VB to automate a workbook that needs to run on dialy basis & this is on BW 3.0.

Everything works perfect except variables can't be populated dynamically.

As pete mentioned in other thread, on sheet2, I created variables range & running the workbook that needs to 2 variables and these are always "current date-1" & "current date-2"

If i hardcode values like '20071010 & '20041009 which are of format (number stored as text), it works great.

but, if i include excel formulas like today()-1 & today()-2 error message is coming with " Variables Contain Invalid Values"

Is there a way, I can get this workbook working with formulas to have dynamic values populated to BEx variables.

Appreciate your help.

Hari Immadi

http://immadi.com

SEM BW Analyst

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

May be you can try this:

calculate the date, =TODAY()-1 in cell A1 and =TODAY()-2 in cell A2.

for the cell refering to your variable say V1 and V2 link these cells to A1 and A2.

here we are not calculating the veriable value by excel formula but we are linking the result of this calcualtion to variable.

Former Member
0 Kudos

thanks for your reply.

I already tried that but it's not working.

even a macro that calculates required date with <b>no excel date format</b> and is not working (though, VB application sees this as a value but not a date).

Hari Immadi

http://immadi.com

SEM BW Analyst

Former Member
0 Kudos

Check whether the formula today()-1 is returning the format '20071010'...

may be the problem with the format.....

Regs

Gopi

Assign point if it is solved

Former Member
0 Kudos

i forced the cell format to be YYYYMMDD with which excel provides a value of 20071010 for BW variable, but same issue.

Hari Immadi

http://immadi.com

SEM BW Analyst

Answers (0)