BEx Workbook Macro

Hi Experts,
I have a workbook with 2 queries in 2 tabs. This workbook will always be broadcasted
Both the queries will have the same number of rows.
I have written a macro to fill a column called Week, which place 1 in the (first row,first column), then increments it till the end of the rows.
Both the sheets need to follow the same logic.
Macro
Sub Week(ParamArray varname())
Sheet2.Activate
Range("A10:A500").ClearContents
    Range("A10").Select
    ActiveCell.FormulaR1C1 = "1"
    Selection.AutoFill Destination:=Range("A10:A" & Range("B65536").End(xlUp).Row), Type:=xlFillSeries
Sheet1.Activate
Range("A10:A500").ClearContents
    Range("A10").Select
    ActiveCell.FormulaR1C1 = "1"
    Selection.AutoFill Destination:=Range("A10:A" & Range("B65536").End(xlUp).Row), Type:=xlFillSeries
End Sub
1. I have also tried writing it in Sub SAPBEXonRefresh(queryID As String, resultArea As Range)
2. In the workbook settings, I tried calling this macro, but it throws me an error stating that the macro is not found.
3. not sure where to write the macro and how to call it.
Please let me know your inputs.
Thanks
El.

Hi,
I can give you the logic for your requirement. Place a contant value in a cell somewhere user can't see. On closing write a macro to set the value to that cell and also at time of opening.
Regards,
-Vj

