How to compare a parameter while calling a function?

Hello,
I have a powershell script with a function doing a switch process. While calling the function in the script I want to compare if the parameter is contained in the switch condition of the function.
function test{
[CmdletBinding()]
Param(
[Parameter(
Mandatory=$False,
ValueFromPipeline=$True,
ValueFromPipelineByPropertyName=$False
[string]$InputValue
$Param = switch($InputValue){
A {"string1,string2,string3"}
B {"string1,string2,string3"}
C {"string1,string2,string3"}
Return $Param}
If ((test($search)) -match ""){
$scrDynMSGArry = (test($search)).Split(",")
$NV = [PSCustomObject]@{
Param = $ParamString1 = $scrDynMSGArry[0]
String2 = $scrDynMSGArry[1]
String3 = $scrDynMSGArry[2]
Error message is: InvokeMethodOnNull for doing the split and reading the array.
I think there is a problem doing the comparison but have no idea to solve this.
Can anybody help?
Regards, Doreen

This appears to be what you are trying to do:
\_(ツ)_/
From how he is wording things, it sounds to me that if I pass $search the letter F, he wants to check to see if the switch statement contains a case for F, and if not do something. I do not think this can be done but he could always have a Default case,
returning something to indicate they need to choose something else, or the default parameters needed for whatever he is doing to work.
If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful.
Don't Retire Technet
She please ;-)
But clayman2 is right: $search can be F, G, ... but I want to use the function "test" only if its A,B or C.
I thought if $search is F it does not enter the if part beacause the condition is not true:
If ((test($search)) -match "")
You think thats not possible?
Would it be better to compare $search with my conditions (A, B or C are defined and known) for itself and then enter the function "test"? Can I have or conditions in the if part like
If ($search -eq "A"){$scrDynMSGArry = (test($search)).Split(",")
$NV = [PSCustomObject]@{
String1 = $scrDynMSGArry[0]
String2= $scrDynMSGArry[1]
String3= $scrDynMSGArry[2]
elseif ($search -eq "B"){$scrDynMSGArry = (test($search)).Split(",")
elseif ($search -eq "C"){$scrDynMSGArry = (test($search)).Split(",")

Similar Messages

  • How to skip first screen while calling transaction

    Hi all,
    I am using interactive alv.
    if i select one line and press details
    that must go to another screen.
    In that i must skip first screen and directly go to the details of that first screen.
    suppose i am using the code as follows
    call transaction mm01 and skip first screen
    this is giving me error.
    how to solve the problem.
    thanks and regards,
    giri.

    hi giri,
    For ur requirement, u can use SKIP FIRST SCREEN addition for CALL TRANSACTION Command.
    Before this, u have to use SET PARAMETER ID Command to pass the required values for transaction.
    Example, In transaction VA01, we have to set parameter AUN to pass the sale order number to the transaction.
    <b>
    AT LINE-SELECTION .
    SET PARAMETER ID 'AUN' FIELD w_vbeln.
    CALL TRANSACTION 'VA01' AND SKIP FIRST SCREEN .</b>
    where w_vbeln contains the sale ordre number. Now VA01 runs for this sale order number..... And AUN is the PARAMETER to be set before calling VA01 TCODE.
    similarly, check the PARAMETER associated with MM01 Tcode and initialize that parameter and call the code in the similar way.
    To check parameter Id of MM01,
    1) Enter MM01 Transaction
    2) Press F1 on Material Field
    3) Select Technical Info
    4) u can find Parameter ID associated with this field.
    check these links for full details.
    call transaction...
    http://help.sap.com/saphelp_47x200/helpdata/en/78/21761c51ce11d189570000e829fbbd/frameset.htm
    at line selection,
    http://help.sap.com/saphelp_47x200/helpdata/en/9f/dba2c435c111d1829f0000e829fbfe/frameset.htm
    get/set parameter:
    http://help.sap.com/saphelp_nw04/helpdata/en/5b/7bc3775d1111d295ad0000e82de14a/frameset.htm
    Reward me if useful........
    Harimanjesh AN

  • HT5661 how to set pic display while calling to contact ?

    how to set pic display on calling to contact person ?

    Hello HaD,
    The image control is installed with either the Vision Development Module or the NI-IMAQ driver, and is not a standard component found in LabVIEW.  If you have questions about the image display control or vision functions it would be better to post in the Machine Vision forum:
    http://forums.ni.com/ni/board?board.id=200
    In regards to your question, this menu is not available as a runtime property, and therefore the user of program will not be able to set it directly through the control.  Instead, you will need to allow the user to set it programmatically in LabVIEW by use of a property node. 
    To create this property node, right-click on the image display icon on your program's block diagram, and select:
    Create » Property Node » Palette » Palette Type.
    You will then be able to change the value of this property by right-clicking on the property node icon and selecting "Change All To Write".  To create a control on the front panel that the user change at runtime, right-click on the “Palette Type” input, select:
    Create » Control
    If you have any questions about the application architecture required to implement this design, please continue to post in the LabVIEW forum.
    I hope this helps.
    Best regards,
    Jasper

  • How to use structure pointer with « Call Library Function node » in LabVIEW

    I use GetTimeZoneInformation from kernel32.dll. It definition is :
    DWORD GetTimeZoneInformation( LPTIME_ZONE_INFORMATION lpTimeZoneInformation );
    Where
    lpTimeZoneInformation
    [out] Pointer to a TIME_ZONE_INFORMATION structure to receive the current time-zone parameters.
    http://msdn.microsoft.com/library/default.asp?url=​/library/en-us/sysinfo/base/gettimezoneinformation​...
    I don't know how to set this parameter with my cluster based on the TIME_ZONE_INFORMATION structure.
    Your help will be appreciate
    Thanks
    INKSPEC

    INKSPEC wrote:
    I use GetTimeZoneInformation from kernel32.dll. It definition is :
    DWORD GetTimeZoneInformation( LPTIME_ZONE_INFORMATION lpTimeZoneInformation );
    Where
    lpTimeZoneInformation
    [out] Pointer to a TIME_ZONE_INFORMATION structure to receive the current time-zone parameters.
    http://msdn.microsoft.com/library/default.asp?url=​/library/en-us/sysinfo/base/gettimezoneinformation​...
    I don't know how to set this parameter with my cluster based on the TIME_ZONE_INFORMATION structure.
    Your help will be appreciate
    Thanks
    INKSPEC
    If creating a wrapper DLL which does the conversion for you is not an option (I think it won't since that would require C programming and if you knew C programming you wouldn't ask this here) then you will have to create a byte array of appropriate length and just configure the Call Library Node to pass this array as an Array of unsigned bytes and as C pointer.
    On return you will have to copy out the interesting data at the right position.
    First the length of this structure would be:
    typedef struct _TIME_ZONE_INFORMATION {
    LONG Bias; 4
    WCHAR StandardName[32]; 32 * 2
    SYSTEMTIME StandardDate; 8 * 2
    LONG StandardBias; 4
    WCHAR DaylightName[32]; 32 * 2
    SYSTEMTIME DaylightDate; 8 * 2
    LONG DaylightBias; 4
    } TIME_ZONE_INFORMATION
    Total 172 bytes
    Now the fun part will be to actually get out the information. There are a number of difficulties.
    First the strings are 16 bit Unicode so if you are interested in them you will have to call a different Windows API function WideCharToMultiByte function to convert the 16bit Unicode string into an ASCII string. For this part there has been a post here:
    http://forums.ni.com/ni/board/message?board.id=170​&message.id=123821&requireLogin=False
    For the LONG values you would pick 4 bytes at the appropriate offset from the array through the Array Subset function and then typecast it into an int32 and pass that through the Swap Bytes and Swap Words functions to reverse the LabVIEW Big Endian byte swapping in the Typecast function.
    The SYSTEMTIME is a structure with eight 2 byte integers so it would be best to use Array Subset again to extract 16 bytes at the correct offset, typecast this into a cluster with eight int16 numerics and pass it through Swap Bytes too.
    You see accessing such API functions in LabVIEW directly can get easily quite a mess and that is the reason why creating a wrapper DLL to convert properly between LabVIEW datatypes and C datatypes gets soon the easier solution if you need to interface with more than one or two functions taking such complicated data structures.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Passing an array as IN parameter to call a function

    I have a function the definition is
    TYPE VAR_VALUE_RECORD IS RECORD(VAR VARCHAR2(100),
                   VALUE VARCHAR2(100));
    TYPE VAR_VALUE_TAB IS TABLE OF VAR_VALUE_RECORD;
    FUNCTION GENERIC_WF(P_MSG_TYPE IN VARCHAR2,P_CDCS_NBR IN VARCHAR2, P_CDCS_SEQ IN VARCHAR2, P_DEBTORID IN NUMBER,
    P_EXTRAS IN VAR_VALUE_TAB) RETURN VARCHAR2;
    I am trying to call this function
    select WF_NOTIFICATIONS_PKG.GENERIC_WF('Manual Debt Establish Notification','2009A13636','001',105195359,'this is a test') from dual
    ERROR at line 1:
    ORA-06553: PLS-306: wrong number or types of arguments in call to 'GENERIC_WF'
    I am getting the above error, how do I pass the array as parameter.
    I will appreciate your help.
    Thnaks

    Hi,
    try this,
    Create OR Replace Package WF_NOTIFICATIONS_PKG Is
       Type VAR_VALUE_RECORD Is Record( VAR   Varchar2(100)
                                      , Value Varchar2(100));
       Type VAR_VALUE_TAB Is Table Of VAR_VALUE_RECORD Index BY Pls_Integer;
       Function GENERIC_WF( P_MSG_TYPE IN Varchar2
                          , P_CDCS_NBR IN Varchar2
                          , P_CDCS_SEQ IN Varchar2
                          , P_DEBTORID IN Number
                          , P_EXTRAS   IN VAR_VALUE_TAB ) Return Varchar2;
    End WF_NOTIFICATIONS_PKG;
    Create OR Replace Package Body WF_NOTIFICATIONS_PKG Is
       Function GENERIC_WF( P_MSG_TYPE IN Varchar2
                          , P_CDCS_NBR IN Varchar2
                          , P_CDCS_SEQ IN Varchar2
                          , P_DEBTORID IN Number
                          , P_EXTRAS   IN VAR_VALUE_TAB ) Return Varchar2 Is
       Begin
          Return ( P_EXTRAS(P_EXTRAS.First).var || ' - ' || P_EXTRAS(P_EXTRAS.First).Value );
       End GENERIC_WF;
    End WF_NOTIFICATIONS_PKG;
    SQL> Declare
      2     v_value_Tab WF_NOTIFICATIONS_PKG.VAR_VALUE_TAB;
      3     v_return    Varchar2(100);
      4  Begin
      5     v_value_Tab(1).var   := 'this is a test 1';
      6     v_value_Tab(1).value := 'this is a test 2';
      7 
      8     v_return := WF_NOTIFICATIONS_PKG.GENERIC_WF( 'Manual Debt Establish Notification'
      9                                                , '2009A13636'
    10                                                , '001'
    11                                                , 105195359
    12                                                , v_value_Tab );
    13 
    14     Dbms_Output.put_line(v_return);
    15  End;
    16  /
    this is a test 1 - this is a test 2
    PL/SQL procedure successfully completedRegards,
    Christian Balz

  • Error while calling a function.

    Hi,
    below is my callable statement through which am calling a function which returns the service years of a person with personid as parameter.
    But dont know why am getting an error which is returning the serviceyrs as 0.
    when i try to debug, the problem is in this statement
    System.out.println("the output1 is "+cs.getInt(1));
    is there any problem with my code.
    please look the code below
    thanks
    kumar
    OADBTransaction txn=getOADBTransaction();
    OracleCallableStatement cs = (OracleCallableStatement) txn.createCallableStatement("begin :1:=LMIG_UTILITY_PKG.GET_TOTAL_SERVICE(p_person_id => :2); end;",1);
    try
    cs.registerOutParameter(1,Types.INTEGER);
    cs.setInt(2,Integer.parseInt(pid));
    System.out.println("person id is "+pid);
    System.out.println("the output1 is "+cs.getInt(1));
    cs.execute();
    serviceyrs= cs.getInt(1);
    cs.close();
    catch(SQLException sqle)
    System.out.println("ERROR"+sqle.toString());
    System.out.println("Service years are "+serviceyrs);

    Hi, Guess u are missing the connection to the JDBC call.
    Try the following...it worked for me..
    Connection conn = this.getOADBTransaction().getJdbcConnection();
    OracleCallableStatement ocs = null;
    String param = null;
    try {       
         String stmt = "BEGIN :1 := <PkgName>.<FunctionName>(:2); end;";
         ocs = (OracleCallableStatement)conn.prepareCall(stmt);
         ocs.registerOutParameter(1, OracleTypes.CHAR);
         ocs.setString(2, <param>);
         ocs.execute();
         param = ocs.getString(1);
    } catch(SQLException se)
    {       throw OAException.wrapperException(se);    
    finally
         try {               
              ocs.close();
              return(param);
         } catch(Exception e)
              throw OAException.wrapperException(e);
    }

  • INTERNAL_SERVER_ERROR    while Calling SCMS_HTTP_CREATE Function Module

    Dear All,
    We want to attach document (PDF, DOCX, TXT etc.) in DMS using WD application.
    We converted data xstring to binary format. Now when we call Function Module SCMS_HTTP_CREATE, it gives SY-SUBRC = 5. INTERNAL_SERVER_ERROR.
    Code:
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(IV_ARCHIV_ID) TYPE  TOAOM-ARCHIV_ID
    *"     VALUE(IV_AR_OBJECT) TYPE  TOAOM-AR_OBJECT
    *"     VALUE(IV_OBJECT_ID) TYPE  SAPB-SAPOBJID
    *"     VALUE(IV_SAP_OBJECT) TYPE  TOAOM-SAP_OBJECT
    *"     VALUE(IV_LENGTH) TYPE  I
    *"     VALUE(IV_MIMETYPE) TYPE  STRING
    *"     VALUE(IT_DATA) TYPE  ZTAB
    *"  EXPORTING
    *"     VALUE(EV_FLAG) TYPE  CHAR1
    *"     VALUE(EV_DOC_ID) TYPE  SAEARDOID
    DATA : LV_ARC_DOC TYPE SYSUUID-C,
            LV_MIMETYPE TYPE W3CONTTYPE,
            LV_ARCDOC TYPE TOAV0-ARC_DOC_ID.
    CALL FUNCTION 'SYSTEM_UUID_C_CREATE'
      IMPORTING
        UUID          = LV_ARC_DOC.
    CALL FUNCTION 'SCMS_FE_GROUP_OPEN'.
    LV_MIMETYPE = IV_MIMETYPE.
    CALL FUNCTION 'SCMS_HTTP_CREATE'
       EXPORTING
        MANDT                       = SY-MANDT
         CREP_ID                     = IV_ARCHIV_ID
        DOC_ID                      = LV_ARC_DOC
        COMP_ID                     = 'data'
        MIMETYPE                    = LV_MIMETYPE
         LENGTH                      = IV_LENGTH
    *   SIGNATURE                   = 'X'
    *   DOC_PROT                    = 'rcud'
    *   TEXT_MODE                   = ' '
    *   ACCESSMODE                  = 'c'
    *   SECURITY                    = ' '
    *   OVERWRITE                   = '-'
    * IMPORTING
    *   DOC_ID_OUT                  =
       TABLES
         DATA                        = IT_DATA
      EXCEPTIONS
        BAD_REQUEST                 = 1
        UNAUTHORIZED                = 2
        FORBIDDEN                   = 3
        CONFLICT                    = 4
        INTERNAL_SERVER_ERROR       = 5
        ERROR_HTTP                  = 6
        ERROR_URL                   = 7
        ERROR_SIGNATURE             = 8
        ERROR_PARAMETER             = 9
        OTHERS                      = 10
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'SCMS_FE_GROUP_CLOSE'
    LV_ARCDOC = LV_ARC_DOC.
    CALL FUNCTION 'ARCHIV_CONNECTION_INSERT'
       EXPORTING
        ARCHIV_ID                    = IV_ARCHIV_ID
         ARC_DOC_ID                  = LV_ARCDOC
    *   AR_DATE                     = ' '
         AR_OBJECT                   = IV_AR_OBJECT
    *   DEL_DATE                    = ' '
    *   MANDANT                     = ' '
         OBJECT_ID                   = IV_OBJECT_ID
         SAP_OBJECT                  = IV_SAP_OBJECT
    *   DOC_TYPE                    = ' '
    *   BARCODE                     = ' '
      EXCEPTIONS
        ERROR_CONNECTIONTABLE       = 1
        OTHERS                      = 2
    IF SY-SUBRC <> 0.
    ** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    While Calling FM 'SCMS_HTTP_CREATE' is Raise Exception 5 INTERNAL_SERVER_ERROR.
    Thanks
    Regards
    Rohit      

    Hi,
    Content-Type: application/xml
    ...check for the content type of the message that is sent ot the WS.....with the above mentioned content-type going to the WS currently...WS is not able to parse the req and hence the error....in other words wrong format being being passed.
    Regards,
    ABhishek.

  • Invalid column type error while calling db function.

    We are getting an exception while calling the database function which returns a Varray of objects. We are using jpub to generate the wrapper method, ran sqlj to generate the JDBC code. The environment is weblogic 5.1 EJB container with ORacle 8.1.6.0.0 database. The JDBC driver is 8.1.7 thin, sqlj version is 8.1.7. I am giving below the exception.
    When the sqlj option profile=false is not set, the error is Classcast exception. Appraently the weblogic connection object can not be used to do oracle specific calls. If somebody has done similar things(creating a bean which calls the stored function with weblogic which returns the oracle object types) or know what the issue is, please let me know.
    Thanks,
    Vijay.
    stackTrace:
    java.sql.SQLException: Invalid column type
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at java.sql.SQLException.<init>(SQLException.java:43)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:273)
    at oracle.jdbc.driver.OracleStatement.get_internal_type(OracleStatement.java:4560)
    at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:225)
    at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:350)
    at weblogic.jdbcbase.pool.Statement.registerOutParameter(Statement.java:438)
    at sqlj.runtime.profile.ref.RTStatementJDBCCallable.registerOutParameter(RTStatementJDBCCallable.java:135)
    at sqlj.runtime.profile.ref.ParamRegProfile$ParamRegCachedStatement.registerParameters(Compiled Code)
    at sqlj.runtime.profile.ref.ParamRegProfile$ParamRegCachedStatement.getStatement(ParamRegProfile.java:101)
    at sqlj.runtime.profile.ref.CachedStatementProfileWrapper.getStatement(CachedStatementProfileWrapper.java:134)
    at sqlj.runtime.ExecutionContext$StatementStack.setStatement(ExecutionContext.java:995)
    at sqlj.runtime.ExecutionContext.registerStatement(ExecutionContext.java:523)
    at com.xpede.calculator.processor.jdbc.NewPrdGroupPkg.maincalculator(NewPrdGroupPkg.java:341)
    ----------------------

    Weblogic essentially wrappers the Oracle JDBC driver - as you can see from the stack trace, it does not just wrapper the connection object, but also the statement object.
    The SQLJ runtime does not recognize the JDBC layer anymore as an Oracle JDBC driver.
    What is happening at runtime may be the following:
    (1) The invalid column type likely results from SQLJ attempting to register the type as Types.OTHER (code 1111). This typecode is not supported by Oracle JDBC.
    (2) The class cast exception when using Oracle objects may result from a getObject() call which returns the value in default format (such as oracle.sql.ARRAY) rather than the JPublisher-generated wrapper object.
    Are you using JDK 1.2 / runtime12.zip?
    In that case you can try the standard (java.sql.)SQLData interface (in JPub: -usertypes=jdbc). However, this interface will not support wrappers for VARRAYs.

  • PInvoke - Issue while calling DJVU function from C# Code - Attempted to read or write protected memory

    Hi,
    I know there are many questions in this subject but none of them help to resolve the issue I am currently facing.
    Below is the signature of C Function from DJVULibre added in .NET code
    [DllImport("C:\\Program Files\\DJVULIBRE\\LIBDJVULIBRE.dll", CharSet=CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
    private unsafe static extern int ddjvu_page_render(IntPtr page, ddjvu_render_mode_t mode, IntPtr pagerect,
    IntPtr renderrect,
    IntPtr pixelformat,
    ulong rowsize,
    [Out][MarshalAs(UnmanagedType.LPArray)]byte[] imagebuffer);Below is how I am calling this function in the c# codebyte* buffer = (byte *)Memory.Alloc(nSize);
    try
    IntPtr ptr1 = (IntPtr)Memory.Alloc(Marshal.SizeOf(prect));
    Marshal.StructureToPtr(prect, ptr1, false);
    IntPtr ptr2 = (IntPtr)Memory.Alloc(Marshal.SizeOf(rrect));
    Marshal.StructureToPtr(rrect, ptr2, false);
    byte[] array = new byte[nSize];
    fixed (byte* p = array) Memory.Copy(buffer, p, nSize);
    ddjvu_page_render(page, ddjvu_render_mode_t.DDJVU_RENDER_MASKONLY, ptr1, ptr2, fmt, (ulong)stride, array);
    finally
    Memory.Free(buffer);
    }call to ddjvu_page_render in above code is throwing "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
    Prior to this post I must have tried all the option could find in various blogs.
    Appreciate any help, is almost a day I am clueless, your timely help could save my job

    Thanks Viorel, below is the definition of original C function
    DDJVUAPI int
    ddjvu_page_render(ddjvu_page_t *page,
    const ddjvu_render_mode_t mode,
    const ddjvu_rect_t *pagerect,
    const ddjvu_rect_t *renderrect,
    const ddjvu_format_t *pixelformat,
    unsigned long rowsize,
    char *imagebuffer );below is how the code is calling this function in C#, the in pointers are all valid pointer I checked in debugging window byte* buffer = (byte *)Memory.Alloc(nSize);
    try
    IntPtr ptr1 = (IntPtr)Memory.Alloc(Marshal.SizeOf(prect));
    Marshal.StructureToPtr(prect, ptr1, false);
    IntPtr ptr2 = (IntPtr)Memory.Alloc(Marshal.SizeOf(rrect));
    Marshal.StructureToPtr(rrect, ptr2, false);
    byte[] array = new byte[nSize];
    fixed (byte* p = array) Memory.Copy(buffer, p, nSize);
    ddjvu_page_render(page, ddjvu_render_mode_t.DDJVU_RENDER_MASKONLY, ptr1, ptr2, fmt, (ulong)stride, array);
    finally
    Memory.Free(buffer);

  • How to pass dynamic parameter to a database function in OBIEE

    Hi,
    I have a requirement like this. I have to create one report in OBIEE which was in Discoverer. Now in discoverer report there are some calculated item in the worksheet based on database pkg.functions. The parameter which user gives at run time that parameters are then passed to the discoverer calculated items dynamically. But I am not able to do this in OBIEE answers.
    Can anyone tell me step by step how I can able to pass the user selected parameter values in OBIEE answer level.
    The example:
    GET_COMM_VALUE_PTD("AFE Cost & Commitment".Afe Id,:"Period Name(AFE)","AFE Cost & Commitment".Data Sel,"AFE Cost & Commitment".Org Id)
    GET_COMM_VALUE_PTD --- Function database
    ("AFE Cost & Commitment".Afe Id,:"Period Name(AFE)","AFE Cost & Commitment".Data Sel,"AFE Cost & Commitment".Org Id --- Parameters... :"Period Name(AFE)" is the dynamic parameter selected run time by user.
    Please help.
    Thanks
    Titas

    Hi,
    I already did that. But the existing discoverer re value report is showing correct value but the OBIEE report with EVALUATE function shows incorrect value.
    The requirement is to create a OBIEE Dashboard from a Discoverer existing report. Now in discoverer report theere are several calculated items in worksheet level where database custom function is used and user selected parameter value is passed run time in that function. But when that is created in OBIEE with EVALUATE function in RPD, the report shows incorrect data. Could not understand how to pass the parameter value runtime.
    Below is the discoverer 'Show SQL' query and EVALUATE function syntax which has been used.
    SELECT APPS.XXBG_PL_PROJ_ANALYSIS_AFE_PKG.GET_COMM_VALUE_PTD(XXBG_PL_PROJ_AFE_V.AFE_ID,
    :"Period Name(AFE)",
    XXBG_PL_PROJ_AFE_V.DATA_SEL,
    XXBG_PL_PROJ_AFE_V.ORG_ID),
    XXBG_PL_PROJ_AFE_V.AFE_DESC,
    XXBG_PL_PROJ_AFE_V.AFE_NUMBER,
    XXBG_PL_PROJ_AFE_V.APPROVED_AFE_AMOUNT
    FROM APPS.PA_PERIODS_ALL PA_PERIODS_ALL,
    APPS.XXBG_PL_PROJ_AFE_V XXBG_PL_PROJ_AFE_V
    WHERE ((XXBG_PL_PROJ_AFE_V.ORG_ID = PA_PERIODS_ALL.ORG_ID))
    AND (XXBG_PL_PROJ_AFE_V.DATA_SEL = :"Data Selection(AFE)")
    AND (PA_PERIODS_ALL.PERIOD_NAME = :"Period Name(AFE)")
    AND (XXBG_PL_PROJ_AFE_V.AFE_NUMBER = :"AFE Number(AFE)")
    AND (XXBG_PL_PROJ_AFE_V.OPERATING_UNIT = :"Operating Unit(AFE)")
    The EVALUATE function syntax is as below:
    EVALUATE('XXBG_PL_PROJ_ANALYSIS_AFE_PKG.GET_COMM_VALUE_PTD(%1,%2,%3,%4)' AS FLOAT , "BG PL Project Analysis Report_1"."AFE Cost & Commitment"."AFE Cost & Commitment.Afe Id", "BG PL Project Analysis Report_1"."Periods 1"."Periods 1.Period Name", "BG PL Project Analysis Report_1"."AFE Cost & Commitment"."AFE Cost & Commitment.Data Sel", "BG PL Project Analysis Report_1"."AFE Cost & Commitment"."AFE Cost & Commitment.Org Id")
    The PERIOD needs to be passed at run time which user will select.
    Please help to solve the issue.

  • How to use "Esc" key to call a function in scripting

    I mean when I'm executing a script,if I want break a loop, I can just press the "Esc" key.I think this is very handly.But I also want to call a function when "Esc" is pressed,is this possible, and how can I do this?

    Taken from Peter Kahrel's UI guide.
    http://www.kahrel.plus.com/indesign/scriptui-2-0.pdf
    So escape could be captured by if(myWindow.show()==2){do stuff }?
    the user clicks OK (which in this script corresponds to pressing Enter) or they can click
    Cancel (which is the equivalent of pressing Escape). The window's behaviour is
    this: if the user presses OK, the line myWindow.show ( ) returns 1, if they press
    Esc, that line returns 2. We capture this as follows:
    if (myWindow.show () == 1)
    var myName = myText.text;
    else
    exit ();

  • Ora-06502 while calling oracle function

    I am using 9.2.0.4.0 database.
    I have vb.net application that uses oracle provider for .net to connect to database.
    I am calling Oracle function which returns varchar2 value back.
    when i execute cmd2.ExecuteNonQuery, I get ora-06502 error.
    CREATE OR REPLACE FUNCTION ZZZ_TEMP( p_val IN VARCHAR2) RETURN varchar2
    AS
    BEGIN
    RETURN 'HELLO';
    EXCEPTION WHEN OTHERS THEN
    RETURN SQLCODE||' - '||SUBSTR(SQLERRM,1,100);
    END;
    ************** vb.net code
    Dim cmd2 As New Oracle.DataAccess.Client.OracleCommand(UserSchemaName & ".ZZZ_TEMP", con)
    Dim VAL As String
    Try
    cmd2.Parameters.Add("RetVal", Oracle.DataAccess.Client.OracleDbType.Varchar2, ParameterDirection.ReturnValue)
    cmd2.Parameters.Add("p_val", Oracle.DataAccess.Client.OracleDbType.Varchar2, ParameterDirection.Input).Value = "XYZ"
    cmd2.Connection = con
    cmd2.CommandType = CommandType.StoredProcedure
    cmd2.ExecuteNonQuery()
    VAL = cmd2.Parameters("RetVal").Value
    Catch ex As Oracle.DataAccess.Client.OracleException
    MsgBox(ex.Message)
    End Try

    If I change this function to retrun number rather than Varchar2 and change my
    RetVal parameter as follow it works. I am noticing that there might be a bug when function returns varchar2
    cmd2.Parameters.Add("RetVal", Oracle.DataAccess.Client.OracleDbType.int32, ParameterDirection.ReturnValue)
    cmd2.Parameters.Add("p_Val", Oracle.DataAccess.Client.OracleDbType.int32, ParameterDirection.Input).valu ="XYZ"

  • CNTL_ERROR while calling a function module from Java webdynpro

    I am calling a RFC function module from javawebdynpro app
    which inturn calls a function module performing BDC on CAPP transaction. When I run this from SE37 of the same system or a different system everything works fine. But when called from Java webdynpro app, it raises a CNTL_ERROR exception and creates a short dump.
    Any help on this is highly appreciated

    Good catch, BI Learner. This was exactly it: when assigning the values from SOURCEFIELDS directly to the import/export parameters, you have to make sure that the types are EXACTLY the same, otherwise it will not work (the routine stops with an error when calling the FM, but there is no dump).
    Therefore, to solve my problem, I created the declarations precisely as expected by the FM and assigned the values to these fields:
    DATA:
          SOURCEVAL TYPE  /BIC/OIINVQTY,
          SOURCEUOM TYPE  /BIC/OIUSUOM,
          USITM TYPE  /BIC/OIUSITM,
          TARGETUOM TYPE  /BIC/OIUSUOM,
          CONVERTED_COST TYPE  /BIC/OIINVQTY.
    DATA PRODUCTION_UOM TYPE /BIC/OIUSUOM.
    " get the Production UOM
        SELECT SINGLE I~/BIC/USPRDUOM
          FROM /BIC/PUSITM AS I
          INTO PRODUCTION_UOM
          WHERE I~/BIC/USITM = SOURCE_FIELDS-/BIC/USITM AND I~OBJVERS = 'A'.
        IF ( SY-SUBRC = 4 ). " no records found
          "RAISE PARTNO_NOT_FOUND.
          RAISE EXCEPTION TYPE CX_RSROUT_SKIP_RECORD.
        ENDIF.
    " load the parameters
        SOURCEVAL = SOURCE_FIELDS-/BIC/USFRZMFC.
        SOURCEUOM = SOURCE_FIELDS-BASE_UOM.
        USITM = SOURCE_FIELDS-/BIC/USITM.
    " then you can call the FM
        CALL FUNCTION 'Z_CA_CONVERT_US_COST'
          EXPORTING
            PSOURCEVAL                = SOURCEVAL
            PSOURCEUOM                = SOURCEUOM
            PUSITM                    = USITM
            PTARGETUOM                = PRODUCTION_UOM
          IMPORTING
            PTARGETVAL                = CONVERTED_COST
          EXCEPTIONS
            CONVERSION_NOT_MAINTAINED = 1
            PARTNO_NOT_FOUND          = 2
            OTHERS                    = 3.
    " ... [do the rest]
    Thanks for your help,
    Dennis

  • Error while calling the function which returns SQL Query!!!

    Hi,
    I have a Function which returns SQL query. I am calling this function in my APEX report region source.
    The query is dynamic SQL and its size varies based on the dynamic "where clause" condition.
    But I am not able to execute this function.It gives me the following error in APEX region source.
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    Even in SQL* Plus or SQL developer also same error .
    The length of my query is more than 4000. I tried changing the variable size which holds my query in the function.
    Earlier it was
    l_query varchar2(4000)
    Now I changed to
    l_query varchar2(32767).
    Still it is throwing the same error.
    Can anybody help me to resolve this.???
    Thanks
    Alaka

    Hi Varad,
    I am already using 32k of varchar2. Then also it is not working.
    It is giving the same error. I think there is something to do with buffer size.
    My query size is not more than 4200. Even if i give 32k of varchar2 also buffer is able to hold only 3997 size of the query only.
    Error is
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    Tried CLOB also. It is not working.
    Any other solution for this.
    Thanks
    Alaka

  • Passing a parameter while calling a web dynpro application on portal

    hi
    I am having a web dynpro application which retrieves data from R/3 system via RFC using Jco destinations define in the Portal.
    Now we have different kinds of portals running on the same WAS, now I want the application to run which access data from different R/3 systems thru different JCo destinations.
    I need to create a logic such that mu application runs fine on any portal with any Jco destination.
    Is there any provision to achieve this.
    kindly let me know about this.
    Thanks and regards
    kris

    Gopi,
    there's an parameter called "sap-wd-arfc-useSys" you can pass to the application, to change the used JCo-Connection (read more at http://help.sap.com/saphelp_erp2005/helpdata/en/f4/651741f163f023e10000000a155106/frameset.htm)
    so, if you're running the WD-aaplication on <b>one</b> WAS and call it from different portals, you have to create three (or six with the META-connections) JCo-Connection on your WD-WAS.
    In a WD-application you can access URL-Parameters with:
    WDWebContextAdapter.getWebContextAdapter().getRequestParameter("<your URL Parameter-Name>");
    kr, achim

Maybe you are looking for

  • Mail attachment problem after service pack upgrade from 11 to 17 ECC 6.0

    Dear All, My mailing programs have started sending .dat file instead of .xls file. Earlier it used to go properly in .xls format. I'm using SO_NEW_DOCUMENT_ATT_SEND_API1 fm for mailing. Thanks. Edited by: User on Mar 7, 2011 12:37 PM

  • "This game cannot be played" Texas Hold'Em

    I have found a lot of questions on this - but no responses. I've even tried deleting it and re-purchasing it, which also gave the same error. I've played this before on my iPod, but I think one of the newer games has corrupted something. I have a mod

  • Can I use multiple store.connect( ) in my code?

    I have a mail server installed on my local comp and have created multiple users. Now I need to poll the folders of each of those users for mails and read the mails. The code is working fine for a single user but when I increase the number or users, i

  • How can I create the effect in this photo?

    I'd like to know how to create the orange and grey coloring on this photo.  I have Photoshop CS6. Any help would be appreciated. I have been playing around to no avail. Thanks in advance.

  • How can I sync my iphone and icloud both ways?

    I am able to update my phone calander thru icloud on the computer but when I put things in my calander on the phone they do not update on icloud, can anyone help with this?