Macro Issue

Hello,
I am writing one report, in which I am using macors.
Macro definition
define _sel.
select-options: &1 for &2.
end-of-definition.
loop at lt_dfies into ls_dfies.
For testing purposes,
concatenate ls_dfies-tabname ls_dfies-fieldname into lv_field separated by '-'.
sel lvsel lv_field.
endloop.
when i check this code.. it says lv_sel is already declared, whereas it is not ?
can you tell me where the error is ?
I have made sure that there is NO Include in the report and there is no place the data has been declared ...
any pointers if we have to do something special with macro's

Before the program execute, macro is resolved once and only once as
SELECT-OPTIONS LV_SEL FOR LV_FIELD.
Try to execute in debug, you will get a select-options parameter at the beginning of your program.
Abap doesn't resolve this declaration dynamically.
If you want to dynamically set select-options, look at <a href="http://sap.ittoolbox.com/code/archives.asp?i=10&d=3038&a=s">Source: Dynamic Table Maintenance (enhanced)</a>, there you will find a program which maintain a table dynamically defined with denamic selections like in logical database.
Regards

Similar Messages

  • Shake Macro Issue

    I have posted this in other shake forums, try to see if anyone has an idea about this. Very odd.
    Hello all. I have a question about a very bizarre macro issue we have been seeing in hopes that someone else has ever seen it before.
    We are running shake on all of our G5's and Intel machines.
    The way we have the machines configured is that we have them look to the server to a global share of macros that they load at application launch. (Just pointing the NRINCLUDEPATH etc). This has been working fine for quite some time.
    But now when ever we try to add a new Macro to the server it will cause some of our shake users to crash on launch. Now this is a mixed scenario. It will only happen to a few people. Not everyone. And if they pull the macro local, it works just fine. All the macros have the same permissions on the server, so I do not believe that is the issue. But I cannot for the life of me track this down.
    I force all the systems to launch shake command line, and the error we get is a segmentation fault. Has anyone ever seen this? Running it with 'shake -vv' gives me no more info.
    I have removed all the .Macos folders and the environment.plist files because shake would not re-read that file at application launch. I have everything being set via a bash_profile environment script.
    The local user permissions have no affect either. If I try to launch shake as root it will still crash. But as I said if I copy the macro local, it works.
    Any thoughts about it? Does shake have a limit to the amount of scripts or macro's that can be loaded or anything like that?
    Any help with this would be amazing.
    Thank you all.

    To finish this off...
    The sym-link from the local system to "trick" shake did not work.
    But after all the frustration of trying to figure this out and to re-set permissions etc. I just re-built the whole structure from scratch as a user and removed some no longer needed plug-ins that could have been causing the issue. Now all is fine.
    So that is good.
    All my builds are working just fine, and with my publish scripts they are updating properly.... YAY!

  • Database Alert Macros issue while executing the macros in Background

    Hi All,
    I am facing some problems while executing the Database alert macros in Background/Process Chain.
    There are two macros for which the problem exists.
    1.Excess Projected Inventory above Max
    The logic here is, the alert should work for Only Fixed Lot size Procedure.
    If the Stock on hand (projected EA) > (Safety Stock (EA) + Full SOQ (EA)) then alert = "Projected inventory is XX% above MAX".
    XX is the Percent above Max. 
    Note: SOQ => fixed lot size.
    2.Excess Actual Days of Supply
    The Logic here is, the alert should work for all Lot size Procedures except for "Fixed lot size".
    Actual Days Supply >=180 days. (current -> future buckets)
    -  For every receipt cell check the Actual Days Supply - if >= 180 days.
    The macros are working perfectly as expected.

    Hi Abhi,
    Hope you are doing good.
    Yes exactly, the macros are working in foreground/Interactively but not in the Background via Process chain. Let me send the details again.
    Issue :
    I am facing some problems while executing the Database alert macros in Background/Process Chain.
    There are two macros for which the problem exists.
    1.Excess Projected Inventory above Max
    The logic here is, the alert should work for Only Fixed Lot size Procedure. But in Background the alerts are getting created for Lot for Lot and other Planning procedures..
    If the Stock on hand (projected EA) > (Safety Stock (EA) + Full SOQ (EA)) then alert = "Projected inventory is XX% above MAX".
    XX is the Percent above Max. 
    Note: SOQ => fixed lot size.
    2.Excess Actual Days of Supply
    The Logic here is, the alert should work for all Lot size Procedures except for "Fixed lot size". But in Background the alerts are getting created for the Fixed Lot size procedures too..
    Actual Days Supply >=180 days. (current -> future buckets)
    -  For every receipt cell check the Actual Days Supply - if >= 180 days.
    The macros are working perfectly as expected in Foreground/Interactively but the samething is not happening while executing the macro in Background/Process Chain.
    I have tried running these macros in different sequences(Default/Start/Macro) but couldn't able to resolve the issue.
    Thanks in Advance,
    Jay.

  • SG series switch smart port macro issues

    Hi there,
    There seems to be a problem with some switches that it doesn't allow us to change the untagged VLAN in the smartport macro.
    This causes a problem: if we change it manually when we apply the smartport it works fine but if the switch reboots the smartport is reapplied with the VLAN set in the macro, this puts the port onto the worng VLAN which is not good.
    Please help.

    Hello Gerrard,
    This is actually a currently known issue.  When you try to update the native VLAN on a smartport macro it looks like it has taken effect, but never really gets updated.  I have confirmed the same issue on a device here in the lab.
    Give us a call at 1.866.606.1866 and we can create a support case for you and try to get that issue resovled.
    Thank you for choosing Cisco,
    Christopher Ebert
    Senior Network Support Engineer - Cisco Small Business Support Center
    *Please rate helpful posts*

  • Macro issue while running in the background

    Hello All,
    <b>Case 1:</b> Selection of aggregation level (only 9AMATNR)
    When we run a Macro in the background (with an aggregation level of only 9AMATNR), the results for the Macro are looking good at the product level (for e.g. product  for all locations, regions, states)
    But after running the Macro in the background and when we are in interactive planning and choosing a selection (E.g. product@location) gives inconsistent results.
    If we directly run the macro in the interactive planning at detail level (E.g. product@location) gives correct value
    <b>Case 2:</b> (Selection of aggregation level (9AMATNR, 9ALOCNO, ZLSDMA, ZLSSTATE, ZLSREG)
    But the macro results are inconsistent through out when we select the aggregation level (9ALOCNO, ZLSDMA, ZLSREG, ZLSSTATE) and run the Macro in the background.
    I have already gone through the note 412429 and it is not helping me. Can someone please give some suggestions and thier thoughts.
    Thanks,
    Venkat.

    Hi Srinivas,
    Thanks for your response and I understood your logic, but in either case 1 or case 2, can we do something related to key figures (Aggregation/Disaggregation), so that though I run the Macro in background at product level, I can drill down to detail other levels with consistent results.
    Venkat

  • BEx Macro issue

    Hi Gurus,. I just installed MS 2007. Now when I try to go to BEx Analyzer I get this error message "Object library invalid or contains references to object definitions that could not be found". If I click OK, MS Excel is opened up and I cann see the BEx Add-in in. If I try to click open any Query, I get this message ""Could not find SAPBEX.XLA." and also "Cannot run the macro 'sapbex.xla!repoNewQuery'. The macro may not be available in this workbook  or all macros may be disabled"
    It was working fine earlier until I re-installed this MS Office and SAPGUI710 on BW3.5
    I made sure that the amcros is enabled and active x is on as well. Any ideas as what I ma missing how i can install it?

    Hi,
    Open a command prompt. Then type this:
    > CD \Document And Settings
    > DEL /S /A:H /A:-H *.EXD
    That is what worked for me. Essentially the command recursively deletes all your hidden and exposed exds. That will make all your activeX components load a bit slower the first time you use them again, but it should also clear out the problematic ones.
    I got the above solution from:
    http://www.ozgrid.com/forum/showthread.php?t=49384

  • Macro issue: Current Year and Current Year +2

    Hi Macro experts
    I have a view in monthly buckets. I like to copy values for one KF to another from current year to only Current year + 2. I have made following macro but it dosen't work:
    AT: Initiate Input Row 
    Copy Sales FC to Al FC Input Y+2 : ( 24 Iterations :  M 03.2009 ;  M 02.2011 )
    IF
    Check year
    YEAR( DATE(
    Row: Customer Forecast ( Frm  M 03.2009 )
    =
    (YEAR( DATE( TODAY ) )
    +
    2
    Row: Annual Target Input ( Frm  M 03.2009 ) =
    Row: Sales Forecast ( Frm  M 03.2009 )
    ENDIF
    I get following message when I do the check:
    Fehlerhafter logischer Ausdruck "(YEAR(  4D4HPL3ENNRMKCXE1NULTI4LX  )  +  2  )":
    Please help (If there is an easier way to make the macro please let me know)
    Thanks
    Sun

    Hi
    Thanks for the answer. It is a rolling period dataview.  I understand you suggest the macro as:
    AT: Initiate Input Row 
    Copy Sales FC to Annual FC Input Y+2 : ( 24 Iterations :  M 03.2009 ;  M 02.2015 )
    Row: Annual Target Input ( Frm  M 03.2011 ) =
    Row: Sales Forecast ( Frm  M 03.2009 )
    But the problem is that when it is rolling period it will then also copy values in current year+3 and that is not acceptable. That is why I canu2019t use this macro. Values in current year (jan. month to dec. 2009) to (jan. month to dec. 2011)
    Br
    Sun

  • Excel macro issue

    I have an employee that uses the add-in and works with macros a lot in Excel. Occassionally, we he opens an Excel macro, it causes the Essbase toolbar to stop working. The dropdown essbase menu works, but the toolbar does not. He has to go through our service desk to get this resolved. Anyone know what causes this to happen?

    I would imagine that this is an intermittent problem or does it relate to a specific macro in a specific Excel worksheet ? Problem should go away with a reboot, another question would be why you are suporting freeware ? It should always come with a warning that it is freeware and outwith any company support policy. In most organisations the behaviour of user created macros is something that an IT support function will not go anywhere near.

  • Hyperion SmartView VB Macro Issue

    I am trying to use smart view "HypMenuVSubmitData" function to submit the data in Webform through Macro. I am using the below Macro
    Private Declare Function HypMenuVSubmitData Lib "HsAddin"() As Long
    Sub MSubmit()
    X=HypMenuVSubmitData()
    End Sub
    I have two sheets
    Sheet2: Webform and the Above macro
    Sheet1: Form Button
    I have assined the Macro to button.
    When I run the Macro from VB editor i.e Pressing the run button, it is submitting the data
    But When I am clicking on the button, It is not submitting the data in the webform. I have tested giving some MsgBox just to chcek if the Macro is running or not. Like
    Private Declare Function HypMenuVSubmitData Lib "HsAddin"() As Long
    Sub MSubmit()
    X=HypMenuVSubmitData()
    MsgBox "Welcome"
    End Sub
    The message getting poped up. But HypMenuVSubmitData is not getting executed.
    Please help.
    Thanks,

    HypMenuVSubmit only submits the active sheet, you may want to try something like below
    Private Declare Function HypMenuVSubmitData Lib "HsAddin"() As Long
    Sub MSubmit()
    Sheets("Sheet2").activate
    X=HypMenuVSubmitData()
    MsgBox "Welcome"
    End Sub
    Regards
    JTF

  • XLS to XLSX Conversion - Macro issues

    Good Morning All,I'm currently trying to run a script to convert all xls files to xlsxI am using a script written here:
    https://gist.github.com/gabceb/954418The script as is:PowershellAdd-Type -AssemblyName Microsoft.Office.Interop.Excel$xlFixedFormat = [Microsoft.Office.Interop.Excel.XlFileFormat]::xlOpenXMLWorkbookwrite-host $xlFixedFormat$excel = New-Object -ComObject excel.application$excel.visible = $false$folderpath = "C:\temp\test\test_1"$filetype ="*xls"Get-ChildItem -Path $folderpath -Include $filetype -recurse | ForEach-Object `{ $path = ($_.fullname).substring(0, ($_.FullName).lastindexOf(".")) "Converting $path" $workbook = $excel.workbooks.open($_.fullname) $path += ".xlsx" $workbook.saveas($path, $xlFixedFormat) $workbook.close() ## Create old folder and move original files here $oldFolder = $path.substring(0, $path....
    This topic first appeared in the Spiceworks Community

    HI sonardude,
    I'm sorry that your PDF conversions are going well. PDF > Excel conversions have been particularly tricky. While turning off OCR has helped in many cases, it sounds to me as though that isn't an option to you, since the PDF was likely created from a scanned document. The quality of the conversion is very dependent on the quality of the original document, so if the PDF wasn't of best quality, the conversion will show it (not the answer you were hoping for, I'm sure).
    We have been collecting files such as yours in an effort to improve the Acrobat online services. If you're willing, please consider submitting your form using the   File Conversion Issue form. Adobe will take a closer look at your file (but we cannot promise to respond individually to all submissions).
    Best,
    Sara

  • Delete Watermark with Macro Issue

    Good day,
    I have macros currently to insert a DRAFT or COPY watermarks (just text, not using an image) into document(s). I have found when removing the watermarks it is removing the image int he header
    Code:
    Sub RemoveWaterMark()
    ' Remove.Watermark.Macro
        Dim strWMName As String
        On Error GoTo ErrHandler
        ActiveDocument.Sections(1).Range.Select
        strWMName = ActiveDocument.Sections(1).Index
        ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
        Selection.HeaderFooter.Shapes(strWMName).Select
        Selection.Delete
        ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
        Exit Sub
    Is there a way to code this macro to only remove the DRAFT or COPY that anyone can think of?

    A watermark is an image in the header, even a text Watermark is an image - WordArt. Your code is supposed all shapes in the header. Is your image inside a shape like a Textbox?
    When I try your code it does not run.
    If you are using a Ribbon version of Word and used Page Layout > Watermark to insert your watermark Word gives each new watermark a unique shape name. I'm not sure how. When it later inserts a different watermark, it deletes the previous one, by name.
    I do not have an answer for you but will post some interim steps as I try to figure one out. This way you can see the process rather than just the end result.
    Step 1: Use the macro recorder to get an idea of what Word is doing when it deletes a Watermark or changes one.
    Here are examples of recorded code:
    Sub DeleteWaterMark()
    ' DeleteWaterMark Macro
        ActiveDocument.Sections(1).Range.Select
        ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
        Selection.HeaderFooter.Shapes("PowerPlusWaterMarkObject265849384").Select
        Selection.Delete
        ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
    End Sub
    Sub InsertWaterMark2()
    ' InsertWaterMark2 Macro
        ActiveDocument.Sections(1).Range.Select
        ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
        Selection.HeaderFooter.Shapes("PowerPlusWaterMarkObject266006337").Select
        Selection.ShapeRange.TextEffect.Text = "-"
        Selection.ShapeRange.TextEffect.FontSize = 1
        Selection.ShapeRange.TextEffect.FontName = "Cambria"
        Selection.ShapeRange.Line.Visible = False
        Selection.ShapeRange.Fill.Visible = True
        Selection.ShapeRange.Fill.Solid
        Selection.ShapeRange.Fill.ForeColor.RGB = RGB(192, 192, 192)
        Selection.ShapeRange.Fill.Transparency = 0.5
        Selection.ShapeRange.Rotation = 315
        Selection.ShapeRange.LockAspectRatio = True
        Selection.ShapeRange.Height = InchesToPoints(6.11)
        Selection.ShapeRange.Width = InchesToPoints(3.05)
        Selection.ShapeRange.WrapFormat.AllowOverlap = True
        Selection.ShapeRange.WrapFormat.Side = wdWrapNone
        Selection.ShapeRange.WrapFormat.Type = 3
        Selection.ShapeRange.RelativeHorizontalPosition = _
            wdRelativeVerticalPositionMargin
        Selection.ShapeRange.RelativeVerticalPosition = _
            wdRelativeVerticalPositionMargin
        Selection.ShapeRange.Left = wdShapeCenter
        Selection.ShapeRange.Top = wdShapeCenter
        ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
    End Sub
    Sub WatermarkBlank()
    ' WatermarkBlank Macro
        ActiveDocument.Sections(1).Range.Select
        ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
        Selection.HeaderFooter.Shapes("PowerPlusWaterMarkObject265849384").Select
        Selection.Delete
        ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
        Application.Templates( _
            "C:\Users\Charles K. Kenyon\AppData\Roaming\Microsoft\Document Building Blocks\1033\14\Building Blocks.dotx" _
            ).BuildingBlockEntries("Blank").Insert Where:=Selection.Range, RichText:= _
            True
    End Sub
    Sub RemoveWaterMark2()
    ' RemoveWaterMark2 Macro
        ActiveDocument.Sections(1).Range.Select
        ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
        Selection.HeaderFooter.Shapes("PowerPlusWaterMarkObject266857275").Select
        Selection.Delete
        ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
    End Sub
    Additional thoughts/ideas.
    One other thing that I did was create a Watermark building block that had white text 100% transparent. The WatermarkBlank macro above is a recording of the insertion of that, which deleted the existing Watermark. Again, though, it uses a specific name. I
    can tell you that the name is NOT stored as a document variable.
    If you were to cycle through the names of the images looking for "PowerPlusWaterMarkObject" at the beginning of the name that would work for watermarks inserted by Word 2010.
    Can you get your code to change the transparency to 100% leaving the watermark there?
    Sorry, I don't have time to do more right now. Hope this helps some.
    Charles Kenyon Madison, WI

  • Please fix the macro issue with N8 camera (2)

    This problem makes me sick, guys. My n73 shoots better macros

    I'm talkin about the famous bug or call it however you want that affects the macro function of the n8.
    I cannot accept that a CAMERA PHONE cannot focus in macro mode when updated to Belle. I have to focus 10-15 times to achieve the correct focusing.
    Why my n73 can shoot the same macro and my n8 don't ? if you chek in other forums you'll notice that's a common problem. A common BIG problem, dude.

  • Essbase Smartview VBA macros error

    I have a Essbase Smartview VBA macros issue as below:
    I want get a value that I choose in POV dynamic dropdown list.
    And show the value in the excel.
    For example:
    There customer dimention -childs are IBM、ACR show in POV dynamic dropdown list.
    I choose IBM in POV then in excel sheet A1 show IBM.
    I try the below vba code:
    Private Sub CommandButton2_Click()
    Dim vtGrid As Variant
    Dim vtDimNames As Variant
    Dim vtPOVNames As Variant
    X = HypRetrieve("Sheet1")
    If X = 0 Then
    MsgBox ("Retrieve successful.")
    Else
    MsgBox ("Retrieve failed.")
    End If
    Range("F1").Select
    Sts = HypGetSourceGrid("Sheet1", vtGrid)
    Y = HypGetPOVItems(vtDimNames, vtPOVNames)
    Range("h1").Value = Y
    End Sub
    '==========================================
    But Y result is -3.
    How did I get the value in dynamic dropdown list.
    Thanks~

    Few comments:
    1. Range("F1").Select: Is F1 inside the grid you are rerieving? If you do a fresh retrieve Range("B2").Select is a better location and you will not get -3.
    2. Range("h1").Value = Y. You are setting the error message and not the POV member name. vtPOVNames is an array of POV members and you should use Range("h1").Value =vtPOVNames(1) to get the member name. (1) being the first dimension in the POV.
    3. Word of caution. You will not be able to put a valid member name in the grid if it already exists in the POV. I recommend you preface the member name by any string that will make it unique. For instance, you could use
    Range("h1").Value = vtDimNames(1) & ": " &vtPOVNames(1)
    This way you will see the DimensionName: Member Name.
    Here is the modified code:
    Sub test()
    Dim vtGrid As Variant
    Dim vtDimNames As Variant
    Dim vtPOVNames As Variant
    X = HypRetrieve("Sheet1")
    If X = 0 Then
    MsgBox ("Retrieve successful.")
    Else
    MsgBox ("Retrieve failed.")
    End If
    Range("b2").Select
    sts = HypGetSourceGrid("Sheet1", vtGrid)
    Y = HypGetPOVItems(vtDimNames, vtPOVNames)
    Range("h1").Value = vtDimNames(1) & ": " & vtPOVNames(1)
    End Sub
    Edited by: Toufic Wakim on May 3, 2010 11:54 AM

  • RH X5.0.2 - "Cannot Find Microsoft Word installed on your system"

    I've spent perhaps an hour reading the 100plus-message thread
    on this issue as it relates to RH 7. Thank you for all of your work
    and recording various suggestions and observations!
    Might anyone have a suggestion for me, who am still using the
    older RH 5? (I'm using the Windows XP Professional OS and Word
    2003.)
    A few thoughts --
    - I see in RH, under Tools > Options > HTML Editors,
    that the Word path is correct for where my Word is located. I'm
    wondering, the Name in this HTML Editors list is "Word"; should I
    change it to "Microsoft Word"?
    - Also, would there be any benefit to removing the current
    Word item from the HTML Editors lists and then adding it back?
    (Keep in mind, that I'm mainly just a RoboHelp USER, and NOT
    a Windows or systems expert, so I like to be very cautious when
    making changes to an app, as I would not want to break anything, or
    make things worse than they are now.)
    Thank you for any suggestions.
    Jan

    Good news! I now AM ABLE to generate printed documentation
    from my RoboHelp version X5.0.2 program!
    The solution to my problem (I think) was that I needed to...
    ---> close all Microsoft Word documents <---
    ...before opening RoboHelp (as advised in the RoboHTML online
    help topic "Generating printed documentation.") To be extra safe, I
    not only closed all Word documents, but I actually closed the
    entire MS Word program and restarted my computer before opening
    RoboHelp.
    I'm not sure whether specific settings have an impact on a
    Robo-user's success, but these are the settings that worked for me:
    - General page: I selected "single", and
    for images, I selected "embed in documents"
    - Conditional Build: "None"
    - Content: (I scrolled through the list on the right to
    ensure all of my topics were listed, and then I moved on to the
    next page.)
    - Section Layout: I made no changes
    - Appearance: I kept the default "Use Project's CSS styles"
    One other tip: (My colleague, Jeff, discovered this) If you
    get some warning message regarding a macro issue, that probably
    means that your Macro Security level in Word is set too high. To
    change this setting, Open Word, select Tools > Options, click
    the Security tab, click the Macro Security button, and select
    Medium or Low. After you make this change, exit from Word, and go
    back to RoboHTML to generate your printed documentation.

  • Unable to Copy/Paste Named Range within Same Worksheet

    Excel becomes unresponsive when copying a named range over one column.  I have multiple sheets and it works fine on all but two of them.  This is not just a macro issue as I can't get the paste to work even when doing it manually outside of the
    macro.  I've tried deleting the name and recreating it, but to no avail.  Has anyone else had this issue?
    Code:
        Application.Goto Reference:="Copy_CP"
        Selection.Copy
        Range("B6").Select
        ActiveSheet.Paste
    Thanks,
    C.

    Hi,
    I suggest to copy without selecting the ranges. it will save a lot of time
    Sub Test()
    Application.ScreenUpdating = False
    Range("Copy_CP").Copy Range("B6")
    Application.ScreenUpdating = True
    End Sub
    Guy Zommer

Maybe you are looking for