Similar Messages

  • 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?
    -Jason

    Hi,
    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

  • By opening of a BEx-Workbook marco would be deaktivate

    Hello,
    I'm working on Netweaver 7.0, since tody morning by the openning of a BEx-workbook, I got a message "macro in this file is not agree in the digital signatory, only a macro virus can be the cause. macro would be deaktivate."
    I can open the work book, but the marco is allways deaktivate. If I turn the secrity degree from medium to low, then I can run the query on this workbook. I get this case since today.
    The workbook, which I created yesterday and saved on my desktop, can be opened without this issue.
    I'm totally confused, can somebody give somme idea?
    Thanks in advance.
    Edited by: hallochen on Nov 20, 2008 5:11 PM

    Dear Renee,
      Kindly check if this will be applicable to your scenario.
      Since you have changed your query to meet the user's requirements by adding a hierarchy, etc.:
      1) Open your workbook where this query is assigned to.
      2) Once the workbook has been opened, instead of refreshing the query, try to click the "change (global)" option in Bex toolbar. This should lead you to the query which you previously changed.
      3) In the query designer, just do a re-save and execute. The query will be executed on the workbook with its changes.
      4) If the desired results have been obtained in your workbook, re-save your workbook with this new layout.
      5) Close and re-open your workbook and refresh it once again. It should now generate the new changes based on your query.
      Hope this helps..
      Thanks..

  • Create a number of Dynamic Charts based on "Work Centre" in BEx Workbook?

    Hi all,
    We are on BI 7.0
    I am trying to create a number of dynamic charts in a BEx workbook based on the different values of "Work Centre" so that each unique work centre has its own chart.
    All titles and descriptions would have to be dynamic based on the work centre.
    I.e If there are 20 work centres we would need 20 charts. 30 work centres 30 charts etc.
    Also to add a little more complexity we need to only show a chart if a key figure (Demand Hrs) has a value greater than ZERO.
    Would be very grateful and would assign generous points for a solution.
    This needs to be done in a BEx workbook.
    Thanks in advance,
    Steve Jones
    BI Consultant

    Hello,
    The only possible way you can have a work around is with help of VB macros.
    The logic would be simple: Have a VB Script to check the varying work centres from the report. Then for each work centre check for demand hrs greater than zero. Then you can go with a for or while loop to create the graphs as per needed.
    Take help of VB Script expert for this if needed. Also if you want to work around for yourself you can check the record marco functionality of the excel. VB Script Macro is your only way out and as in your case youu2019re using workbook, this satisfies your need.
    Regards,
    Shashank

  • BEx workbook Default variant not working with Broadcaster

    Hi,
    We are broadcasting a BEx workbook, which has more than 1 queries. We have a default variant to populate all the input variables. But while broadcasting, this default variant is not populated sometimes, So the query returns wrong results. It happens randomly. I have checked broadcast logs also nothing unusual found. Can someone throw some light.
    Thanks

    Hi,
    We are broadcasting a BEx workbook, which has more than 1 queries. We have a default variant to populate all the input variables. But while broadcasting, this default variant is not populated sometimes, So the query returns wrong results. It happens randomly. I have checked broadcast logs also nothing unusual found. Can someone throw some light.
    Thanks

  • BEx workbook does not open from portal when excel is already opened

    Hi all,
    When I go to the portal and open a BEx workbook from there while excel is already open, then the workbook does not open.
    When I close excel and then open the BEx workbook it all works fine.
    I do not get any error: just nothing happens.
    Any idea how to solve this?
    Versions:
    BI 3.5
    Excel 2003
    ADDITIONAL INFO
    I found this only happens when excel is open with a cell in edit mode. Whenc I then open BEx from the portal I get the error 'please install suitable version'.
    Let my know if you have any advice.
    Message was edited by:
            Arjen de Ruiter
    null

    No solution for this.

  • Problem in BEx Workbook Printing

    Hi,
    I need to print a BEx workbook. The column headers in the report is months, i.e April, May, June... till March. When I print the workbook the column header is getting truncated.
    Please advise me what needs to be done to print the entire column text. Please suggest me if there are any settings.
    Best Regards,
    Krishna

    Hi,
    Enable the AutoFit property of the design items.
    This Autofit option will be available in the Properties of Design Items dialog.
    If the Autofit is enabled then the text displayed will be fit within the cell.Hence there wont be any truncation issues.
    Before printing adjust the Print Area and check Print Preview
    Rgds,
    Murali

  • How to create hyperlink in BEx workbook?

    All, I have 2 queries in a BEx workbook on 2 different worksheets. Both queries have 0materials in the row. The user wants to be able to click on material XYZ in worksheet 1 and then be directed to the corresponding line (i.e. for that material XYZ) in worksheet 2. Is this possible to do via a hyperlink?
    Cheers!

    Cheers but a simple hyperlink will not do. I need to link to the same material number in a different worksheet. So in worksheet 1 I have for example the following lines
    Mat nr
    123
    333
    444
    555
    in worksheet 2 I have lines
    Mat nr
    904
    768
    123
    333
    444
    555
    If I click on 333 in first sheet I want to jump to the line with material 333 in worksheet 2.

  • Display input variables in BEx workbook header

    Hi forum,
    I created a global BEx workbook template and would like to display the input variables (user entries) in the header section. On refresh of the workbook, this section should be updated with the new input variables. I am on BEx 7.0 and already experimented with text elements in the Design Mode of BEx Analyzer. However, you can only select general filter values, not specifically variables.
    On release BI 3.x  the Visual Basic function SAPBEXshowTextElements(selectgroup, ...) was available. You could set selectgroup to "V" (show variables only) and retrieve the variable values.
    However on 7.0 this function does not seem to work any longer.
    Do you know how this can be achieved in BEx Analyzer 7.0?
    Thanks,
    Alex

    Hi,
    1) Keep variable in default values in Filters.if u keep variable in default values user enterd value will be displayed in workbook filters.
    2) Open workbook and go to design mode.
    3) Delete the header text item and also delete the header picture bar.
    4) Write report name in "A1".
    5) At the end of report name (say H1or I1) use this excel formula =Replace(old text,start_num, num_chrs, new_tex).
    With this whenever user changes the variable value will be changed in report header.
    Hope it is useful.
    Thanks,
    Ashok

  • Link to BEx Workbook in STS

    Hi,
    We have Bex workbooks created as planning applications in IP.
    Could anyone suggest how these workbooks can be called from STS? For web applications we can provide the link to planning application directly in the STS customizing but not sure how we can achieve the same for BEx workbooks.
    Regards,
    Deepti

    Hi Guys,
    You can broadcast the workbook with <PR_ONLINE_LINK> in the broadcast message get the URL. When you launch the URL later, it will trigger your Bex Analyzer to launch the workbook.
    Hope this helps.
    Regards,
    Wira

  • After implementing Note 992032 getting errors in Bex workbook

    Hi All,
    After Implementing the note 992032 (You must first implement Notes 932065, 935140, 948389, 964580 and 969846, which provide information about using transaction SNOTE. Otherwise, problems and syntax errors may occur when you deimplement some notes) getting error messages in BEx workbook when try to filter on any InfoObject but when I run query I'm getting data but not able to filter, we are using BI 7 on patch 11. When implementing the note number 964580 it's giving error and this particular note number is not yet implemented.
    Getting error messages like:
    1. Error reading the data of InfoProvider 0FIAR_O03
    2. An error occurred in the program:
    3. ORA-20000: Insufficient privileges ORA-06512: at "SYS.DBMS_STATS", line 2150 ORA-06512: at "SYS.DBMS_STATS", line 14112 ORA-06512: at line 1
    4. System error in program CL_RSR_WWW_RENDERER and form GET_FILTER_VALUES_CHA:03 (see long text)
    Before implementing 992032 everything worked well.
    Could anyone please help!
    King Regards
    Suman

    We are getting similar errors after applying BW SP11 yesterday on our dev BW system.  I've opened a message with SAP support .  If anyone gets a solution for this please post it.
    Regards,
    Ron.

  • Calling Bex Workbooks from the Web Dynpro

    Hi All,
    I'm calling Bex Workbooks from my dynpro using the following code:
    create reentrance ticket
      call function 'CREATE_RFC_REENTRANCE_TICKET'
        importing
          ticket                 = l_ticket
        exceptions
          ticket_logon_disabled  = 1
          ticket_creation_failed = 2
          kernel_too_old         = 3
          others                 = 4.
      check sy-subrc = 0.
    system number
      call function 'GET_SYSTEM_NUMBER'
        importing
          instancenumber = l_sysno.
    create the shortcut
      CONCATENATE '[System]'                           cl_abap_char_utilities=>cr_lf
        'GuiParm=' sy-host ` ` l_sysno                 cl_abap_char_utilities=>cr_lf
        'Client=' sy-mandt                             cl_abap_char_utilities=>cr_lf
        '[User]'                                       cl_abap_char_utilities=>cr_lf
        'Name=' sy-uname                               cl_abap_char_utilities=>cr_lf
        'at="MYSAPSSO2=' l_ticket '"'                  cl_abap_char_utilities=>cr_lf
        'Language=' sy-langu                           cl_abap_char_utilities=>cr_lf
        '[Function]'                                   cl_abap_char_utilities=>cr_lf
        'Title='                                       cl_abap_char_utilities=>cr_lf
        'Command=*RRMXP WBID=' l_workbookid            cl_abap_char_utilities=>cr_lf
        'Type=Transaction'                             cl_abap_char_utilities=>cr_lf
        '[Configuration]'                              cl_abap_char_utilities=>cr_lf
        'GuiSize=Normal window'                        cl_abap_char_utilities=>cr_lf
        'Workplace=true'                               cl_abap_char_utilities=>cr_lf
        '[Options]'                                    cl_abap_char_utilities=>cr_lf
        'Reuse=0'                                      cl_abap_char_utilities=>cr_lf
        into l_content.
      lo_conv = cl_abap_conv_out_ce=>create( ).
      lo_conv->write( data = l_content ).
      l_content_x = lo_conv->get_buffer( ).
      concatenate l_workbookid `.sap` into l_filename.
      cl_wd_runtime_services=>attach_file_to_response(
        i_filename      = l_filename
        i_content       = l_content_x
        i_mime_type     = `application/octet-stream`
        i_in_new_window = abap_false
        i_inplace       = abap_true ).
    Most of the time it's working fine - but some user experience a "Host Unknown" failure ?? - I suspect than it has something to do with contacting Excel, but I can't figure out exactly what goes wrong. The users have all needed componets of course, and they can run Workbooks from SAP GUI without getting this error.
    Thanx Ahead.

    Look at below link: it might help you.
    [WAD URL Call for BEX|/thread/268199 [original link is broken];
    Raja

  • Issue opening BEx workbooks after 720 upgrade

    Hi Gurus,
    We use a custom web template to leverage BW [BW-ABAP] security over the Portals [BW-JAVA]. In other words we do not need to create iViews in Portal for each BW Query or BW Workbook.
    Earlier we were using 710 GUI with BI 70 Add-on. Now we are upgrading to 720 GUI [patch 5] with BI 70 Add-on [patch 400].
    Now when I launch BEx workbook via the Portal, it launches Excel with the BI 70 Add-on [under Excel Add-Ins tab] and then it launches the SAP GUI screen with a success message "No authorization to change role abc. Message no. S#423".  The BEx Toolbox connection icon [right besides the yellow question-mark] shows disconnected.
    This happens even when I try to launch the BEx Analyzer directly from Portal.
    Any help or guidance is heartily appreciated and I promise to award points.
    Thanks and regards,
    Pratik

    Hello,
    Please apply these 2 Notes and check again.
    1476882
    1180683
    Regards,
    Michael

  • Comments in Bex-Workbook IP BW 7.0 ?

    Hello Planning experts
    It is possible to insert a 'Comment field' in a - let say- Web planning application using the single document web item. However I am not aware of any possibilities to do so in the Bex-Workbook. Therefore following 2x questions:
    - Is it possible to insert in BEx-Workbook a Comment field, where the planner could e.g comment the increased budget on a certain cost center?
    - Is it possible to report over the entered comments ( let say in a query?)
    Thanks and welcome every answer, which helps me to know this comment  feature possibilities in IP BW 7.0
    Christian

    Hi,
    As far as I know, this functionality is not available in excel frontend (not cent-percent sure about latest SPs becuase I heard that this was planned for some future SP).
    Documents created in queries are saved against a combination value of characteristics - to be able to report on them, you should have the same drilldown of characteristics in the query alongwith which you want to fetch the documents. Also, make sure that the save level of the documents in infoprovider level and not query level (can be set in Web Template properties).

  • Call Bex Workbook from browser through ActiveX or OLE

    Hello. I have to run bex workbook from browser. I found out that I can do it through ActiveX and "SAPBEX.XLA!SAPBEXgetConnection", but I didn't succeed. Can anybody help me out?

    Vanessa,
    Please do not raise the same post across forums ..
    /thread/1257238 [original link is broken]
    the above thread is being considered as duplicate and being deleted - because this particular post has been raised in the correct forum..

Maybe you are looking for