Optional Parameter in Java.

Hi all,
I am new to java programming... I just wanted to know if we can have Optional parameter in java?. I searched few threads but not found any good result. Few suggested a overloaded method ,i think if it is not provided then there must be a big reason for that. Please let me know if anybody knows exact reason why it is not provied. I am using ver 1.4
~Amod .

class A{
     String a;
     String b;
     String c;
     public A(String a, String b, String c){
          this.a=a;
          this.b=b;
          this.c=c;
     public A(String a, String b){
          this.a=a;
          this.b=b;
          //String c will get a default value when this constructors get called
     public static void main(String args[]){
          A test = new A("a","b","c");
          System.out.println(test.a);
          System.out.println(test.b);
          System.out.println(test.c);
          System.out.println("-------");
          A test_ = new A("a","b");
          System.out.println(test_.a);
          System.out.println(test_.b);
          System.out.println(test_.c);
}Is that what you want?

Similar Messages

  • Java Exception:The relationship ID is not an optional parameter

    Hi Experts,
    We are in SRM-MDM Catalog 3.0.
    When we click a item's short description in catalog search result list to open the item detail, the new screen opened with a internal server error. And the error summary is "java.lang.NullPointerException: The relationship ID is not an optional parameter." I have validated the XML mapping, I can not find any fields which were used for the "relationship ID".
    The SAP notefound in a forum is for SRM MDM Catalog 3.0 SP02 but we are using SRM MDM Catalog 3.0 SP09.Can anyone
    please advise.
    Below is error
    500 Internal Server Error
    SAP NetWeaver Application Server 7.00/Java AS 7.00
    Failed to process request. Please contact your system administrator.
    Hide
    Error Summary
    While processing the current request, an exception occured which could not be handled by the application or the framework.
    If the information contained on this page doesn't help you to find and correct the cause of the problem, please contact your system administrator. To facilitate analysis of the problem, keep a copy of this error page. Hint: Most browsers allow to select all content, copy it and then paste it into an empty document (e.g. email or simple text file).
    Root Cause
    The initial exception that caused the request to fail, was:
    java.lang.NullPointerException: The relationship ID is not an optional parameter. at com.sap.mdm.data.commands.RetrieveRelationshipsCommand.execute(RetrieveRelationshipsCommand.java:91)
    at com.sap.mdm.extension.data.commands.RetrieveRelationshipsExCommand.execute(RetrieveRelationshipsExCommand.java:43)
    at com.sap.srm.mdm.Model.getRelationships(Model.java:3510)
    at com.sap.srm.mdm.Model.updateRecordRelationships(Model.java:3683)
    at com.sap.mdm.srmcat.uiprod.ItemDetails.displayFixedItemDetails(ItemDetails.java:6047)
    ... 34 more
    Regards
    Sunil

    Hi Sunil,
    when we upgrade the MDM system we also need to upgrade the java components .
    Only the Internal Catalogs use the name searches / masks which are stored in the MDM system .
    Please re check the Java Component upgrade . May be a few of the componenets are not upgraded properly .
    Let me know your finidings .
    Regards,
    Vignesh

  • Optional Parameter in ODSI

    Hi,
    I have to create a Optional Parameter in ODSI function as given following :
    xquery version "1.0" encoding "UTF-8";
    (::pragma xds <x:xds targetType="urn:AddressInfo" xmlns:x="urn:annotations.ld.bea.com" xmlns:urn="http://www.wcbsask.com/employeerCoverage/AddressInfo"><creationDate>2010-10-15T15:19:40</creationDate><userDefinedView/></x:xds> ::)
    declare namespace wbt= "ld:Physical/CBC";
    import schema namespace ns1="http://www.abc.com/employeerCoverage/AddressInfo" at "ld:Logical/AddressInfo/schemas/AddressInfo.xsd";
    declare namespace tns="ld:Logical/AddressInfo/SampleOptional";
    (::pragma function <f:function kind="read" visibility="public" isPrimary="true" xmlns:f="urn:annotations.ld.bea.com"/>::)
    declare function tns:getSampleOptional($formNum as xs:string,$optinalInput as xs:integer?) as element(ns1:AddressInfo)?{
    for $cbc in wbt:CBC()
    where $formNum eq $cbc/FORM_NUM
    return
    <ns1:AddressInfo>
    if(exists($optinalInput))then
    <ns1:regNum>{fn:data($CBC/FORM_NUM)}</ns1:regNum>
    else(
    <ns1:cusNumber>{fn:data($optinalInput)}</ns1:cusNumber>
    </ns1:AddressInfo>
    when i am passing the form number as some value and OptionalInput as null(since the parameter is optional). I am getting error as
    com.bea.dsp.das.exception.DASException: weblogic.xml.query.exceptions.XQueryDynamicException: {err}XP0021: "": can not cast to {http://www.w3.org/2001/XMLSchema}integer: error: decimal: Invalid decimal value: expected at least one digit
         at com.bea.dsp.das.ejb.EJBClient.invokeOperation(EJBClient.java:160)
         at com.bea.dsp.das.DataAccessServiceImpl.invokeOperation(DataAccessServiceImpl.java:171)
         at com.bea.dsp.das.DataAccessServiceImpl.invoke(DataAccessServiceImpl.java:122)
         at com.bea.dsp.ide.xquery.views.test.QueryExecutor.invokeFunctionOrProcedure(QueryExecutor.java:113)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.getFunctionExecutionResult(XQueryTestView.java:1041)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.executeFunction(XQueryTestView.java:1176)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.widgetSelectedImpl(XQueryTestView.java:1866)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.access$300(XQueryTestView.java:174)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent$3.run(XQueryTestView.java:1594)
         at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.widgetSelectedBusy(XQueryTestView.java:1597)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.widgetSelected(XQueryTestView.java:1560)
         at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227)
         at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
         at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
         at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3687)
         at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3298)
         at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
         at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
         at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
         at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
         at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
         at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
         at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
         at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
         at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169)
         at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
         at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
         at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
         at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508)
         at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
         at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
         at org.eclipse.equinox.launcher.Main.eclipse_main(Main.java:1148)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.m7.installer.util.NitroxMain$1.run(NitroxMain.java:33)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
    Kindly help in the issue.
    Regards,
    Tara

