Zero phase filter returns unexpected values

Hi,
I want to filter the signal using the zero phase filter.
This is my code using the filter:
The filter returns some values like this:
In this diagram, the green curve is the signal, which has been filtered using the zero phase filter.
Is there a better example or special advices for these unexpected values? What I want is the signal without phase-dirft.
Wilbur

Hi,
it was a good idea to post that snippet - but it would be best if we had your data too.
Could save your inputs as default data and post the vi (don't know if snippets retain default values)?
Regards
Florian

Similar Messages

  • Is it possible to use Zero phase filter for continuous filtering?

    I have to filter a large amount of data without any phase shift from original signal. The Zero phase filter does it but it has to be used in single shot mode. It doesn't have any "Init/Cont" input terminal which other filters have. Is there any way to implement zero phase filtering to filter data continuously?

    AJ_CS wrote:
    The zero phase filtering method seen in your thread will work, if the filtering happens as a single shot operation. It will remove the edge effects of zero phase filtering.
    But for an application wherein data arrives as small blocks, it has to filter each block of the data and also it has to maintain the continuity of filtering. 
    For example in every 1 sec, I'm getting 500 samples of data. I have to use this zero phase filtering for each block of 500 samples, in each second. But what seems to happen is, between the end of one data block and beginning of next data block( between 500th sample and 501th sample or between the end of 1st sec data and beginning of 2nd sec data), there is a discontinuity, or distortion.
    Normal IIR (butterworth)filter maintains this continuity between data blocks, but with phase shift.
    Zero phase filtering doesn't introduce any phase shift but it is unable to maintain the continuity, it seems. 
    Is it possible to have a filter meeting both these requirements?
    In a nut-shell yes.
    It will require you apply the technique I illustrated in that thread repeatedly each time you get an update. The "reflection about the end points" cleans up the disconinuities. I suspect there may be some theory that what you end up with can not be proven using any formal math approach, but it closely mimics what the human mind does when we ask ourselves "If it continues like that that, what do I expect?".
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Execute SQL Task, OLE DB, Stored Procedure, Returns unexpected value upon second run

    when debugging SSIS, the "Execute SQL Task" runs a stored procedure and returns the expected value. When running the package a second time, the task returns an unexpected value. When running in VS2012 SQL editor, everything operates as expected.
    Please help me debug how to get the stored proc to return the same value every time the SSIS Package is run. thanks!
    Here is the sequence of events and what happens....
    Look for a Positor that matches the Application, Host, and User
    No matching PositorId is found, Creates new Positor row, returns that new PositorId
    Use PositorId to upload some data (Every thing works)
    re-run/debug the ssis pacakge
    Look for a Positor that matches the Application, Host, and User 
    <No clue what is happening>
    Returns -1 (SHOULD BE the same PositorId value returned in #2)
    "Execute SQL Task" Setup: No edits to Result Set nor Expressions
    "Execute SQL Task" Setup: GENERAL
    "Execute SQL Task" Setup: PARAMETER MAPPING
    SP called by "Execute SQL Task"
    CREATE PROCEDURE [posit].[Return_PositorId]
    AS
    BEGIN
    DECLARE @PositorId INT = [posit].[Get_PositorId]();
    IF (@PositorId IS NULL)
    BEGIN
    DECLARE @ProcedureDesc NVARCHAR(257) = OBJECT_SCHEMA_NAME(@@PROCID) + N'.' + OBJECT_NAME(@@PROCID);
    DECLARE @PositorNote NVARCHAR(348) = N'Automatically created by: ' + @ProcedureDesc;
    EXECUTE @PositorId = [posit].[Insert_Positor] @PositorNote;
    END;
    RETURN @PositorId;
    END;
    Supporting SQL Objects:
    CREATE FUNCTION [posit].[Get_PositorId]
    RETURNS INT
    AS
    BEGIN
    DECLARE @PositorId INT = NULL;
    SELECT TOP 1
    @PositorId = [p].[PO_PositorId]
    FROM [posit].[PO_Positor] [p]
    WHERE [p].[PO_PositorApp] = APP_NAME()
    AND [p].[PO_PositorHost] = HOST_NAME()
    AND [p].[PO_PositorUID] = SUSER_ID();
    RETURN @PositorId;
    END;
    GO
    CREATE PROCEDURE [posit].[Insert_Positor]
    @PositorNote NVARCHAR(348) = NULL
    AS
    BEGIN
    DECLARE @ProcedureDesc NVARCHAR(257) = OBJECT_SCHEMA_NAME(@@PROCID) + N'.' + OBJECT_NAME(@@PROCID);
    SET @PositorNote = COALESCE(@PositorNote, N'Automatically created by: ' + @ProcedureDesc);
    DECLARE @Id TABLE
    [Id] INT NOT NULL
    INSERT INTO [posit].[PO_Positor]([PO_PositorNote])
    OUTPUT [INSERTED].[PO_PositorId]
    INTO @Id([Id])
    VALUES(@PositorNote);
    RETURN (SELECT TOP 1 [Id] FROM @Id);
    END;
    GO
    CREATE TABLE [posit].[PO_Positor]
    [PO_PositorId] INT NOT NULL IDENTITY(0, 1),
    [PO_PositorApp] NVARCHAR(128) NOT NULL CONSTRAINT [DF__PO_Positor_PO_PositorApp] DEFAULT(APP_NAME()),
    CONSTRAINT [CL__PO_Positor_PO_PositorApp] CHECK([PO_PositorApp] <> ''),
    [PO_PositorName] NVARCHAR(256) NOT NULL CONSTRAINT [DF__PO_Positor_PO_PositorName] DEFAULT(SUSER_SNAME()),
    CONSTRAINT [CL__PO_Positor_PO_PositorName] CHECK([PO_PositorName] <> ''),
    [PO_PositorHost] NVARCHAR(128) NOT NULL CONSTRAINT [DF__PO_Positor_PO_PositorHost] DEFAULT(HOST_NAME()),
    CONSTRAINT [CL__PO_Positor_PO_PositorHost] CHECK([PO_PositorHost] <> ''),
    [PO_PositorSID] VARBINARY(85) NOT NULL CONSTRAINT [DF__PO_Positor_PO_PositorSID] DEFAULT(SUSER_SID()),
    [PO_PositorUID] INT NOT NULL CONSTRAINT [DF__PO_Positor_PO_PositorUID] DEFAULT(SUSER_ID()),
    [PO_PositorNote] VARCHAR(348) NULL CONSTRAINT [CL__PO_Positor_PO_PositorNote] CHECK([PO_PositorNote] <> ''),
    [PO_tsInserted] DATETIMEOFFSET(7) NOT NULL CONSTRAINT [DF__PO_Positor_PO_tsInserted] DEFAULT(SYSDATETIMEOFFSET()),
    [PO_RowGuid] UNIQUEIDENTIFIER NOT NULL CONSTRAINT [DF__PO_Positor_PO_RowGuid] DEFAULT(NEWSEQUENTIALID()) ROWGUIDCOL,
    CONSTRAINT [UX__PO_Positor_PO_RowGuid] UNIQUE NONCLUSTERED([PO_RowGuid]),
    CONSTRAINT [UK__Positor] UNIQUE CLUSTERED ([PO_PositorApp] ASC, [PO_PositorHost] ASC, [PO_PositorUID] ASC),
    CONSTRAINT [PK__Positor] PRIMARY KEY ([PO_PositorId] ASC)
    GO
    ssd

    The error is in item 7: Returns -1 (SHOULD BE the same PositorId value returned in #2); but no error message is returned or thrown from SSIS.
    The error message indicated referential integrity is not upheld when inserting records. This error message occurs AFTER the Execute SQL Task successfully completes; the E.SQL Task returns -1.  The executed SQL code will not allow values less than 0
    ([PO_PositorId] INT NOT NULL IDENTITY(0, 1),)
    [Platts Valid [41]] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E2F.
    An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 11.0"  Hresult: 0x80040E2F  Description: "The statement has been terminated.".
    An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 11.0"  Hresult: 0x80040E2F  Description:
    "The INSERT statement conflicted with the FOREIGN KEY constraint "FK__PricingPlatts_Posit_PositorId". The conflict occurred in database "Pricing", table "posit.PO_Positor", column 'PO_PositorId'.".
    The aforementioned FOREIGN KEY constraint is due to the value being returned by the Execute SQL Task.; therefore, the error lies in the value returned by the Execute SQL Task.

  • FreeMemory, totalMemory return unexpected values

    Hi,
    Could anybody explain me freeMemory and totalMemory usage.
    Here is a very simple program with output results.
    public static void main(String[] args) {
    Runtime runtime = Runtime.getRuntime();
    long freeMem = runtime.freeMemory() / 1024;
    long totalMem = runtime.totalMemory() / 1024;
    System.out.println("Memory at starting");
    System.out.println("Free memory : " + freeMem + " KB");
    System.out.println("Total memory : " + totalMem + " KB");
    int[] alloc = new int[2000*1024];
    System.out.println("Allocate 2000 KB");
    freeMem = runtime.freeMemory() / 1024;
    totalMem = runtime.totalMemory() / 1024;
    System.out.println("Free memory : " + freeMem + " KB");
    System.out.println("Total memory : " + totalMem + " KB");
    output result:
    Memory at starting
    Free memory : 1813 KB
    Total memory : 1984 KB
    Allocate 2000 KB
    Free memory : 1882 KB
    Total memory : 9988 KB
    I did run this program on 3 windows systems (WindowsXP SP2)
    with 512Mb, 1Gb and 2Gb memory.
    java version "1.5.0_06"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
    Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)
    What value freeMemory returns? Why I can allocate more memory than I
    have?
    Thanks in advance

    Hi jesperdj,
    Thanks for the clarification.
    I've a doubt in the output of following code:
    import java.lang.management.MemoryMXBean;
    import java.lang.management.ManagementFactory;
    public final class BasicMemoryCheck
         public static final void main(final String[] args) throws Exception
              Runtime runtime      = Runtime.getRuntime();
              long freeMemory      = runtime.freeMemory();
              long totalMemory     = runtime.totalMemory();
              long maxMemory       = runtime.maxMemory();
              System.out.println("Max   Memory  :"+(maxMemory/1024.0)+" KB");
              System.out.println("Total Memory  :"+(totalMemory/1024.0)+" KB");
              System.out.println("Free  Memory  :"+(freeMemory/1024.0)+" KB");
              System.out.println("Used  Memory  :"+(totalMemory/1024.0-freeMemory/1024.0)+" KB");
              System.out.println("         ===============         ");
              MemoryMXBean mx = ManagementFactory.getMemoryMXBean();
              long initMemory      = mx.getHeapMemoryUsage().getInit() + mx.getNonHeapMemoryUsage().getInit();
              long usedMemory      = mx.getHeapMemoryUsage().getUsed() + mx.getNonHeapMemoryUsage().getUsed();
              long committedMemory = mx.getHeapMemoryUsage().getCommitted() + mx.getNonHeapMemoryUsage().getCommitted();
              long _maxMemory      = mx.getHeapMemoryUsage().getMax() + mx.getNonHeapMemoryUsage().getMax();
              System.out.println("Max       memory:"+(_maxMemory/1024.0)+" KB");
              System.out.println("Committed memory:"+(committedMemory/1024.0)+" KB");
              System.out.println("Init      memory:"+(initMemory/1024.0)+" KB");
              System.out.println("Used      memory:"+(usedMemory/1024.0)+" KB");
    }On Windows XP SP2, if I run the above code from command line, I get the following output:
    Max Memory :65088.0 KB
    Total Memory :5056.0 KB
    Free Memory :4800.7578125 KB
    Used Memory :255.2421875 KB
    ===============
    Max memory:183872.0 KB
    Committed memory:38304.0 KB
    Init memory:32960.0 KB
    Used memory:12737.3359375 KB
    What I can't understand is the output of MemoryMXBean. How come 'Max memory' be 183872 KB when by default the Xmx value is 64 MB and also it differs from 'max memory' reported by Runtime.getRuntime().maxMemory() call.
    Also, at what % of max memory (Runtime version) I can assume that there is not much memory available? I couldn't allocate even more than 15 MB for arrays.
    -Madhav

  • Comparison of Phase Difference between Zero Phase and FIR Filtering

    Hi,
    I have a comma-delimited text file containing a 2D array in frequency domain. I would like 2 do a phase difference comparison between the original signal, zero phase filter and FIR filter with a cut-off at 1550nm and sampling of 0.01nm. Ouput will be a graph. I've tried to model after the example in LabVIEW but I can't seem to get the graph to display. Is there an error in the block diagram?
    Also, is it possible to do the phase difference comparison via detection of central wavelength? If so, how can I go about it?
    Thanks.

    When you translate time domain to frequency domain, amplitude information is separated information.
    Therefore, there's no way to find phase information from frequency domain data.
    You must collect time domain data in order to perform this test.

  • 3.1 EA3 - Column value filter dropdown returns duplicate values

    Hello,
    SQL Developer 3.1 EA3 introduces a regression: the column value filter in the table data editor dropdown (filter column) now shows duplicate values. Previous versions (at least 3.0) returned unique values to select from.
    Since this is EA3 and not yet production, should I file a bug for this?
    Best Regards and many thanks for this tool,
    Olivier.
    Edited by: user9378013 on Jan 9, 2012 1:08 PM

    Yes it's a regression. Fixed it recently. In the next released build it should work properly.
    -Raghu

  • Filter for invalid values

    10.2.0.1.0
    This question is related to the following post;
    DISTINCT returns error on column with TO_NUMBER
    Is it possible to filter for invalid values in a column if you dont know what they could be?
    I tried something like this with no success;
    select distinct plot_number
    from (select to_number(col_3) plot_number from user_recovery_external where col_3 > 0)I then created a view with the to_number on col_3 and tried to query with the greater than zero filter but it still returned an error.
    Ben

    Thank You for the assistance here is some sample data;
    External Data
    Example of the sort of lines that would be causing the error, this csv file has over half a million records in it.
    BUN28N06.DAT,N06,053070, 21.48, 20,R1, 13.39,  1074,H,C,1,F,E
    BUN28N06.DAT,N06,053070, 21.48, 21,R1, 13.86,  1074,H,C,1,F,E
    BUN28N06.DAT,N06,053070, 21.48, 22,R1, 15.01,  1074,H,C,1,F,E
    BUN28N06.DAT,N06,053070, 21.48, 23,R1, 12.69,  1074,H,C,1,F,E
    BUN28N06.DAT,N06,053070, 21.48, 24,R1, 15.68,  1074,H,C,1,F,E
    BUN28N06.DAT,N06,053070, 21.48, 25,R1, 15.57,  1074,H,C,1,F,E
    BUN28N06.DAT,N06,053070, 21.48, 26,R1, 14.55,  1074,H,C,1,F,E
    BUN28N06.DAT,N06,053070, 21.48, 27,R1, 18.60,  1074,H,C,1,F,E
    BUN28N06.DAT,N06,053070, 21.48, 28,R1, 17.97,  1074,H,C,1,F,E
    BUNALN06(bkup).DAT,                 CORRECTION OF HASSELBLAD MEASUREMENTS                1
    BUNALN06(bkup).DAT,                                                 10:50 Friday, November 24, 1989
    BUNALN06(bkup).DAT,         CELLPLOT         RADIUS         HT2     COM    SCALE2     TYPE
    BUNALN06(bkup).DAT,        N06,005341,    18.14,  1,O1,    22.28     ,       957     ,H,C,1
    BUNALN06(bkup).DAT,        N06,005341,    18.14,  2,O1,    20.00     ,       957     ,H,C,1
    BUNALN06(bkup).DAT,        N06,005341,    18.14,  3,R1,    15.49     ,       957     ,H,C,1
    BUNALN06(bkup).DAT,        N06,005341,    18.14,  4,O1,    18.76     ,       957     ,H,C,1
    BUNALN06(bkup).DAT,        N06,005341,    18.14,  5,R1,    17.32     ,       957     ,H,C,1
    BUNALN06(bkup).DAT,        N06,005341,    18.14,  6,R1,    16.99     ,       957     ,H,C,1
    BUNALN06(bkup).DAT,        N06,005341,    18.14,  7,R5,    18.29     ,       957     ,H,C,1
    BUNALN06(bkup).DAT,        N06,005341,    18.14,  8,R5,    12.65     ,       957     ,H,C,1
    BUNALN06(bkup).DAT,        N06,005341,    18.14,  9,O1,    22.28     ,       957     ,H,C,1
    BUNALN06(bkup).DAT,        N06,005341,    18.14, 10,R1,    18.05     ,       957     ,H,C,1
    BUNALN06(bkup).DAT,        N06,005341,    18.14, 11,R1,    19.15     ,       957     ,H,C,1
    BUNALN06(bkup).DAT,        N06,005341,    18.14, 12,R1,    15.99     ,       957     ,H,C,1
    BUNALN06(bkup).DAT,        N06,005341,    18.14, 13,R1,    17.88     ,       957     ,H,C,1
    BUNALN06(bkup).DAT,        N06,005341,    18.14, 14,R1,    13.39     ,       957     ,H,C,1
    BUNALN06(bkup).DAT,        N06,005341,    18.14, 15,R1,    13.91     ,       957     ,H,C,1
    BUNALN06(bkup).DAT,        N06,005341,    18.14, 16,R1,    10.59     ,       957     ,H,C,1
    BUNALN06(bkup).DAT,        N06,005341,    18.14, 17,O1,    19.54     ,       957     ,H,C,1This is the external table.
    CREATE TABLE USER_RECOVERY_EXTERNAL
    ( COL_1  VARCHAR (255 CHAR)
    , COL_2 VARCHAR (255 CHAR)
    , COL_3 VARCHAR (255 CHAR)
    , COL_4 VARCHAR (255 CHAR)
    , COL_5 VARCHAR (255 CHAR)
    , COL_6 VARCHAR (255 CHAR)
    , COL_7 VARCHAR (255 CHAR)
    , COL_8 VARCHAR (255 CHAR)
    , COL_9 VARCHAR (255 CHAR)
    , COL_10 VARCHAR (255 CHAR)
    , COL_11 VARCHAR (255 CHAR)
    , COL_12 VARCHAR (255 CHAR)
    , COL_13 VARCHAR (255 CHAR)
    , COL_14 VARCHAR (255 CHAR)
    , COL_15 VARCHAR (255 CHAR)
    ORGANIZATION EXTERNAL
    ( TYPE ORACLE_LOADER
      DEFAULT DIRECTORY "UPLOAD_DIR"
      ACCESS PARAMETERS
        ( RECORDS DELIMITED BY NEWLINE
          BADFILE "UPLOAD_DIR":'user_external.bad'
          LOGFILE "UPLOAD_DIR":'user_external.log'
          FIELDS TERMINATED BY ','
          OPTIONALLY ENCLOSED BY '"' LDRTRIM
          MISSING FIELD VALUES ARE NULL
          ( COL_1
          , COL_2
          , COL_3
          , COL_4
          , COL_5
          , COL_6
          , COL_7
          , COL_8
          , COL_9
          , COL_10
          , COL_11
          , COL_12
          , COL_13
          , COL_14
          , COL_15
      LOCATION
        ( "UPLOAD_DIR":'USER_EXTERNAL.csv'
    ) REJECT LIMIT UNLIMITED;
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Cubeset to only return positive values?

    Yet another cube formula question... In Excel 2010, no powerpivot or olap pivottable extensions, this is a pure Excel project.
    I am building various cubeset, cubemember, and cubevalue formulas to validate an ETL process.
    Question:
    I need to create a cubeset that only returns the members of a cube that have positive values for a specific measure. This cubeset will then be one of several cubesets that gets fed into a cubevalue formula that would otherwise exceed the 255 char limit.
    I can create a cubeset for the overall measure:
    =CUBESET("MyCube","[Measures].[RetailPrice]")
    but haven't found the right syntax for limiting results to only those that have positive values, I think it would be something like:
    =CUBESET("MyCube","FILTER[Measures].[RetailPrice],[Measures].[RetailPrice]>0")
    This syntax actually doesn't return an error, so maybe it is valid syntax... but when I wrap it in a simple cubevalue statement,
    =CUBEVALUE("MyCube", A2)       where A2 is the Cubeset above, or if I also add date range and other filters,
    I get a #Value error, indicating that "the tuple is invalid" per
    http://office.microsoft.com/en-in/excel-help/cubevalue-function-HA010342391.aspx?CTT=5&origin=HA010342384
    I'm still a newbie with the cubeformula syntax and MDX, so I appreciate any suggestions!

    Hi Rohit-
    The cube has a net value of 1220 for the measure I'm trying to calculate (when I don't filter on > or < zero).
    I tried my formula both ways (looking for just positive, and just negative values) and while both work in the standalone cubeset formula, neither return a value when I use it in a cubevalue formula.
    My suspicion, other than a syntax error, is that this may have something to do with me trying to filter on the measure value(s), instead of a dimension- which I think must be possible, but again maybe not with this syntax.
    Let's assume that we had a total of 1280 in retail price, but due to a few returns, we have a few records that show value of -60. If we were looking at profitability, the 1220 is what matters. If we are looking at "dollars exchanged" as a variable expense
    driver of some other measure, then we'd actually want the absolute value of retail price (1280+60 = 1340). I hadn't been able to get the MDX ABS to work, so this was my attempt to grab the positive and negative numbers separately, and then add them to get
    the equivalent of ABS.
    In this case, slicers aren't a desirable option due to how the report is being constructed (I've used slicers in other reports with cubeformulas, but with Excel 2010 I have to have an extra pivot table to get the slicer value, which then has to get fed into my
    cubeform and I'm back at step 1, getting it to work in the cubeformula syntax)
    Thanks!

  • Zero phase filtering initial condition effect

    Hi
    I was wondering if any body knows how I can handle the problem of edge effect caused by zero phase filtering? The problem is that by using zero phase filtering if the intial condition of forward filter does not equal to that of reverse filter, a kind of spike will occur at the begining and the end of filtered signal. In MATLAB spacial care has been taken to minimize this effect but it seems it is not the case in LabView?
    I noticed that some body mentioned the same problem here long time ago and one of replies pointed out that it is the transient effect of convolution and we need to remove the first and last samples of filtered signal but I don't think that it is a wise solution because the problem is not because of convolution.
     Best regards
    Afshin

    The math is correct, but you can not compare directly to the math used then dealing with continuous math functions like sin(x). Use scaling functions to if you want to "correct" the amplitude. Do not change the dt value
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)
    Attachments:
    Derivative[1].vi ‏19 KB

  • Vbscript RegRead function not behaving consistently and/or returning correct values when they exist in the registry

    Hello.
    I seem to be having a problem using the RegRead function within vbscript to return a simple value from the registry. When I run it on my workstation (windows 7 x64 sp1), it seems to miss certain registry values that are indeed there (specifically, I am looking
    for instances of "Adobe" in the displayName value of HKLM\Software\wow6432node\microsoft\windows\uninstall). However, when I run on a test VM, it returns the values fine. I am hoping someone might be able to explain this inconsistency and why it
    is happening.
    The code is very simple:
    On Error Resume Next
    if wscript.arguments.count < 1 then
    wscript.echo "usage: regread.vbs <hostname> <appname>"
    wscript.quit
    end if
    AppName = wscript.arguments(1)
    strComputer = wscript.arguments(0)
    const HKEY_LOCAL_MACHINE = &H80000002
    Set WshShell = WScript.CreateObject("WScript.Shell")
    Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!//"& strComputer & "/root/default:StdRegProv")
    strKeyPath = "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
    objReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
    For Each subkey In arrSubKeys
    'wscript.echo subkey
    InstalledAppName = ""
    InstalledAppName = WshShell.RegRead("HKLM\" & strKeyPath & "\" & subkey & "\DisplayName")
    wscript.echo vbtab&"DisplayName: "&InstalledAppName
    if instr(InstalledAppName,AppName) > 0 then
    wscript.echo vbcrlf&"found"&vbcrlf
    end if
    Next
    When I run "cscript regread.vbs remoteHost Adobe" on my local machine, it does not "find" any instance of Adobe within the registry of machine "remoteHost". However, when I run it from a test VM, it does find the existing instances
    of Adobe within the DisplayName value of the uninstall key of the registry, here is the output from both, first the non-working one, then the working test VM.
    Non-working:
    Microsoft (R) Windows Script Host Version 5.8
    Copyright (C) Microsoft Corporation. All rights reserved.
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName: GPL Ghostscript 8.60
    DisplayName: GPL Ghostscript Fonts
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName: Microsoft Office Professional Plus 2010
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName: Microsoft ASP.NET 2.0 AJAX Extensions 1.0
    DisplayName:
    DisplayName: Sybase PowerBuilder 12.0 Standard Runtime
    DisplayName: MSXML 4.0 SP3 Parser
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName: MSXML 4.0 SP3 Parser (KB2758694)
    DisplayName: Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729.4148
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName: Microsoft Windows Journal Viewer
    DisplayName: Java Auto Updater
    DisplayName: VBA (2627.01)
    DisplayName: Microsoft Visual C++ 2005 Redistributable
    DisplayName:
    DisplayName: Apple Software Update
    DisplayName: SQL Anywhere 9 for Windows x64
    DisplayName: Microsoft Office Professional Plus 2010
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName: Update for Microsoft Office 2010 (KB2553267) 32-Bit Edition
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName: Update for Microsoft Office 2010 (KB2760631) 32-Bit Edition
    DisplayName:
    DisplayName:
    DisplayName: Update for Microsoft Office 2010 (KB2494150)
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName: HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{90140000-0011-0000-0000-0000000FF1CE}_Office14.PROPLUS_{9569DE03-1425-4D12-96EB-44D852AF759A}\DisplayName
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName: Update for Microsoft Office 2010 (KB2553065)
    DisplayName:
    DisplayName: Security Update for Microsoft Office 2010 (KB2598243) 32-Bit Edition
    DisplayName: Update for Microsoft Office 2010 (KB2825640) 32-Bit Edition
    DisplayName:
    DisplayName: Update for Microsoft Outlook Social Connector 2010 (KB2553406) 32-Bit Edition
    DisplayName: Security Update for Microsoft Office 2010 (KB2553371) 32-Bit Edition
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName: Security Update for Microsoft Office 2010 (KB2589320) 32-Bit Edition
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName: Update for Microsoft Office 2010 (KB2596964) 32-Bit Edition
    DisplayName: Update for Microsoft Office 2010 (KB2566458)
    DisplayName:
    DisplayName:
    DisplayName: Microsoft Office Access MUI (English) 2010
    DisplayName:
    DisplayName: Microsoft Office Excel MUI (English) 2010
    DisplayName:
    DisplayName: Microsoft Office PowerPoint MUI (English) 2010
    DisplayName:
    DisplayName:
    DisplayName: Microsoft Office Publisher MUI (English) 2010
    DisplayName:
    DisplayName: Microsoft Office Outlook MUI (English) 2010
    DisplayName: Update for Microsoft Outlook Social Connector 2010 (KB2553406) 32-Bit Edition
    DisplayName:
    DisplayName:
    DisplayName: Microsoft Office Word MUI (English) 2010
    DisplayName:
    DisplayName: Microsoft Office Proof (English) 2010
    DisplayName:
    DisplayName:
    DisplayName: Microsoft Office Proof (French) 2010
    DisplayName:
    DisplayName:
    DisplayName: Microsoft Office Proof (Spanish) 2010
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName: Microsoft Office Proofing (English) 2010
    DisplayName:
    DisplayName: Microsoft Office InfoPath MUI (English) 2010
    DisplayName:
    DisplayName: Microsoft Office Shared MUI (English) 2010
    DisplayName:
    DisplayName:
    DisplayName: Update for Microsoft Office 2010 (KB2553310) 32-Bit Edition
    DisplayName: Microsoft Office OneNote MUI (English) 2010
    DisplayName:
    DisplayName: Update for Microsoft OneNote 2010 (KB2553290) 32-Bit Edition
    DisplayName: Microsoft Office Groove MUI (English) 2010
    DisplayName:
    DisplayName: Microsoft Office Shared Setup Metadata MUI (English) 2010
    DisplayName:
    DisplayName:
    DisplayName: Microsoft Office Access Setup Metadata MUI (English) 2010
    DisplayName:
    DisplayName: Microsoft Office Visio Viewer 2003 (English)
    DisplayName: Cardiff TeleForm
    DisplayName:
    DisplayName:
    DisplayName: CodeMax Runtime Installer
    DisplayName: Microsoft .NET Framework 1.1
    DisplayName:
    DisplayName:
    DisplayName: Microsoft XML Parser
    DisplayName:
    DisplayName: Microsoft Visual C++ 2010 x86 Redistributable - 10.0.40219
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    Working:
    Microsoft (R) Windows Script Host Version 5.8
    Copyright (C) Microsoft Corporation. All rights reserved.
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName: DYMO Label v.8
    DisplayName:
    DisplayName: GPL Ghostscript 8.60
    DisplayName: GPL Ghostscript Fonts
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName: Microsoft Office Professional Plus 2010
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName: Microsoft ASP.NET 2.0 AJAX Extensions 1.0
    DisplayName: Adobe Flash Player 11 Plugin
    found
    DisplayName: Sybase PowerBuilder 12.0 Standard Runtime
    DisplayName: MSXML 4.0 SP3 Parser
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName: MSXML 4.0 SP3 Parser (KB2758694)
    DisplayName: Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729.4148
    DisplayName: Cisco WebEx Meeting Center for Internet Explorer
    DisplayName: Configuration Manager Client
    DisplayName: Java 7 Update 51
    DisplayName: Citrix Online Launcher
    DisplayName: MSXML 4.0 SP3 Parser (KB2721691)
    DisplayName: Microsoft Windows Journal Viewer
    DisplayName: Java Auto Updater
    DisplayName: VBA (2627.01)
    DisplayName: Microsoft Visual C++ 2005 Redistributable
    DisplayName: Microsoft Visual C++ 2005 Redistributable
    DisplayName: Apple Software Update
    DisplayName: SQL Anywhere 9 for Windows x64
    DisplayName: Microsoft Office Professional Plus 2010
    DisplayName: Update for Microsoft Filter Pack 2.0 (KB2810071) 32-Bit Edition
    DisplayName: Security Update for Microsoft Office 2010 (KB2826035) 32-Bit Edition
    DisplayName: Microsoft Office 2010 Service Pack 1 (SP1)
    DisplayName: Update for Microsoft Office 2010 (KB2553267) 32-Bit Edition
    DisplayName: Update for Microsoft PowerPoint 2010 (KB2553145) 32-Bit Edition
    DisplayName: Update for Microsoft Office 2010 (KB2589375) 32-Bit Edition
    DisplayName: Security Update for Microsoft Office 2010 (KB2687276) 32-Bit Edition
    DisplayName: Update for Microsoft Office 2010 (KB2760631) 32-Bit Edition
    DisplayName: Update for Microsoft OneNote 2010 (KB2810072) 32-Bit Edition
    DisplayName: Security Update for Microsoft InfoPath 2010 (KB2687422) 32-Bit Edition
    DisplayName: Update for Microsoft Office 2010 (KB2494150)
    DisplayName: Security Update for Microsoft Office 2010 (KB2687423) 32-Bit Edition
    DisplayName: Security Update for Microsoft Office 2010 (KB2597986) 32-Bit Edition
    DisplayName: Update for Microsoft Office 2010 (KB2794737) 32-Bit Edition
    DisplayName: Update for Microsoft SharePoint Workspace 2010 (KB2589371) 32-Bit Edition
    DisplayName: Security Update for Microsoft Publisher 2010 (KB2553147) 32-Bit Edition
    DisplayName: Security Update for Microsoft Office 2010 (KB2850016) 32-Bit Edition
    DisplayName: Definition Update for Microsoft Office 2010 (KB982726) 32-Bit Edition
    DisplayName: Security Update for Microsoft InfoPath 2010 (KB2760406) 32-Bit Edition
    DisplayName: Update for Microsoft Visio Viewer 2010 (KB2810066) 32-Bit Edition
    DisplayName: HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{90140000-0011-0000-0000-0000000FF1CE}_Office14.PROPLUS_{9569DE03-1425-4D12-96EB-44D852AF759A}\DisplayName
    DisplayName: Update for Microsoft Office 2010 (KB2767886) 32-Bit Edition
    DisplayName: Update for Microsoft Office 2010 (KB2597087) 32-Bit Edition
    DisplayName: Security Update for Microsoft Office 2010 (KB2687510) 32-Bit Edition
    DisplayName: Update for Microsoft Office 2010 (KB2553065)
    DisplayName: Update for Microsoft Access 2010 (KB2553446) 32-Bit Edition
    DisplayName: Security Update for Microsoft Office 2010 (KB2598243) 32-Bit Edition
    DisplayName: Update for Microsoft Office 2010 (KB2825640) 32-Bit Edition
    DisplayName: Security Update for Microsoft Visio 2010 (KB2810068) 32-Bit Edition
    DisplayName: Update for Microsoft Outlook Social Connector 2010 (KB2553406) 32-Bit Edition
    DisplayName: Security Update for Microsoft Office 2010 (KB2553371) 32-Bit Edition
    DisplayName: Update for Microsoft Office 2010 (KB2826026) 32-Bit Edition
    DisplayName: Update for Microsoft Office 2010 (KB2589298) 32-Bit Edition
    DisplayName: Security Update for Microsoft Excel 2010 (KB2826033) 32-Bit Edition
    DisplayName: Security Update for Microsoft Office 2010 (KB2589320) 32-Bit Edition
    DisplayName: Security Update for Microsoft Word 2010 (KB2863902) 32-Bit Edition
    DisplayName: Security Update for Microsoft Office 2010 (KB2826023) 32-Bit Edition
    DisplayName: Update for Microsoft Office 2010 (KB2760598) 32-Bit Edition
    DisplayName: Update for Microsoft Office 2010 (KB2596964) 32-Bit Edition
    DisplayName: Update for Microsoft Office 2010 (KB2566458)
    DisplayName: Update for Microsoft Office 2010 (KB2589352) 32-Bit Edition
    DisplayName: Security Update for Microsoft Outlook 2010 (KB2837597) 32-Bit Edition
    DisplayName: Microsoft Office Access MUI (English) 2010
    DisplayName: Microsoft Office 2010 Service Pack 1 (SP1)
    DisplayName: Microsoft Office Excel MUI (English) 2010
    DisplayName: Microsoft Office 2010 Service Pack 1 (SP1)
    DisplayName: Microsoft Office PowerPoint MUI (English) 2010
    DisplayName: Microsoft Office 2010 Service Pack 1 (SP1)
    DisplayName: Update for Microsoft PowerPoint 2010 (KB2553145) 32-Bit Edition
    DisplayName: Microsoft Office Publisher MUI (English) 2010
    DisplayName: Microsoft Office 2010 Service Pack 1 (SP1)
    DisplayName: Microsoft Office Outlook MUI (English) 2010
    DisplayName: Update for Microsoft Outlook Social Connector 2010 (KB2553406) 32-Bit Edition
    DisplayName: Update for Microsoft Outlook 2010 (KB2687623) 32-Bit Edition
    DisplayName: Microsoft Office 2010 Service Pack 1 (SP1)
    DisplayName: Microsoft Office Word MUI (English) 2010
    DisplayName: Microsoft Office 2010 Service Pack 1 (SP1)
    DisplayName: Microsoft Office Proof (English) 2010
    DisplayName: Microsoft Office 2010 Service Pack 1 (SP1)
    DisplayName: Update for Microsoft Office 2010 (KB2850079) 32-Bit Edition
    DisplayName: Microsoft Office Proof (French) 2010
    DisplayName: Microsoft Office 2010 Service Pack 1 (SP1)
    DisplayName: Update for Microsoft Office 2010 (KB2850079) 32-Bit Edition
    DisplayName: Microsoft Office Proof (Spanish) 2010
    DisplayName: Update for Microsoft Office 2010 (KB2850079) 32-Bit Edition
    DisplayName: Microsoft Office 2010 Service Pack 1 (SP1)
    DisplayName: Update for Microsoft Filter Pack 2.0 (KB2810071) 32-Bit Edition
    DisplayName: Update for Microsoft OneNote 2010 (KB2810072) 32-Bit Edition
    DisplayName: Update for Microsoft SharePoint Workspace 2010 (KB2589371) 32-Bit Edition
    DisplayName: Microsoft Office 2010 Service Pack 1 (SP1)
    DisplayName: Update for Microsoft Office 2010 (KB2760598) 32-Bit Edition
    DisplayName: Update for Microsoft Office 2010 (KB2589352) 32-Bit Edition
    DisplayName: Microsoft Office 2010 Service Pack 1 (SP1)
    DisplayName: Microsoft Office Proofing (English) 2010
    DisplayName: Microsoft Office 2010 Service Pack 1 (SP1)
    DisplayName: Microsoft Office InfoPath MUI (English) 2010
    DisplayName: Microsoft Office 2010 Service Pack 1 (SP1)
    DisplayName: Microsoft Office Shared MUI (English) 2010
    DisplayName: Microsoft Office 2010 Service Pack 1 (SP1)
    DisplayName: Security Update for Microsoft Office 2010 (KB2553284) 32-Bit Edition
    DisplayName: Update for Microsoft Office 2010 (KB2553310) 32-Bit Edition
    DisplayName: Microsoft Office OneNote MUI (English) 2010
    DisplayName: Microsoft Office 2010 Service Pack 1 (SP1)
    DisplayName: Update for Microsoft OneNote 2010 (KB2553290) 32-Bit Edition
    DisplayName: Microsoft Office Groove MUI (English) 2010
    DisplayName: Microsoft Office 2010 Service Pack 1 (SP1)
    DisplayName: Microsoft Office Shared Setup Metadata MUI (English) 2010
    DisplayName: Microsoft Office 2010 Service Pack 1 (SP1)
    DisplayName: Microsoft Office 2010 Service Pack 1 (SP1)
    DisplayName: Microsoft Office Access Setup Metadata MUI (English) 2010
    DisplayName: Microsoft Office 2010 Service Pack 1 (SP1)
    DisplayName: Microsoft Office Visio Viewer 2003 (English)
    DisplayName: Cardiff TeleForm
    DisplayName: Adobe Acrobat XI Pro
    found
    DisplayName: QuickTime
    DisplayName: CodeMax Runtime Installer
    DisplayName: Microsoft .NET Framework 1.1
    DisplayName: WinZip 15.0
    DisplayName: McAfee VirusScan Enterprise
    DisplayName: Microsoft XML Parser
    DisplayName: McAfee Agent
    DisplayName: Microsoft Visual C++ 2010 x86 Redistributable - 10.0.40219
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName:
    DisplayName: Apple Application Support
    Does anyone know why this might be happening? The only main difference is that the machine that the script does not work on, has visual studio 2013 installed.
    Please help

    Well I think we can agree that it is not supported remotely. Because while it did initially work remotely, it didnt behave consistently; that is, it worked on the VM, but not my desktop. That's the whole reason I created this thread. Sorry if you are confused,
    but I most certainly was not lying and not trying to troll the forum or whatever it is you are insuinuating. Chill out a little bit and maybe you might get that Microsoft MVP.
    I am trying to get you t understand why what you are saying is wrong.  You may have thought it worked but there were a number of things that make it impossible to actually work.
    You were enumerating a remote key.  You were using that key name with RegRead and it was looking up the local value.  That is why it could not find remote keys and values.  The local and remote machines will not match on all keys.
    The correct call is the "GetStringValue" of the registry provider because it is the only call that can read remote values. My point is that you were fooling yourself by thinking that it ever actually worked.  If anything it was just dumb luck
    that the keys would match. 
    So maybe you weren't actually lying but you were surely foolingyourself and confusing us.
    Anyway - glad you fixed it and just remember to not mix calls like you did.  Also don't use On Error Resume Next unless you plan on test every call for an error.
    ¯\_(ツ)_/¯

  • T-SQL: SET Statement Using a Case Statement is not returning a value

    SQL VER:  2008
    Please see the attached screenshot from SSMS.  The Set statement  below is not returned a value or may be returning a zero value.  The AllocPercent field is set to zero in code preceeding this Update Statement:
    AllocPercent
    =
    CASE
    WHEN AllocBase
    IS
    NULL
    OR AllocBase
    = 0
    THEN 0
    ELSE PM_Input/AllocBase
    END
    As you can see by the screen shot from the Select Statement that is displaying the results after the Update Statement is completed, the value of AllocPercent is = 0 even though all the values necessary for it to compute a value > 0 are present in the
    table.  Incidentally, the values in both the AllocBase and PM_Input fields are the same before the Update Statement is ran, as shown in the Select ran after the Update Statement.
    I have ran this type of code several times with never a problem.  This seems really simple, but I just can't seem to get it to compute. 
    Any help would be greatly appreciated.
    Regards,
    bob sutor
    Bob Sutor

    Yep--This statement is running in a Stored Procedure and inside its own block statement.
    I did get a response that suggested I change the SET statement as follows, that worked:
    AllocPercent
    = CASE WHEN AllocBase IS NULL OR AllocBase = 0 THEN 0.00 ELSE cast(PM_Input*1.0/AllocBase*1.0
     as decimal(6,2)) END
    Your response did get me thinking which was great!  I appreciate your help.
    Regards,
    ...bob sutor
    Bob Sutor

  • AF TREE:How to Create Method in backing to Return TreeNode Value Selected

    Hi all;
    I use HR Schema
    in ADF Tree example; I created a Special Page for each Emplyee
    so I want to create a new Method called callPage in backing_test1 class to Return FirstName of the Employee at Selecting Employee Node in the Tree
    like my example below :
    <af:tree value="#{bindings.DepartmentsView1.treeModel}" var="node"
    binding="#{backing_test1.tree1}" id="tree1">
    <f:facet name="nodeStamp">
    <h:panelGroup>
    <af:commandLink text="#{node}" partialSubmit="false"
    id="nodeAction1"
    rendered="#{backing_test1.tree1.depth==0}"/>
    <af:commandLink text="#{node}" partialSubmit="false"
    id="nodeAction2"
    action="#{backing_test1.callPage}"
    rendered="#{backing_test1.tree1.depth==1}"
    actionListener="#bindings.setCurrentEmployeesRowWithKey.execute}"/>
    </h:panelGroup>
    </f:facet>
    </af:tree>
    Best Regards

    mail2bansi wrote:
    Please ignore my earlier message . I hit some key mistakenly and it resulted in send messageThere´s an edit button available as long as no one has responded to your message yet.
    if Validation fails on attribute "required=true"
    wouldn't it result in renderResponse phase
    OR
    it still proceeds to render Response phase Uh, validation happens in validations phase (or apply request values phase, when immediate is set to true). After that, if any validation has failed, then it will proceed to the render response phase immediately.
    Also i forgot to mention that we use Ajax4JSF,
    so to clear FacesMessage by ClientId
    if i retrieve ViewRoot it returns AjaxViewRoot thereby it never returns the correct Iterator meaning Iterator.hasNext() is always falseI don't have extensive experience with Ajax4jsf, so I have no idea what to say here.

  • Standar ws ProjectByPartyQueryResponse_In is not returning any values

    Hi gurus,
      I'm trying to use the standar webservice ProjectByPartyQueryResponse_In in our landscape in order to get all the projects related to the person responsible for the project but the web service is not returning any values.
    When I execute the service -using soapui- with the following values (or any other value for that matters):
    <PartyID>20000143</PartyID>
    <PartyRoleCode>ZA</PartyRoleCode>
    The web service always returns :
           <Log>
                <BusinessDocumentProcessingResultCode>5</BusinessDocumentProcessingResultCode>
                <MaximumLogItemSeverityCode>3</MaximumLogItemSeverityCode>
                <Item>
                   <TypeID>002(ECC_SE_COMMON)</TypeID>
                   <SeverityCode>3</SeverityCode>
                   <Note>No records returned for ZA 0020000143</Note>
                </Item>
             </Log>
    The party Id exists and also de party role code and there is at least one project that has that party with that role. I'm sure because I use other web service to find a project by id and in the result the project has the <Party> section with those values.
    I was looking for solutions, notes, threads in forums with no success, then i decided to debug the webservice and I did find the following line in the webservice code.
      SELECT objnr INTO TABLE it_data FROM ihpa
      WHERE  parvw = role_code AND
             parnr = party_id AND
             obtyp = 'PDN'.
    when that line executes the select always returns 0 values, then I look in the table IHPA using the SE16 without any filter and I found that my records exists!! but the select does not get it. I was wondering why the select is not working and then I filter the data in the SE16 using the same values that the query does
    for example:
    PARVW= ZA
    PARNR = 20000143
    OBTYP = PDN
    And I was surprised when the SE16 did not found any value even I was seeing in the previous screen with no filters!!!! And I supouse thats why the webservice is not working. I started making filters one by one, for example firts filtering just de PARVW = ZA and works, but when I filter just the PARNR =  20000143 the SE16 can't find any value, just when I put an * at the end of the number the SE16 returns all the values expected, Im guessing that the fields in the database has blanks at the end but this is a standar table and a standar program.
    Have any of you had the same problem? is there anything that I can do? does anyone knows if this is an unkown bug? becaus I could'n find any note on the marketplace.
    Any help would be appreciated.
    Gustavo Balboa

    Hi!
      The problem were solved but not using the Badi, because the badi only let you change the value of the var party_id and that var is declared as PARNR (of type numeric with length 10), and no mater wat you do the two 00 can´t be removed.
      We solved the problem with an enhancement point in the code at the method "party_get_data", look at the beginin and at the end. We just change the type of var used for party_id.. now we use a CHAR one insted the numeric used by the original code.
    And we repeat the select...
    Thank you very much for the help.
    METHOD party_get_data.
    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$SE:(1) Class CL_PRS_PROJECTPRJPARTYQR, Method PARTY_GET_DATA, Start                                                                                A
    $$-Start: (1)----
    $$
    ENHANCEMENT 1  ZPARTY_GET_DATA.    "active version
    DATA : WA_PARNR TYPE I_PARNR.
    DATA : WA_CHPAR(10) TYPE C.
    ENDENHANCEMENT.
    $$-End:   (1)----
    $$
      DATA :  temp_object_number TYPE ihpa-objnr,
              field1 TYPE char50,
              field2 TYPE char50,
              field_role TYPE char50,
              field_party TYPE char50,
              st_object_number TYPE TABLE OF bapiprexp.
      DATA : it_data TYPE TABLE OF st_data,
             wa_data LIKE LINE OF it_data,
             itab TYPE TABLE OF st_data,
             wa LIKE LINE OF itab,
             wa_project_details LIKE LINE OF project_details,
             null.
    Select Object number based on input Party and Role
      SELECT objnr INTO TABLE it_data FROM ihpa
      WHERE  parvw = role_code AND
             parnr = party_id AND
             obtyp = 'PDN'.
    Select Project ID based on input Object number
      LOOP AT it_data INTO wa_data.
        SELECT pspid post1 FROM proj INTO CORRESPONDING FIELDS OF wa_data
        WHERE  objnr = wa_data-pspid.                         "#EC CI_NOFIELD
        ENDSELECT.
        MOVE-CORRESPONDING wa_data TO wa.
        APPEND wa TO itab.
      ENDLOOP.
      IF sy-subrc <> 0.
        field_role = cl_wd_utilities=>get_otr_text_by_alias( 'PLM-SE_PRS_XI_PROXY/ROLE_CODE' ) .
        field_party = cl_wd_utilities=>get_otr_text_by_alias( 'PLM-SE_PRS_XI_PROXY/PARTY_ID' ) .
        CONCATENATE  field_role role_code_external INTO field1.
        CONCATENATE  field_party party_id INTO field2.
        MESSAGE e002(ecc_se_common) WITH field1 field2 INTO null.
        CALL FUNCTION 'PS_BAPI_MESSAGE_APPEND'
          TABLES
            return = party_return.
      ELSE.
        MESSAGE s082(ops_se_prs) INTO null.
        CALL FUNCTION 'PS_BAPI_MESSAGE_APPEND'
          TABLES
            return = party_return.
      ENDIF.
      LOOP AT itab INTO wa.
        MOVE-CORRESPONDING wa TO wa_project_details.
        APPEND wa_project_details TO project_details.
      ENDLOOP.
    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$SE:(2) Class CL_PRS_PROJECTPRJPARTYQR, Method PARTY_GET_DATA, End                                                                                A
    $$-Start: (2)----
    $$
    ENHANCEMENT 2  ZPARTY_GET_DATA.    "active version
      WA_CHPAR = party_id.
      SHIFT WA_CHPAR BY 2 PLACES.
      CLEAR party_return.
      REFRESH party_return.
      SELECT objnr INTO TABLE it_data FROM ihpa
      WHERE  parvw = role_code AND
             parnr = WA_CHPAR AND
             obtyp = 'PDN'.
    Select Project ID based on input Object number
      LOOP AT it_data INTO wa_data.
        SELECT pspid post1 FROM proj INTO CORRESPONDING FIELDS OF wa_data
        WHERE  objnr = wa_data-pspid.                         "#EC CI_NOFIELD
        ENDSELECT.
        MOVE-CORRESPONDING wa_data TO wa.
        APPEND wa TO itab.
      ENDLOOP.
      IF sy-subrc <> 0.
        field_role = cl_wd_utilities=>get_otr_text_by_alias( 'PLM-SE_PRS_XI_PROXY/ROLE_CODE' ) .
        field_party = cl_wd_utilities=>get_otr_text_by_alias( 'PLM-SE_PRS_XI_PROXY/PARTY_ID' ) .
        CONCATENATE  field_role role_code_external INTO field1.
        CONCATENATE  field_party party_id INTO field2.
        MESSAGE e002(ecc_se_common) WITH field1 field2 INTO null.
        CALL FUNCTION 'PS_BAPI_MESSAGE_APPEND'
          TABLES
            return = party_return.
      ELSE.
        MESSAGE s082(ops_se_prs) INTO null.
        CALL FUNCTION 'PS_BAPI_MESSAGE_APPEND'
          TABLES
            return = party_return.
      ENDIF.
      LOOP AT itab INTO wa.
        MOVE-CORRESPONDING wa TO wa_project_details.
        APPEND wa_project_details TO project_details.
      ENDLOOP.
    ENDENHANCEMENT.
    $$-End:   (2)----
    $$
    ENDMETHOD.

  • Function not returning right value

    I have this following function, based on the return value from this function, I am inserting a row into the GROUP_MAP table.
    This function is returning a value greater than zero even though constrains would not let it select any rows.
    It looks as if it is not applying the "AND STRING_CODE = String_Code" constraint to the result set. If there are two records matching the groupOID I passed it is returning two as the count(*). I checked by executing the query directly and I got 0 as the result. I sounds so strange. Is there any thing I am doing wrong ?
    Thanks in Advance,
    -Bhasker
    FUNCTION FIND_CODE_GROUP (groupOID IN NUMBER, String_Code IN VARCHAR2)
                   RETURN NUMBER
              AS
                        RETURN_VAL NUMBER(10);
                   BEGIN
                        RETURN_VAL := 0;
                        SELECT
                             COUNT(*)
                        INTO
                             RETURN_VAL
                        FROM
                             GROUP_MAP
                        WHERE
                             STRING_GROUP = groupOID AND STRING_CODE = String_Code;
                        DBMS_OUTPUT.PUT_LINE('RETURN_VAL:'|| RETURN_VAL || ' String code : ' || STRING_CODE);
                        RETURN(RETURN_VAL);
                        EXCEPTION
                             WHEN OTHERS THEN
                                  RETURN(0);
                   END FIND_CODE_GROUP;

    FUNCTION FIND_CODE_GROUP (groupOID IN NUMBER, String_Code IN VARCHAR2)
                   RETURN NUMBER
              AS
                        RETURN_VAL NUMBER(10);
                   BEGIN
                        RETURN_VAL := 0;
                        SELECT
                             COUNT(*)
                        INTO
                             RETURN_VAL
                        FROM
                             GROUP_MAP
                        WHERE
                             STRING_GROUP = groupOID AND STRING_CODE = String_Code;The second parameter to your function has the same name as the column name "STRING_CODE" in your table. You should change
    the name of your second parameter to something other than "STRING_CODE".

  • Return Code value using 'starting new task' and 'wait until'

    I'm having a minor issue with some return code values in my ABAP.
    This is what part of it used to look like before I modified it:
    With Code in version 1, the sy-subrc was not always zero, sometimes it would be 4.
    That was fine, and my abap would do something based on the non-zero RC.
    had a need to implement an RFC timeout, the only way I could see to do it was to use 'starting new task' etc as seen in Version 2.
    However, with my changes, sy-subrc is always zero.
    The ABAP runs fine but I know that sy-subrc should sometimes be 4, even when it returns within the allotted 60 seconds.
    Maybe I've coded it incorrectly.
    Can someone point me in the right direction?
    #>> Start of VERSION 1
      call function 'MY_FUNCTION_MODULE'
           destination RFCDEST
           tables
                orders_list          = t_orders_packet
                apo_orders_list      = t_apo_orders
                apo_resources        = t_apo_resources
           exceptions
                COMMUNICATION_FAILURE    = 1 MESSAGE MSG_TEXT
                SYSTEM_FAILURE           = 2 MESSAGE MSG_TEXT
                NO_ORDERS_SUPPLIED       = 3
                NO_PEGGED_ORDERS_FOUND   = 4
                ORDERID_CONVERSION_ERROR = 5
                OTHERS                   = 6.
    if sy-subrc is initial.
      * do some stuff as RC was 0
    else.
    * log non-zero return code etc
    endif.
    * << End of Version 1

    And now Version 2.
    I didn't put this into the 1st post as the formatting goes bonkers.
    #>> Start of VERSION 2
      call function 'MY_FUNCTION_MODULE'
           destination RFCDEST
           starting new task 'taskname'
           performing receive_result on end of task
           tables
                orders_list          = t_orders_packet
                apo_orders_list      = t_apo_orders
                apo_resources        = t_apo_resources
           exceptions
                COMMUNICATION_FAILURE    = 1 MESSAGE MSG_TEXT
                SYSTEM_FAILURE           = 2 MESSAGE MSG_TEXT
                NO_ORDERS_SUPPLIED       = 3
                NO_PEGGED_ORDERS_FOUND   = 4
                ORDERID_CONVERSION_ERROR = 5
                OTHERS                   = 6.
      WAIT UNTIL results_received = 'X' UP TO 60 SECONDS.
    if sy-subrc is initial.   << Now this is always ZERO
      * do some stuff as RC was 0
    else.
    * log non-zero return code etc
    endif.
    FORM receive_result USING iv_taskname.
      RECEIVE RESULTS FROM FUNCTION 'MY_FUNCTION_MODULE'
           tables
                orders_list          = t_orders_packet
                apo_orders_list      = t_apo_orders
                apo_resources        = t_apo_resources
           exceptions
                COMMUNICATION_FAILURE    = 1 MESSAGE MSG_TEXT
                SYSTEM_FAILURE           = 2 MESSAGE MSG_TEXT
                NO_ORDERS_SUPPLIED       = 3
                NO_PEGGED_ORDERS_FOUND   = 4
                ORDERID_CONVERSION_ERROR = 5
                OTHERS                   = 6.
      results_received = 'X'.
    endform.                    "receive_result
    * < End of Version 2

Maybe you are looking for