Variable argument not working

someone tell why this not working
class Init
     public void assign(String... args)
          for(Object str:args)
               System.out.println(str);
public class VarArg1
     public static void main(String args[])
          Init abc=new Init();
          abc.assign("asdfasd","sdfas","asdfa","adfas");
          abc.assign(2,'c',"asdfa",5.333);//can send different types as i am recieving it with an object array.
}

someone tell why this not working
class Init
     public void assign(String... args)
          for(Object str:args)
               System.out.println(str);
public class VarArg1
     public static void main(String args[])
          Init abc=new Init();
          abc.assign("asdfasd","sdfas","asdfa","adfas");
abc.assign(2,'c',"asdfa",5.333);//can send
nd different types as i am recieving it with an
object array.
}You can not send it types other than Strings.. you declare the method as "public void assign(String... args)" .. the method is expecting to be passd Strings. If you changed it to "public void assign(Object... args)" then you could pass it other stuff. However, I don't think I'd recommend that approach to programming. It'd work, but you'd eventually get some weird output as every Object's toString() method was invoked that you sent to it. (and as we all know, they're not always standardized)

Similar Messages

  • Variable Text not working as dynamic header in Crystal report

    Dear Experts,
    I'm working Crystal report that connected to Query BEX SAP BW trough SAP integration kit,
    currently i have case that need report dynamic header using variable text from BEX query, but seem the variable text not working in Crystal reports. the header in Crystal report shown as Desription\technical name, not result from the variable text in Query BEX in SAP.
    In https://wiki.sdn.sap.com/wiki/display/BOBJ/Crystal%20Reports%20and%20BW%20query%20elements stated that the "Text variable" with "replacement path" is supported, but i don't know in my query is not working.
    i already set in Database -> options->  table and fields -> Show Both, but the text variable still not working.
    can you help me
    Crystal Reports 2008 12.2.0.290
    SAP Integration KIT 12.1.0.890
    Thanks
    Luqman

    Post your question BEX and B1 and classic SAP data source issues to the Integration Kit forum

  • SELECT INTO ( variable ) STATEMENTS NOT WORKING FOR SYBASE TABLE AS VIEW

    Dear Experts,
    We have connected our 9i db with Sybase db using Hs connectivity.
    and then we have create the view in oracle db for SYBASE_TABLE as SYBASE_TABLE_VIEW.
    ALL THE INSERT, UPDATE AND DELETE COMMANDS ARE WORKING BUT THE
    select Into (variable) is not working.
    Please help to resolve the select into statment which is in BOLD in the below routine
    PLEASE NOTE! FORM WAS COMPILED SUCCESSFULLY AND FORM IS RUNNING BUT SELECT INTO COMMAND IS NOT WORKING.
    Thanks & Regards
    Eidy
    PROCEDURE SRBL_INSERT IS
    CURSOR SRBL IS
         SELECT impno,impcod,impnam
         from oracle_table1 a, oracle_table2 b
         WHERE a.impcod=b.empcod
         v_srpcod varchar2(5);
    BEGIN     
    FOR rec in SRBL loop     
         begin
    select "im_code" into v_impcod                    
         from SYBASE_TABLE_VIEW
         where "im_code"=rec.impcod;
    exception when no_data_found then
         v_srpcod:=null;
    end;
    END LOOP;
    END;
    Edited by: Eidy on Aug 16, 2010 11:28 AM

    hellow
    try this.
    select "im_code" into v_impcod
    from SYBASE_TABLE_VIEW
    where "im_code"=rec.impcod;
    v_srpcod := v_impcod ;
    ........

  • Customer Ext Variable is NOT working correctly in the Restricted Key Figure

    Hi all,
       I have created a variable ZVCBLMTH (Period from 01/1996 to Last Month) with reference to
        0CALMONTH  and it will be populated through  Customer Exit and it works fine.
        In the selection for 0CALMONTH, I gave the range as '05/2008' to '08/2008' and this new
        variable  passed the value of  range as '01/1996' to '04/2008' in RSRT.
        The properties of the variable are:
              Type of Variable -  Characteristic, Processing by - Customer Exit, Variable Represents - Interval
              and Variable is - Optional.
              No change in the result after changing the 'Variable is' from Optional to 'Mandatory'.
      This variable is used in Restricted Key Figure to calculate the number of matching records between
       01/1996 & 04/2008 and somehow it is not recognizing this variable and NOT passing the results correctly.
       But, there are records with 0CALMONTH between 01/1996 & 04/2008.   
       How could I test that which value is passed into the Restricted Key Figure for this variable, PLEASE ?
       Thanks in advance.
    Regards,
    Venkat.

    Hi Clemens Li
    I agreed on your point. When we define the Internal table the type for element EQUNR & QUMNR , we are referring the SAP data element for EQUNR, QMNUM field.
    Our doubt is even though we refer the standard data element, in the ALV display, it shows with leading zeros and also it creates problems in the filtering and in the filter window all values instead of unique nos.
    Hi Abhii
    I have given below the fieldcat coding.
    Friends, can you kindly clarify the above said problems. Since we use SAP ECC 6.0 any notes or patches apply is required. ( this is the basic functionality in ALV, that is my doubt).
        wls_fieldcat-col_pos   = wpv_pos.
        wls_fieldcat-fieldname = wpv_champ.
        wls_fieldcat-tabname   = wlc_tabname.
      wls_fieldcat-seltext_s = wls_fieldcat-seltext_m
        wls_fieldcat-seltext_l = wpv_libelle.
        wls_fieldcat-ddictxt   = 'L'.
        wls_fieldcat-no_out    = wv_no_out.
        APPEND wls_fieldcat TO gt_fieldcat.
    Kind regards,
    Jegathees P.

  • Variable Substitution not working when using ABAP mapping

    Hi all,
    I am doing an IDoc to File scenario.
    Due to some complex mapping requirements, i had to use ABAP mapping for IDoc to File ( IDoc : SHPMNT05)
    There is also one more requirement where in i need to generate the receiver filename dynamically
    i.e the filename is of the form :     
        GW-XYZ-DD/MM/YYYY.csv
    Where
    XYZ is the Shipment number (E1EDT20- TKNUM)
    DD/MM/YYYY is the IDOC creation date in ECC (EDIDC-CREDAT)
    so i used the variable substitution option in receiver file adapter.
    But its not working.
    Is there any limitation for using the variable Substitution, doesnt variable substitution work in case of ABAP mapping?
    Regards,
    Loveena.

    Hi,
      u written ABAP mapping program to get the file name in the required format ,
    is it rt?
    when u test it at message mapping(including ABAP map program)
    u get the the required format of file name in the one of target filed.
    if that was fine, please check the variable substituiton parameters at receiver file adapter.
    i mean, are u maintain variable name and refernece.
    u have to specify the payload information.
    warm regards
    mahesh.

  • Variable is not working

    HI Experts,
    can any one suggest me on this issue . When i enter 0Material variable range selction the data is not retriving .the data has there in 0material master data. if enter other range like date with out giving materila the data is displaying . i checked user defined variable and customized variable its not displaying . but the same variable it working in quality system and its problem in production system so any one suggest me on this issue.
    Regards
    Rk

    Hi,
    Thank you very much for your reply . User has been raised some other requirement . here 6 variables containg  and out of 2 are mandtory.  if the user enter  the  one of the optional slection screen and 2 mandatory variable also be optional. if the user is not entring the optional the 2 remains mandtory  here same variable act like optional and mandatory. if it is possible In please let me know.
    Regards
    Rk

  • Flex Time with variable tempo not working correctly.

    Hey,
    Has anyone else noticed that Flex Time doesn't work as intended if you have variable tempo?
    To clarify, I recorded a band playing their song and then figured out their various natural tempo changes and adjusted the Global Tempo Track accordingly.
    Then, the drummer recorded his part to a click on that track, obviously keeping with the natural tempo changes that the band played to.
    Quantization of MIDI works just fine, as in, it matches the increases and decreases in tempo.
    However, attempting to quantize an audio track using Flex Time does not work properly.
    I was just wondering if there is something that I'm doing wrong or if this is a known bug.
    Thanks,
    William

    Thank you for your answers!
    But there are several Problems using a dummy field in an IDOC structure. We have got a naming convension so that we can't create an IDOC-like structure named ORDRSP.ORDERS05.
    But perhaps I am thinking to complex and there is an easier way to add a dummy field to an IDOC structure.
    Could you perhaps also suggest a solution for that dummy field problem?
    Many thanks and kind regards,
    Steven

  • Flash Variable is not working in Ipad

    Hi Experts,
    I'm facing with an issue, could you please suggest me your valuable suggestions.
    I have created Two dashboard (Example names A1 and B1), I need to open the dashboard B1 without asking credentials, when I select an Image in A1.
    To work in such a way, I have created a flash variable and pointed the range to cell J1.
    I have placed a URL button on top of image in Dashboard A1. I have copied following URL in a cell, and this URL I have pointed to URL Button.
    URL= (="../../../Xcelsius/opendoc/documentDownload?iDocID=M1TVABCADjs2AHoAlg123AAgoBpgwAAAA&sIDType=CUID&CELogonToken="&J1)
    Opening B1 dashboard from A1 is working fine in desktop and in Android tab, but it is not working in Ipad. Not working in Ipad in the sense a new browser window is opening with empty page.
    I have tested in another way like, passing opendocID and Flash variable to the URL button, It is working fine in Ipad but asking for the credentials.
    Experts could you please suggest me some solution.
    Ipad is Ipad2 and BO Version is 4.1 SP4.
    Thanks & Regards
    Karthik M

    Hello,
    You hyave to use the special flash variable "CELogonToken"
    Would request you to check http://scn.sap.com/docs/DOC-36362   this is a SCN document
    with title "Step by step way to create parent child dashboard in BI 4.0/4.1 using flash variable".
    SWF loader is not supported for mobile.
    Best regards,
    Mohamed AISSA.

  • Shared variable does not work in executable

    In editor mode, the shared variables update fine.  When I build the executable, the shared variables no longer work.
    See attachment.
    Attachments:
    TestCitadel.vi ‏30 KB

    I found this note in the LV2010 help, I wonder if this could be related to your problem...
    Note  You can use scaling only for network-published
    shared variables, I/O variables, or I/O aliases. When the shared
    variable you want to scale is a network-published shared variable, it
    must have a data source. Configure a network-published shared variable
    to have a data source by placing a checkmark in the Enable Aliasing checkbox on the Variable page of the Shared Variable Properties dialog box.

  • Shared variable does not work between two computers

    I am using LabVIEW 8 on Windows XP computers.
    1. On one computer I have created two projects, writeProject and readProject.
    2.  In the writeProject I have a shared variable, writeData, which is "network-published" double. In this project I have a writeData.vi which in while loop assigns a random value to the writeData variable.
    3. In the readProject I have a shared variable, readData, which is "network-published" double and is bound to the writeData variable.  This is on the same computer as the writeProject.
    4. I run both the writeData.vi and the readData.vi and all works fine.
    5. Now, I create a readProject on a diferent computer.  Perform all the steps as described above and also in tools/shared variable/register computer, I have entered the IP address of the target computer on which the writeData shared variable exists.
    6. Binding the readData variable fails in the following way.  When I browse for the source, in the "Select Source Item" dialog, I see <IP> <Populating Node...>, where <IP> is the IP address of the source computer (on which exists the writeData shared variable).  A very long time later it is still "Populating Node...".  Neddless to say, this readData.vi does not work!
    What am I doing wrong?  Or, perhapse what else do I need to do to make it work?

    Hi,
    I would suggest checking out the two KnowledgeBases I have linked below for common issues with Network Shared Variables. Let me know the results. Thanks!
    Troubleshooting Network-Published Shared Variables
    Why Are My Network Shared Variables Taking Very Long to Initialize?
    Stephanie

  • Security filter with variable does not work correctly

    Helo,
    I have one table with this columns (called BI_USERS):
    USERBI | REGIONS
    XXXX 10,5 -> In this case the user XXX can access the region 10 and 5
    AAA 9,7
    I use this table to apply the security filters. Fisrt I did a initialization block with the select: SELECT USERBI, REGIONS FROM BI_USERS WHERE USER = :USER
    This select populate two variables: variable USER (system variable) and UserRegion (Non-system variable)
    After I use the UserRegion variable in the securty filter of the one group of users. For exemple:
    Name | Status | Business Model Filter
    "Claro"."Historico Saldo Pre-Pago" Enabled "Claro"."Historico Saldo Pre-Pago"."DW_UN_NEG" In(VALUEOF(NQ_SESSION.*UserRegional)* )
    But the issue is that the query is not working, because the query created for BIServer no use the IN operator. Seems the IN operator is changed for equal (=).
    And the query returs error because the value 10,5 (for example) is not a numeric value.
    Anybody could help me, please? I am using the version 10.1.3
    Mauricio

    |||\/||| wrote:
    Helo,
    I have one table with this columns (called BI_USERS):
    USERBI | REGIONS
    XXXX 10,5 -> In this case the user XXX can access the region 10 and 5
    AAA 9,7
    I use this table to apply the security filters. Fisrt I did a initialization block with the select: SELECT USERBI, REGIONS FROM BI_USERS WHERE USER = :USER
    This select populate two variables: variable USER (system variable) and UserRegion (Non-system variable)
    After I use the UserRegion variable in the securty filter of the one group of users. For exemple:
    Name | Status | Business Model Filter
    "Claro"."Historico Saldo Pre-Pago" Enabled "Claro"."Historico Saldo Pre-Pago"."DW_UN_NEG" In(VALUEOF(NQ_SESSION.*UserRegional)* )
    But the issue is that the query is not working, because the query created for BIServer no use the IN operator. Seems the IN operator is changed for equal (=).
    And the query returs error because the value 10,5 (for example) is not a numeric value.
    Anybody could help me, please? I am using the version 10.1.3
    MauricioHi Mauricio,
    First of all you have some syntax errors with your init block:
    select USERBI, REGIONS from BI_USERS WHERE upper(USER)=upper(':USER');
    Couple things to consider here:
    1) Why are you selecting Userbi column from the table? Is USER system session variable not getting populated through other souces like LDAP or default security?
    Ans: If your user session variable is getting populated from a different init block, then you dont need to select that column. Then your init block would look something like this:
    select 'USERREGIONAL', REGIONS from BI_USERS WHERE upper(USER)=upper(':USER'); - Data Source
    Row Wise Initialization - Data Target
    Initblock that is populating the user session variable as the order of precedence.
    2) If you dont have USER session variable populating from any other source, then your init block would look something like below:
    select 'USER', USERBI, "USERREGIONAL', REGIONS from BI_USERS; - Data source
    Row Wise Initialization - Data target
    After following one of the above two steps, you need to apply the filters on the table.
    "Claro"."Historico Saldo Pre-Pago"."DW_UN_NEG" IN(VALUEOF(NQ_SESSION.USERREGIONAL))
    Note: Make sure you understand that variables are case sensitive.
    Please award points as this is correct answer.
    Thanks,
    -Amith.
    Edited by: Amith on May 10, 2011 3:18 PM

  • Function to get session variable is not working

    I created a report based on the following sql query:
    SELECT EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO FROM SCOTT.EMP
    WHERE DEPTNO = empcust.current_deptno
    empcust.current_deptno is a function which returns the value of the session variable. However, nothing gets returned. The value of the session variable is not found.
    I know that the session variable is being set b/c i have a procedure that sets it and prints out the assigned.
    This is my code for the current_deptno function. If anyone can help, i'd greatly appreciate it!
    procedure current_deptno
    return VARCHAR2
    as
    v_Session portal.wwsto_api_session;
    v_Return VARCHAR2(20); --DEPT.DEPTNO%TYPE;
    begin
    v_Session := portal.wwsto_api_session.load_session('PORTAL','SESS_EMP');
    v_Return := v_Session.get_attribute_as_varchar2('DEPTNO');
    htp.p('Return session var'||v_Return);
    RETURN(v_Return);
    end;

    Hi Imtiaz,
    Could you verify that the variable has indeed a value? You could check via the Session Manager in the Admin Tool. You could also check the Query Log to verify whether the Initialization Block is working like expected.
    Thanks.
    Daan Bakboord
    http://obibb.wordpress.com

  • Repost Function using Variable is not working

    Hello experts!  I am on BW-BPS 3.5.  I have set up a repost function using variables to change a characteristic value for Business Unit.
    1. I created 2 variables as Bus.Unit From and Bus.Unit To in the Planning Area. I am not using the variables in my planning level.
    2. I entered the variables in the parameter group New Values area for the From and To Values.
    3. My goal is when the user executes the Repost Function for a Variable Prompt should appear and have the user select the From Business Unit and To Business Unit.
    The Variables are set up as USERVALUE User-Defined Values, Restriction of Values required by user and I have tried with/without option of Input Allowed by User. 
    Can you tell me what I am doing wrong, I expected a variable prompt when executing the Repost Function but it does not work.
    Thank you,
    Teri

    Ravi, Thank you for your reply however I contiue to have errors or the execution does not repost (change any value) as noted below.
    1. I have 2 Variables in Planning area var1 (from) var2 (to) for the same charateristic which is Business Unit
    2. Business Unit is in the level,  on the selection tab to add the variable I can only add 1 variable, So I added var1 (from) to the level. 
    3. Parameter group for old and new values - I have Var1 (from), var2 (to)
    4. Report Function - are you referring to Reporting variables in BPS? I have set this up as suggested in the "How to Use Reporting Variable in BW-BPS" document.
    5. Enter plan data: I receive prompt for VAR1, mandatory. At this point there is no value in Var2.
    6. Execute Repost function - I receive an error to "Restrict Var2"
    7. If I set variable values and add a value for Var2 I receive an error "The generated data is not contained in the selection condition".
    Next I removed VAR1 from my planning level and turned on the option 'Selection in package' for Business Unit. This seems to work well.
    What do you recommend?
    Thank you,
    Teri

  • Dynamic ORACLE_HOME in env variable PATH  not working

    Hi,
    We have an issue whereby we want the PATH to be dyanmic with respect to the ORACLE_HOME.
    Have implemented the solution in 'ORA-12557: TNS:Protocol Adapter Not Loadable' While Running OUI [ID 735400.1 but not working.
    We have Windows 2008 R2 server with Oracle 11.2.0.3 client installed.
    First when did set to check environment varibales, fouND no env. variable for ORACLE_HOME even though in registry so have set ORACLE_HOME as user env variable.
    Have changed system env variable PATH to have  %ORACLE_HOME%\bin; at very start
    when do PATH to check value shows
    literally as %ORACLE_HOME%\bin at start rather than translating to the real physical location as it does with other logical variables.
    How can we ensure translates the ORACLE_HOME correctly so PATH is O.K.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    user5716448 wrote:
    Hi,
    We have an issue whereby we want the PATH to be dyanmic with respect to the ORACLE_HOME.
    Have implemented the solution in 'ORA-12557: TNS:Protocol Adapter Not Loadable' While Running OUI [ID 735400.1 but not working.
    We have Windows 2008 R2 server with Oracle 11.2.0.3 client installed.
    First when did set to check environment varibales, fouND no env. variable for ORACLE_HOME even though in registry so have set ORACLE_HOME as user env variable.
    Have changed system env variable PATH to have  %ORACLE_HOME%\bin; at very start
    when do PATH to check value shows
    literally as %ORACLE_HOME%\bin at start rather than translating to the real physical location as it does with other logical variables.
    How can we ensure translates the ORACLE_HOME correctly so PATH is O.K.
    open Command Window & issue command belowecho %ORACLE_HOME%COPY  the results, then PASTE all back here                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Web URL - Variable input not working

    Hi There,
    I have got following URL for one of my web application -
    http://cccbwde1.xxx.com:8120/sap/bw/BEx?sap-language=EN&CMD=LDOC&INFOCUBE=ZSC_O01&QUERY=QZSC_O01_5002_TEST
    and it works fine. It has got a few variables and as parameter passing I would like to pass on default value to variable.
    Say one of the variable used is S_plant and supply default value 6011 to it, my new URL looks like
    http://cccbwde1.xxx:8120/sap/bw/BEx?sap-
    language=EN&CMD=LDOC&INFOCUBE=ZSC_O01&QUERY=QZSC_O01_5002_TEST*&VARIABLE_SCREEN=X&
    var_name_1=S_PLANT&var_value_ext_1=6011*
    problem I am facing is that it does not show and default value while displaying variable entry screen. Please suggest.
    Regards
    Vikash
    Split the URL for easier display
    Edited by: Arun Varadarajan on Feb 20, 2009 10:45 AM
    Edited by: Arun Varadarajan on Feb 20, 2009 10:46 AM

    Hi Vikash,
    there is a possibility to modify WAD applications by using parameters to call Web applications ([SAP Help|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/43/ef05462480025ae10000000a1553f7/content.htm]). Just tried it with
    a dummy query on our system and it works for queries which are executed directly from Query Designer as well.
    Just give it a try like this extension:
    &BI_COMMAND_1-BI_COMMAND_TYPE=SET_VARIABLES_STATE
    &BI_COMMAND_1-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE_TYPE=VARIABLE_INPUT_STRING
    &BI_COMMAND_1-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE_TYPE-VARIABLE_INPUT_STRING=
    [variable_value]
    &BI_COMMAND_1-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE=[variable_name]
    Your link in total should be like this (if I have not done an error; please also complete the xxx):
    http://cccbwde1.xxx:8120/sap/bw/BEx?sap-
    language=EN&CMD=LDOC&INFOCUBE=ZSC_O01&QUERY=QZSC_O01_5002_TEST&VARIABLE_SCREEN=X&
    BI_COMMAND_1-BI_COMMAND_TYPE=SET_VARIABLES_STATE&BI_COMMAND_1-VARIABLE_VALUES-
    VARIABLE_VALUE_1-VARIABLE_TYPE=VARIABLE_INPUT_STRING&BI_COMMAND_1-VARIABLE_VALUES-
    VARIABLE_VALUE_1-VARIABLE_TYPE-VARIABLE_INPUT_STRING=6011&BI_COMMAND_1-VARIABLE_VALUES-
    VARIABLE_VALUE_1-VARIABLE=S_plant
    If it is not working just let me know.
    Brgds,
    Marcel
    Split the URL for want of seeing the post in whole!!
    Edited by: Arun Varadarajan on Feb 20, 2009 10:44 AM
    Edited by: Arun Varadarajan on Feb 20, 2009 10:46 AM

Maybe you are looking for

  • Saving query view in a internal table

    Hello Experts, Is there anyway that we can trasfer all the query results to a table. What I am exactly looking is I want to transfer a query view to an internal table so that our destop team using java will then read the results from tables and conve

  • Choppy playback

    Hi there! I hope someone can help me. My project is creating a visual song. There is of course an audio track playing. My problem is that it is very choppy and whenever it cuts out it throws the whole movie off. Not only that, but when the movie is s

  • Where can we learn more about the next version of FB?

    The Air 3.4 release notes say that a new version of Flash Builder, now in beta, will be released in August. Is there any place where we can read about the new features and pricing?

  • Using Mbox 2 with Adobe CS6 on Windows 8

    Is this possible?  If so can you tell me where to find the drivers?

  • "Import Flex Project" Menu Disappear [FB 4.6]

    Hi All, I am not sure what's going wrong here but I'm not able to see "Import Flex Project" menu item under File Menu. Can any one knows how to get it back ? Thanks Mac