    "when i am passing ... and OptionalInput as null"
    What does that mean exactly? From the exception, it looks like you are just leaving the text box blank. For 'null' you have to check the 'null' check-box beside it.

  • CR 2008 - Optional parameter prompts

    Hi!
    I sometimes use Optional parameter prompts in Crystal Reports 2008.
    The main reason is to minimise user input in Selection Criteria Screen.
    I have many subreports, and not all prompts are needed for all subreports.
    If the user leaves the prompt blank, then a formula will set a default value for the user.
    I usually put the optional prompt at the top, so that user needs only fill prompts at the bottom.
    Here is an example:
    I have a parameter field called "PreferredSortOrder"
    The Edit screen reads as follows:
    Type: String
    List of Values: Static
    Value:
        Original Order
        Description
    Value Options:
    Show on (Viewer) Panel           : Read Only
    Prompt Text                              : Preferred Sort Order [Optional]
    Prompt With Description Only  : True
    Optional Prompt                        : True
    Default Value                             :
    Allow custom values                 : False
    Allow multiple values                 : False
    Allow discrete values                 : True
    Allow range values                     : False
    Min Length                                  :
    Max Length                                  :
    Edit Mask                                   :
    Show value or Description        : Show Value
    My report works perfectly, even if I leave the parameter field blank
    I now add another parameter field called "WhichWarehouse"
    with exactly the same values as above.
    When I run the Crystal Report, I get this message;
    Error running Crystal Reports
    The report runs only if I type a value in the "WhichWarehouse" prompt
    (The "PreferredSortOrder" prompt remains blank)
    I did exactly the same as before. Why does the 2nd optional parameter not work like the first?
    What has gone wrong?
    Thank you
    Leon Lai
    JUST ADDED
    I just noticed that in the Field Explorer,
    (a) There is a green TICK near the parameter PreferredSortOrder
    (b) But no green Tick neat the parameter "WhichWarehouse"
    What does the green tick mean?
    Could this be the key to the mystery?

    Hi Leon,
    No green tick means that the prompt has Not been used in the report.
    If the report has Subreports, and if the subreport also has a 'warehouse' prompt then it could be this prompt that is causing the issue. You should link both the warehouse prompts to make sure you're only prompted once.
    -Abhilash

  • Missing Parameter Values CR2008 Optional Parameter

