Macros in BI7
Dear All,
How to migrate/use the 3.5 macro code in BI 7 workbook environment...wats the function used to call macros..
in 3.5 we will use SAPBEx on Refresh.. what abt in BI 7.
By
Reddy
My Question was
In 3.x will use Sub SAPBEXonRefresh(queryID As String, resultArea As Range).. to call macro..
But where as in 7.0 wats the function used to call macro.. and this macro name we need to provide in the exit tab of the workbook settings..
Pls provide me the solution.
By
Reddy
Similar Messages
-
Hi,
i'm working with workbooks on BI7, when using Macros they are not saved with the workbook.
How can i use Macros on BI7 workbooks ?
th in advanceHi,
Goto tools,Macro--> VB editor.
After writing the code,dont try to save the VB code just close VB editor.
Save the Workbook. When u open it again u can see the code saved in VB editor.
VB code need not be saved in the editor seperatley.
Hope this helps
Regards,
Aparna -
Costs involved (macro level) upgrading to BI7
Hi BI Experts,
If a customer implemented BW3.5 less than 1 year and never went 'live', and now decides to upgrade to BI 7, continuing with the current project,
In your opinion, is the cost involved the same when compared to a customer in the same shoe but have already gone 'live' on BW3.5 a while back?
So, the difference here is in the go-'live' status of BW3.5.
Any comments would be appreciated.
Regards
PascalHi Pom,
It never went 'live' because implementation has not completed. It only began implementation less than 1 year ago.
So, this is precisely my question.
What is the Costs difference for a company in such situation wanting to upgrade to BI 7 and a company who already went 'live' with BW3.5 and also wanting to upgrade to BI 7. That is, from a license fee perspective payable to SAP.
If the costs is the same, that is, you pay $xxxxxxxxx for BW 3.5 regardless of it having gone 'live' or not and you need to pay $yyyyyyyy for BI 7 as long as you upgrade to it.
thanks.
Pascal -
Creating a restricted key figure in BI7 reporting
Hi
I am creating a restricted key figure globally in BI7 query designer, whenever I try to restrict Calender Year /Month, an error message pops up showing:
Runtime error '457' (This key is already associated with an element of this collection), when I click ok another message opens
Runtime error '429' (Active X component can't create object)
and finally Microsoft VB runtime error
Automation (The callee(servernot server application) is not applicable and disappeared; all connections are invalid. The call may have executed.
I am working in BI 7, SAP gui 640 what could be the problem in BI 7???because the same thing is working in BI 3.5 environment.
Regards
IndraneelHi Indraneel,
Try to look for the patch level you are using for SAP GUI, it should be level 14. If lesser than this apply and check. And always disable VB macros.
Assign points if helps.
-Harshal -
Error when refreshing workbook in BEx: Specific Macro CallBack not found
One of our users is getting the following error when refreshing any BEx workbook (in BI7):
Problems while calling the exit on refresh: Specified Macro 'CallBack' is not found in the workbook
This error suddenly started this week, everything was fine before that, and no changes have been made to the user's PC. The problem is specific to this one user's PC.
Any ideas?
-JasonHi,
It seems a common error.
There is a note that mentions the error, and was fixed since BI addons SP 8
Note: 1267942 - Custom macro not being executed on a workbook
Download and test the latest version: bi710sp12_1200-10004472.exe
This should fix the issue.
FYI: SAPGUI 640 is not supported by SAP since 2008. If you are using this version, please download the SAPGUI 7.10 as well.
Thanks
Edward John -
when i create new workbook in BI7 i get the massage "creation of item GRID_1 failed". the long text is
*Diagnosis
BEx Analyzer cannot generate VBA code due to security settings.
System Response
VBA code is not generated.
Procedure
Choose the menu path, Tools -> Macro -> Security.
On the 'Trusted publishers' tab, select the 'Trust access to Visual Basic Project' checkbox.
Press OK..
Close BEx Analyzer and start working as before.
This access is needed during the generation of the VBA code only.*
The configuration in the excel macro security is o.k.
Edited by: David INTRATOR on Jan 22, 2008 2:06 PMhi david,
chk with basis guys for the installation also chk your authorization for creation of workbook.
Ramesh -
Hi,
I have a workbook contains 2 queries, i would like to append macro to the workbook for additional formatting, I have macro created which takes input from desktop and saves the output on desktop.
How can i add this Macro to the workbook, I have gone through all the posts, Once after i am in VBA editor and add module, i am not getting Sub SAPBEXonRefresh(queryID As String, resultArea As Range) by default, Is this normal, Do we need to manually type this. and whats the id we need to give is this query technical name or something else and what parameters we need to give for resultarea,
Can you guys provide as many detaisl as possible.
Weare in 3.5 version, we are planning to move into BW 7 does this macros work in BI7?
ThankS,
NavThanks for your quick response, What exactly shortcut is?
Can you tell me whether Sub SAPBEXonRefresh(queryID As String, resultArea As Range) will be there by default or we need to manullay maintain,
queryID As String, what exactly we need to enter here
resultArea As Range what exactly we need to enter here
Thanks,
Naveen -
Migration of queries and work books to BI7
Hi,
I would like to Migrate all the existing 3.X queries and work books to BI7.0 in Development box.
Is it possible to capture these changes into a transport request, if possible how do I capture.
Please guide.
Regards,
Sharma. IVNSharma,
Its better to collect all queries of a Infoprovider in a single request as u can avoid locking of dependent objects in different requests..Migrating workbooks would be tricky if u have any macros.Have a look at below links on migrating front-end objects
SAP NetWeaver 2004s BI - Define your Publishing Strategy Part 2
SAP NetWeaver 2004s BI - Define your Publishing Strategy Part 1
Migrating Advanced BEx Analyzer Workbooks - What VBA is Supported?
Chandu -
VBA Macro code to refresh query
Hi people,
First post...
I am running BI7.1 and have set up a workbook with various queries that have to be run on separate days.
I have a cover page that I have set up and want to have buttons on this page that when clicked will only refresh the relevant query for that specific day.
I have searched online in various places and have only found the VBA code to do this using the old BEx Analyser (3.5)
Is there a way or code available to enable me to automaticallt refresh a query using a macro?
Thanks
SteveHi,
I have tried to do this on numerous occasions, and no matter what I do the macro recorder does not pick up any of the refresh activities.
The VBA code I have used in the past is "Run "SAPBEX.XLA!SAPBEXrefresh", False"
This worked when I used to use Analyzer 3.5 however it doesn't work in the current version.
I am looking for a similar piece of code that will allow me to add to existing macro which will trigger the refresh of the query.
Any help is much appreciated
Thanks
Steve -
Macro to open and save as a value in a cell
How can I create a macro (I've named it Test) that will:
1.bring up the open dialogue box (to allow the user to choose a file)
2.save the file, with the file name determined by the text in cell A3 in .xlsx format
I have two pieces code that seem to work individually, but not together:
Dim strFileName As String
strFileName = Application.GetOpenFilename
If strFileName = "False" Then Exit Sub
MsgBox strFileName
ThisFile = Range("A3").Value
ActiveWorkbook.SaveAs Filename:=ThisFile
Thanks for the help!Hi
With very little change, this works for me. I just declared your last variable. (thisFile)
Sub test()
Dim strFileName As String, thisFile As String
strFileName = Application.GetOpenFilename
If strFileName = "False" Then Exit Sub
MsgBox strFileName
thisFile = Range("A3").Value
ActiveWorkbook.SaveAs Filename:=thisFile
End Sub
Cimjet -
Memory usage of excel stays high after Macro is executed and excel crashes after trying to close it
Hi,
I'm trying to resolve an issue with an excel based tool. The macros retrieve data from an Oracle database and do calculations with the data. They also open and write into files in the same directory. The macros all run and finish the calculations. I can
continue to use and modify the sheet. I can also close the workbook, however excel memory usage I see in the windows Task manager stays elevated.If I close Excel it says: Excel stopped working and then it tries to recover information...
I assume something in the macro did not finish properly and memory was not released. I would like to check what is still open (connection, stream or any other object) when I close the workbook I would like to have a list of all still used memory. Is there
a possibility to do so.
Here the code I'm using, its reduced to functions which open something. Functions
get_v_tools() and get_change_tools() are same as get_client_positions().
Public conODBC As New ADODB.Connection
Public myPath As String
Sub get_positions()
Dim Src As range, dst As range
Dim lastRow As Integer
Dim myPath As String
lastRow = Sheets("SQL_DATA").Cells(Sheets("SQL_DATA").rows.Count, "A").End(xlUp).Row
Sheets("SQL_DATA").range("A2:AD" & lastRow + 1).ClearContents
Sheets("SQL_DATA").range("AG2:BE" & lastRow + 2).ClearContents
Sheets("SQL_DATA").range("AE3:AF" & lastRow + 2).ClearContents
k = Sheets("ToolsList").Cells(Sheets("ToolsList").rows.Count, "A").End(xlUp).Row + 1
Sheets("ToolsList").range("A2:M" & k).ClearContents
'open connection
Call open_connection
lastRow = Sheets("SQL_DATA").Cells(Sheets("SQL_DATA").rows.Count, "A").End(xlUp).Row
If lastRow < 2 Then GoTo ErrorHandling
'copy bs price check multiplications
Set Src = Sheets("SQL_DATA").range("AE2:AF2")
Set dst = Worksheets("SQL_DATA").range("AE2").Resize(lastRow - 1, Src.columns.Count)
dst.Formula = Src.Formula
On Error GoTo ErrorHandling
'new prices are calculated
newPrice_calculate (lastRow)
Calculate
myPath = ThisWorkbook.Path
'Refresh pivot table in Position Manager
Sheets("Position Manager").PivotTables("PivotTable3").ChangePivotCache ActiveWorkbook. _
PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
myPath & "\[Position_Manager_v1.0.xlsm]SQL_DATA!R1C2:R" & lastRow & "C31" _
, Version:=xlPivotTableVersion14)
ErrorHandling:
Set Src = Nothing
Set dst = Nothing
If conODBC.State <> 0 Then
conODBC.Close
End If
End Sub
Sub open_connection()
Dim sql_data, sql_data_change, sql_data_v As Variant
Dim wdth, TotalColumns, startRow As Integer
Dim rst As New ADODB.Recordset
Errorcode = 0
On Error GoTo ErrorHandling
Errorcode = 1
With conODBC
.Provider = "OraOLEDB.Oracle.1"
.ConnectionString = "Password=" & pswrd & "; Persist Security Info=True;User ID= " & UserName & "; Data Source=" & DataSource
.CursorLocation = adUseClient
.Open
.CommandTimeout = 300
End With
startRow = Sheets("SQL_DATA").Cells(Sheets("SQL_DATA").rows.Count, "A").End(xlUp).Row + 1
sql_data = get_client_positions(conODBC, rst)
wdth = UBound(sql_data, 1)
Sheets("SQL_DATA").range("A" & startRow & ":AA" & wdth + startRow - 1).Value = sql_data
'Run change tools instruments
startRow = Sheets("ToolsList").Cells(Sheets("ToolsList").rows.Count, "A").End(xlUp).Row + 1
sql_data_change = get_change_tools(conODBC, rst)
wdth = UBound(sql_data_change, 1)
Sheets("ToolsList").range("A" & startRow & ":M" & wdth + startRow - 1).Value _
= sql_data_change
'open SQL for V tools instruments
startRow = Sheets("ToolsList").Cells(Sheets("ToolsList").rows.Count, "A").End(xlUp).Row + 1
sql_data_v = get_v_tools(conODBC, rst)
wdth = UBound(sql_data_v, 1)
Sheets("ToolsList").range("A" & startRow & ":L" & startRow + wdth - 1).Value = sql_data_v
conODBC.Close
ErrorHandling:
If rst.State <> 0 Then
rst.Close
End If
Set rst = Nothing
End Sub
Private Function get_client_positions(conODBC As ADODB.Connection, rst_posi As ADODB.Recordset) As Variant
Dim sql_data As Variant
Dim objCommand As ADODB.Command
Dim sql As String
Dim records, TotalColumns As Integer
On Error GoTo ErrorHandling
Set objCommand = New ADODB.Command
sql = read_sql()
With objCommand
.ActiveConnection = conODBC 'connection for the commands
.CommandType = adCmdText
.CommandText = sql 'Sql statement from the function
.Prepared = True
.CommandTimeout = 600
End With
Set rst_posi = objCommand.Execute
TotalColumns = rst_posi.Fields.Count
records = rst_posi.RecordCount
ReDim sql_data(1 To records, 1 To TotalColumns)
If TotalColumns = 0 Or records = 0 Then GoTo ErrorHandling
If TotalColumns <> 27 Then GoTo ErrorHandling
If rst_posi.EOF Then GoTo ErrorHandling
l = 1
Do While Not rst_posi.EOF
For i = 0 To TotalColumns - 1
sql_data(l, i + 1) = rst_posi.Fields(i)
Next i
l = l + 1
rst_posi.MoveNext
Loop
ErrorHandling:
rst_posi.Close
Set rst_posi = Nothing
Set objCommand = Nothing
get_client_positions = sql_data
End Function
Private Function read_sql() As String
Dim sqlFile As String, sqlQuery, Line As String
Dim query_dt As String, client As String, account As String
Dim GRP_ID, GRP_SPLIT_ID As String
Dim fso, stream As Object
Set fso = CreateObject("Scripting.FileSystemObject")
client = Worksheets("Cover").range("C9").Value
query_dt = Sheets("Cover").range("C7").Value
GRP_ID = Sheets("Cover").range("C3").Value
GRP_SPLIT_ID = Sheets("Cover").range("C5").Value
account = Sheets("Cover").range("C11").Value
sqlFile = Sheets("Cover").range("C15").Value
Open sqlFile For Input As #1
Do Until EOF(1)
Line Input #1, Line
sqlQuery = sqlQuery & vbCrLf & Line
Loop
Close
' Replace placeholders in the SQL
sqlQuery = Replace(sqlQuery, "myClent", client)
sqlQuery = Replace(sqlQuery, "01/01/9999", query_dt)
sqlQuery = Replace(sqlQuery, "54747743", GRP_ID)
If GRP_SPLIT_ID <> "" Then
sqlQuery = Replace(sqlQuery, "7754843", GRP_SPLIT_ID)
Else
sqlQuery = Replace(sqlQuery, "AND POS.GRP_SPLIT_ID = 7754843", "")
End If
If account = "ZZ" Then
sqlQuery = Replace(sqlQuery, "AND AC.ACCNT_NAME = 'ZZ'", "")
Else
sqlQuery = Replace(sqlQuery, "ZZ", account)
End If
' Create a TextStream to check SQL Query
sql = sqlQuery
myPath = ThisWorkbook.Path
Set stream = fso.CreateTextFile(myPath & "\SQL\LastQuery.txt", True)
stream.Write sql
stream.Close
Set fso = Nothing
Set stream = Nothing
read_sql = sqlQuery
End FunctionThanks Starain,
that's what I did the last days and found that the problem is in the
newPrice_calculate (lastRow)
function. This function retrieves data (sets it as arrays) which was correctly pasted into the sheet, loops through all rows and does math/calendar calculations with cell values using an Add-In("Quantlib")
Public errorMessage as String
Sub newPrice_calculate(lastRow)
Dim Type() As Variant
Dim Id() As Variant
Dim Price() As Variant
Dim daysTo() As Variant
Dim fx() As Variant
Dim interest() As Variant
Dim ObjCalend as Variant
Dim newPrice as Variant
On Error GoTo Catch
interest = Sheets("SQL_DATA").range("V2:V" & lastRow).Value
Type = Sheets("SQL_DATA").range("L2:L" & lastRow).Value Id = Sheets("SQL_DATA").range("M2:M" & lastRow).Value Price = Sheets("SQL_DATA").range("T2:T" & lastRow).Value
daysTo = Sheets("SQL_DATA").range("K2:K" & lastRow).Value
fx = Sheets("SQL_DATA").range("U2:U" & lastRow).Value
qlError = 1
For i = 2 To lastRow
If (i, 1) = "LG" Then
'set something - nothing spectacular like
interest(i, 1) = 0
daysTo(i , 1) = 0
Else
adjTime = Sqr(daysTo(i, 1) / 365)
ObjCalend(i,1) =Application.Run("qlCalendarHolidaysList", _
"CalObj", ... , .... other input parameters)
If IsError(ObjCalend(i,1)) Then GoTo Catch
'other calendar calcs
newPrice(i,1) = Application.Run( 'quantLib calcs)
End If
Catch:
Select Case qlError
Case 1
errorMessage = errorMessage & " QuantLibXL Cal Error at: " & i & " " & vbNewLine & Err.Description
ObjCalend(i,1) (i, 1) = "N/A"
End Select
Next i
Sheets("SQL_DATA").range("AB2:AB" & lastRow).Value = newPrice
'Sheets("SQL_DATA").range("AA2:AA" & lastRow).Value = daysTo
' erase and set to nothing all arrays and objects
Erase Type
Erase id
Erase Price
Set newPrice = Nothing
Is there a possibility to clean everything in:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
End Sub
Thanks in advance
Mark -
Hello Experts,
I am creating a macro, where the requirement is; user would select few columns of a KF & hit on a macro.
The values in the KF should get multiplied by 2.
Any clue how should I add ( *2) functionality in operation / function ?. Any other suggestion is welcomed.
Please help
Regards
Rahul ChitteHi Rahul,
You can set the macro to run for few period.
1) In the step of the macro, select the period you want to run
2) Within the step, Results row (Key figure row 'XXX") = Key figure row 'XXX" * 2 (remember to maintain a space between * and 2)
3) Check the macro for any error, which would help you for any inconsistencies
4) activate the macro to test your requirement.
hope this would solve your requirment.
Regards,
Nawanit -
Dear all,
I have a couple of Word templates (in document libraries) that should have the filename and page count on the footer of the front page. It seams there is an issue with Word that these do not automatically update (MS kb 832897).
I am using word 2010, 64 bits.
This is solved with a Macro.
When placing the word with macro template in SharePoint, SP blocks it and the macros are not ran.
Any one with experience on this?
Thanks in advance.
GonçaloIt is not possible to run a macro in SharePoint after the document has been uploaded.
You can replicate this scenario by creating a SPItemEventReceiver which will run customized code on ItemAdded in your document library.
Please go through the following articles for details:
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spitemeventreceiver.aspx
http://msdn.microsoft.com/en-us/library/office/ms437502%28v=office.14%29.aspx
Please don't forget to mark it answered, if your problem resolved or helpful. -
How to call HR Macros in ABAP-Webdynpro
HI all,
I want to extract HR data in webdynpro view.
Where should I give Logical Database PNP?
The ifnotypes key word is not accepting in Webdynpro coding?
Where should I give GET PERNR event in Webdynpro?
When I use RP_PROVIDE_FROM_LAST .... says error message
Statement "RP_PROVIDE_FROM_LAST" is not defined. Check your spelling .
How to use the Macros in Webdynpro (VIEW) methods.
First time I'm working in ABAP-HR Webynpro.
Please help me out..
Thanks,
PrasadHi,
How did u solve this? pls provide the solution.
Regards,
Lakshmi. -
Calling HR Macros in ABAP-Webdynpro
HI all,
I want to extract HR data in webdynpro view.
Where should I give Logical Database PNP?
The ifnotypes key word is not accepting in Webdynpro coding?
Where should I give GET PERNR event in Webdynpro?
When I use RP_PROVIDE_FROM_LAST .... says error message
Statement "RP_PROVIDE_FROM_LAST" is not defined. Check your spelling .
How to use the Macros in Webdynpro (VIEW) methods.
First time I'm working in ABAP-HR Webynpro.
Please help me out..
Thanks,
PrasadHi,
I suspect that you are in a right forum. Please post it to appropriate forum.
Maybe you are looking for
-
My phone will not let me download the most recent update for iOS 7.1. It says I need a wifi connection and will not allow me to push the 'Download & Install' button, even when I am at home and my wifi is on. How do I fix this?
-
Honestly, I have never had a customer ask me 'how' do I identify which Items go together in a specific category. I am thinking I start with the Functional Area (Inv, PO, OM, WM, etc..) attributes, and start the grouping there. The customer is askin
-
How do I get my photos from a previous version of Photoshop Elements (6) into Photoshop Elements 12? Do I restore from a backup? I have over 12,000 pics ( a good portion with multiple versions) and don't want to lose captions and metadata. Thank you
-
Issue with profile Options in Inventory
I am trying to work with profile options in Inventory and I have 4 Operating units and 2 Legal Entity and 1 Business Group. At this point I am not sure as how to attach OU to MO:OU ( as there are 4). Similar concern is for GL Ledger.. Please help....
-
Infostructure update routine : debug problem
Hi All, We have created three update routines for three corresponding infostructures. But I am not able to debug this routine. I tried to put a hard breakpoint also, but it was of no use. The Infostructure logs the changes in the sales order. How can