    Hi,
    I am getting "Missing Parameter Values" error
    "CrystalDecisions.CrystalReports.Engine.ParameterFieldCurrentValueException: Fehlende Parameterwerte. ---> System.Runtime.InteropServices.COMException (0x8004100E)"
    if I try to export a Report with an optional Parameter without setting the parametervalue.
    The Report works fine with ReportViewer.
    If I uncomment the "Parameterpart" and set a parametervalue it works fine, but it should works without a parametervalue too, its optional.
    I have tried many for a long time and read many Websites but it does not work !
    I use WinXP SP2 CR2008 with C# .NET 2.0 VS2005
    CrystalDecisions.CrystalReports.Engine.dll version 12.0.2000.683 Date: 2008-03-01
    CrystalDecisions.Shared.dll version 12.0.2000.683 Date: 2008-03-01
    Sorry my English is very Bad !
    Thanks a lot!
    ExportFormatType ExportType = ExportFormatType.PortableDocFormat;
                ReportDocument RD = new ReportDocument();
                RD.Load("C:\\ParaTest01.rpt");
                string strServer = "<ServerName>";
                string strDB = "<DBName>";
                string strUser = "<UserID>";
                string strPW = "<PW>";
                RD.SetDatabaseLogon(strUser, strPW, strServer, strDB);
                //ParameterFieldDefinitions crParameterFieldDefinitions = RD.DataDefinition.ParameterFields;
                //ParameterFieldDefinition crParameter1 = crParameterFieldDefinitions[0];
                //ParameterValues crParameter1Values = crParameter1.CurrentValues;
                //ParameterDiscreteValue crDiscrete1Value = new ParameterDiscreteValue();
                //crDiscrete1Value.Value = "GER";
                //crParameter1Values.Add(crDiscrete1Value);
                //crParameter1.ApplyCurrentValues(crParameter1Values);
                RD.ExportToDisk(ExportType, "C:\\Test2.pdf");
    RecordSelectionFormula in Report:
    (not HasValue({?Land}) OR {tab.location_code} = {?Land}) and
    {tab.sup} = "XXX" and
    {tab.Accounting_Period} = "200801"

    You need to be careful when using optional parameters. If you are using the optional parameter in a record selection formula you'll need to check and make sure it has a value before you use it. There is a function call HasValue() that you can use to do this.
    If you have an optional parameter in the record selection formula and you don't pass a value you'll need to make sure your selection formula can be completed with out it.
    This is an excerpt from our help file.
    Crystal Reports supports optional parameters. An optional parameter is a prompted value that does not have to be supplied by the user.
    Report designers should provide some guidance to the end user that a parameter is optional by adding this information to the prompt text.
    Optional parameters are treated by Crystal Reports as optional anywhere within the report that they are used. You cannot set one instance of the parameter to optional and another to mandatory.
    Note: After you set a parameter to optional, if you use the Select Expert, the system will automatically add the selection formula for you using the HasValue() function.
    The Formula Workshop Editor does not automatically add the formula. Only the Select Expert automatically adds the formula for you.
    If you change the parameter from optional to mandatory, the HasValue() function is not automatically removed from your formula.
    Handling a parameter with no value
    When the report engine evaluates any formula which references an optional parameter that does not have a value, it generates a runtime error. All formulas that reference an optional parameter should first use the HasValue() function to check if that parameter has a value before evaluating it. This includes record selection formulas and saved data formulas.
    Note: The system will not automatically drop a statement from the SQL WHERE clause. It is the report designeru2019s responsibility to decide which statement to leave out based on HasValue() testing.

  • How to set no_value to Optional parameter in XI 3.0 by OpenDoc URL linking

    I found in "BusinessObjects XI 3.0 Viewing reports and documents using URLs Howto.doc"
    "You can remove an optional parameter from the prompt by setting it to no_value in the OpenDocument query string."
    I tested: response.sendRedirect("/OpenDocument/opendoc/openDocument.jsp?sIDType=CUID&iDocID=AaVxpKuKNBxKnHUJCqwuRi0&lsSCountry=""no_value""&token=" + logonToken);
    But it will filter no data, because no country call "no_value". I still need to delete the value, and click Apply, to get all data.
    I wonder how to achieve optional parameter via opendocument linking, to get a report with "full data set".
    Any one can help?
    Thanks in advance!
    Jennie

    Hi Jennie,
    I'm wondering if "1203675 - Cannot specify an empty string for an optional string parameter through the refresh prompts page which displays "no value" unlike the parameter panel" is related to this.
    Instead of using no value or empty string, how about if you use ALL value for the parameter to bring full data? Check "1218621 - Option "All" in list of values for a dynamic prompt in XI"
    Hitomi

  • Optional Parameter - Oracle Package Throws an Error

    Hi there,
    I have an Oracle Package & it has a stored procedure with optional parameter. The calling code is in ColdFusion.
    When I run my webpage the Oracle throws below error.
    " [Macromedia][Oracle JDBC Driver][Oracle]ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'GET_CONTRACT_BY_DYN_SQL' ORA-06550: line 1, column 7: PL/SQL: Statement ignored "
    Calling Code (ColdFusion)
    <cfstoredproc procedure="CONTRACTS_PKG.GET_CONTRACT_BY_DYN_SQL" datasource="#REQUEST.dsn#">
         <cfprocparam cfsqltype="CF_SQL_INTEGER" type="in" value="1" variable="P_CONTRACTID">     
         <cfprocresult name="qDataDynSQL" resultset="1">
    </cfstoredproc>
    <br>Dynamic SQL Query:
    <cfdump var="#qDataDynSQL#" label="Dynamic SQL Query">
    Oracle Package
    create or replace
    PACKAGE CONTRACTS_PKG AS
    TYPE T_CURSOR IS REF CURSOR;
    PROCEDURE GET_CONTRACT_BY_DYN_SQL(P_CONTRACTID IN NUMBER, P_COLS IN VARCHAR2 DEFAULT '*', IO_CURSOR IN OUT T_CURSOR);
    END CONTRACTS_PKG;
    create or replace
    PACKAGE BODY CONTRACTS_PKG AS
    -- Get Contract Using Dynamic SQL
    PROCEDURE GET_CONTRACT_BY_DYN_SQL(P_CONTRACTID IN NUMBER, P_COLS IN VARCHAR2 DEFAULT '*', IO_CURSOR IN OUT T_CURSOR)
    IS
    V_CURSOR T_CURSOR;
    V_SQL VARCHAR2(200);
    BEGIN
    IF p_contractid > 0 THEN
    V_SQL := 'SELECT '|| P_COLS || ' FROM CONTRACTS WHERE contract_id = ' || P_CONTRACTID ;
    ELSE
    V_SQL := 'SELECT '|| P_COLS || ' FROM CONTRACTS';
    END IF;
    OPEN V_CURSOR FOR V_SQL;
    IO_CURSOR := V_CURSOR;
    END GET_CONTRACT_BY_DYN_SQL;
    END CONTRACTS_PKG;
    Does anyone knows why it throws an error? As you can see in the package header & body the parameter P_COLS has the default value as '*'.
    Looking forward to hear from someone.
    Thanks,
    Hitesh Patel

    931198 wrote:
    I have an Oracle Package & it has a stored procedure with optional parameter. The calling code is in ColdFusion.
    When I run my webpage the Oracle throws below error.Never mind the error - your approach is most definitely a candidate for Oracle WTF.
    Nothing sane about this approach. Especially the decision not to use bind variables and slowing down cursor processing significantly by burning a lot more CPU cycles on hard parsing and fragmenting the SQL Shared Pool in the process.
    Why not used MS Access instead? It is far more suited as a mickey mouse database for a goofy application?
    Why am I badmouthing your approach to Oracle? Because that is exactly the primary cause, the #1 reason, for poor Oracle performance and run-time problems dealing with Shared Pool fragmentation. It is something that many Oracle experts blog about, talk about, write about. It is addressed in numerous books, Oracle documentation, and even Oracle Support Notes.
    And despite the amount of information available on how to get the basics rights in using Oracle... this approach you are pursuing still refuses to die. So it deserves to be beaten with a lead pipe when it rears its ugly head here in this forum..

  • How to use offset for select-option parameter ?

    Hi experts
    could anybody please let me know how to use offset for select-option parameter. i can able to use offset for table fields, variabiles and all , but don't know how to use for parameters.
    following is my code
    SELECT-OPTIONS: s_prctr  FOR vbsegs-prctr OBLIGATORY.
    here "prctr"  length is 10.
    i'm using two tables  1. vbsegd-bupla
                                    2. vbsegs-prctr
    here prctr+6(4) = bupla.
    "Bupla" length is 4
    SELECT belnr gjahr bukrs bupla sgtxt buzei FROM vbsegd INTO CORRESPONDING FIELDS OF TABLE it_vbsegd FOR ALL ENTRIES IN it_vbkpf
                                                                 WHERE belnr = it_vbkpf-belnr
                                                                   AND gjahr = it_vbkpf-gjahr
                                                                   AND bukrs = it_vbkpf-bukrs
                                                                   AND bupla IN s_prctr.  
    the above statement is not working as prctr and bupla lenths are different. here i want to use offset.
    SELECT belnr gjahr bukrs prctr sgtxt buzei FROM vbsegs INTO CORRESPONDING FIELDS OF TABLE it_vbsegs FOR ALL ENTRIES IN it_vbkpf
                                                                WHERE belnr = it_vbkpf-belnr
                                                                  AND gjahr = it_vbkpf-gjahr
                                                                  AND bukrs = it_vbkpf-bukrs
                                                                  AND prctr IN s_prctr.
    this is working as prctr and s_prctr lengths are equal.
    could anybody please help me out in this.
    Thanks in advance.
    regards
    satish

    Below code will work for you.
    SELECT-OPTIONS: s_prctr  FOR vbsegs-prctr OBLIGATORY.
    RANGES: s_bupla FOR vbsegd-bupla.
    s_bupla[] = s_prctr[].
    DELETE ADJACENT DUPLICATES FROM s_bupla.
    SELECT belnr gjahr bukrs bupla sgtxt buzei FROM vbsegd INTO CORRESPONDING FIELDS OF TABLE it_vbsegd FOR ALL ENTRIES IN it_vbkpf
                                                                  WHERE belnr = it_vbkpf-belnr
                                                                    AND gjahr = it_vbkpf-gjahr
                                                                    AND bukrs = it_vbkpf-bukrs
                                                                    AND bupla IN s_bupla.

  • Passing select option parameter to a procedure

    Hello, i need to know pass a select option parameter to a procedure. I tried the following
    For eg if i have a select option called so_belnr & i call the procedure using the following
    PERFORM VALIDATE_DOCUMENT TABLES SO_BELNR USING GJAHR BUKRS  , i still cannot use the
    select option paramter in the called procedure.
    Pls help.

    Hi,
    in topinclude...
    data: lr_belnr type RNG_BELNR.
    at start-of-sel.....
    move so to range..
    refresh: lr_belnr.
    lr_belnr[] = so_belnr[].
    PERFORM VALIDATE_DOCUMENT TABLES lr_belnr USING GJAHR BUKRS .
    in form:
    ...   tables lr_belnr like structure of RNG_BELNR.
    reason(my definietion): perfom doesn´t know if the select-options is availible.....
    bestreg
    Robert

  • Passing optional parameter to subreport

    Hi,
    I am having a CR 2008 report based on BW query.  The query has optional parameter (the value can be set to NULL).  When I try to use this report as subreport in my main report, I am unable to pass Null(equivalent to set to NULL) to my subreport using subreport link.  I tried blank and "" in a formula field and try to link it to the subreport parameter but it doesn't work.  Kindly guide me in this regard.
    Thanks and Regards,
    Subbu S

    Hi Subbu,
    Try to create a formula and pass the formula value to your sub report parameter and in sub report record selection based on main report formula value try to filter the records.
    Ex: Main report create the following formula :
    Whileprintingrecords;
    Shared Stringvar x;
    If not hasvalue({?Optional}) then
    x:='No Value'
    else
    x:={?Optional}
    Now link this to your sub report parameter
    In sub report record selection
    If {?parameter} = 'No Value ' then true else {?Parameter} =  FieldValue.
    Thanks,
    Sastry

  • Optional Parameter without a value

    Hi, I'm using Discoverer 10g.
    Somebody knows what is passed when an optional parameter (a parameter which doesn't require a user to enter a value) is left without a value ?
    I didn't understand actually if is passed NULL, 'NULL', '',' '...
    I need to know it because I need to wrap this "value" in order to pass it to a function on the DB.
    The user have to be the possibility to write something or leave it without a value.
    Thanks
    Alessandro

    Hi,
    While running the Discoverer Report, just leave the parameter as blank.
    Discoverer passes it as NULL to execute the query.
    In the function, where you are passing this parameter, use NVL() to defualt the NULL value. If you want to pass "this value" manually into function, you can still leave it as blank and NVL will take care of it.
    Hope this helps!
    Yogini

  • Optional parameter workaround  -  dates problem

    Hi
    I use  optional parameter workaround  and it's fine.
    but how I should use it with dates parameter or numbers ?
    SAP note 1500777. This describes a workaround :
    ((not HasValue({?itemcode@select itemcode from OITM })
    or isNULL({?itemcode@select itemcode from OITM })
    or {?itemcode@select itemcode from OITM } = '')
    OR {OITM.ItemCode} = {?itemcode@select itemcode from OITM })
    Regards
    Idan

    Hi,
    Optional parameter is not supported.
    What I did was, I have 2 date parameter. pmDateFrom and pmDateTo.
    In Crystal report record selection, OINV.DocDate in pmDateFrom to pmDateTo.
    When running within SAP B1 8.8, if I want to include every dates, I put in a date in pmDateFrom (eg: 1/1/00) and do not enter anthing for pmDateTo.
    That seems to work.

  • OPTIONAL PARAMETER WITH NO VALUE SELECTED

    I have an optional parameter and I want to place the selected value in the Page Header.  Since the selected value is a number, I want to give it a name.  The problem I am having is when I don't select a value, my naming forumula doesn't work.  I tried the HasValue function, but I don't think I'm using it properly.
    // This did not work
    IF {?SUPPLIER}= 10001 THEN "NESTLE PRODUCTS ONLY" ELSE
    IF {?SUPPLIER}= 10005 THEN "UNILEVER PRODUCTS ONLY" ELSE
    "ALL PRODUCTS"
    // This did not work
    If (not hasvalue){?SUPPLIER} then "ALL PRODUCTS" ELSE
    IF {?SUPPLIER}= 10001 THEN "NESTLE PRODUCTS ONLY" ELSE
    IF {?SUPPLIER}= 10005 THEN "UNILEVER PRODUCTS ONLY" ELSE
    "NESTLE AND UNILEVER PRODUCTS ONLY"
    Got any suggestions?

    Hi,
    Well if you select multiple values in a parameter and drag the parameter or the formula containing the parameter, then it would always display the first selected value.
    Here's a dirty way:
    If NOT(HasValue({?SUPPLIER})) then "ALL PRODUCTS" ELSE IF
    ubound({?SUPPLIER}) = 1 then
            IF {?SUPPLIER}= 10001 THEN "NESTLE PRODUCTS ONLY" ELSE
            IF {?SUPPLIER}= 10005 THEN "UNILEVER PRODUCTS ONLY" ELSE
            "NESTLE AND UNILEVER PRODUCTS ONLY"
    ELSE IF
    ubound({?SUPPLIER}) = 2 then
    "NESTLE AND UNILEVER PRODUCTS ONLY"
    Let me know how this goes!
    -Abhilash

  • Optional parameter

    hi
    if anybody knows how to use optional parameter in oracle stored procedure,
    pls help me
    regards
    joshy

    Take a look to Default Values for Subprogram Parameters
    Nicolas.

  • Optional parameter, no values

    Hi,
    I have an optional parameter in CR2008; I would like to print the choosen parameter values into the report header. This works great by using this function:
    Join({?MyParameter},", ")
    However, when no values were selected I get the error message "Parameter has no value".
    So I adapted the function:
    if hasvalue({?MyParameter}) then Join({?MyParameter},", ") else "All records"
    The function is correct but I still get the error message (error dialog window).
    How can I suppress the error message?
    Thanks!

    Ian,
    Tip of the day: You can show the &lt;&gt; signs in the forum by using & lt; and & gt;. Just remove the spaces after the &.
    It also works in code blocks...
    {@Field} &lt;&gt; 123
    Jason

Maybe you are looking for

  • My iphone4 Safari won't let me sign into any websites (email, school, commercial).  What can I do to fix this?

    My iphone4 Safari won't let me sign into any websites (email, school, commercial).  What can I do to fix this?

  • JDBC Sender Channel polling before polling interval is complete

    Hi all, On our Production Server, we have found that a few JDBC Sender Channels are polling multiple times within one polling interval. Eg: Suppose for one channel, the polling interval is 7200 secs. It polls once and the polling interval starts. But

  • File Writting / Logging

    I want it so that when a user logs in incorrectly, the action is logged to a file. Is there a way to specify the name of the file to log to, and what contents should be logged? I looked at the log() function, but can I change the directy it logs too

  • Task list creation

    Experts I have an error message when I create a task list for an equipment. I have configured the number range for task list. Object ROUTING_E number range 01 does not exist Message no. CV711 venkat

  • Problem with album 2

    I have been using Photoshop Album 2.0 on my old computer Windows XP SP3. My new computer is Vista 32bit. I have installed Photoshop Album 2.0 on the new computer. I used Easy Transfer to copy the Catalog to the new computer. When I open Album the cat