VS2013 x64 p/invoke issue with C++ functions returning float or double values to C#

I originally posted this on the Windows Insiders forum, but I was directed to either TechNet or MSDN as this was deemed too technical. 
I do understand that Windows 10 is still in preview mode, and VS2013 doesn't officially support it yet, but I just wanted to make a note of this, and ensure it gets fixed  :)  
The issue:
I ran across what appears to be a .Net bug in Windows 10.  This issue does NOT appear when using either Windows 7 or Windows 8 Enterprise.  This also does NOT appear when running an x86 build.  This is an x64 specific issue, and occurs in
both release and debug configurations. 
If you have a C++ function that looks like this:
double GetValueDouble()
  return 555.555;
And on the C# side:
[DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
public static extern double GetDoubleValue();
static class Program
  static int Main(string[] args)
    double val = GetDoubleValue();
    Console.WriteLine("val = {0}", val);
I'd expect the output to be:
val = 555.555
But I actually get something like this:
val = -2.0608193755203536E+262
This has been reproduced on two different machines, both running Windows 10. 
Is this a known bug?  I searched the forums, but didn't find anything relevant.

I can repro, but only running under the VS2015 preview debugger. Running the console app directly gives the 555.555 value:
C:\scratch\DoubleRepro\ConsoleMain\bin\x64\Debug>dir
 Volume in drive C has no label.
 Volume Serial Number is C285-B76C
 Directory of C:\scratch\DoubleRepro\ConsoleMain\bin\x64\Debug
02/18/2015  06:42 PM    <DIR>          .
02/18/2015  06:42 PM    <DIR>          ..
02/18/2015  06:45 PM             4,096 ConsoleMain.exe
02/18/2015  06:37 PM               187 ConsoleMain.exe.config
02/18/2015  06:45 PM            11,776 ConsoleMain.pdb
02/18/2015  06:41 PM            45,568 CPP_DLL.dll
               4 File(s)         61,627 bytes
               2 Dir(s)  89,595,490,304 bytes free
C:\scratch\DoubleRepro\ConsoleMain\bin\x64\Debug>ConsoleMain.exe
val = 555.555
C:\scratch\DoubleRepro\ConsoleMain\bin\x64\Debug>dumpbin cpp_dll.dll /headers
Microsoft (R) COFF/PE Dumper Version 11.00.60610.1
Copyright (C) Microsoft Corporation.  All rights reserved.
Dump of file cpp_dll.dll
PE signature found
File Type: DLL
FILE HEADER VALUES
            8664 machine (x64)
               8 number of sections
        54E54D6A time date stamp Wed Feb 18 18:41:46 2015
               0 file pointer to symbol table
               0 number of symbols
              F0 size of optional header
            2022 characteristics
                   Executable
                   Application can handle large (>2GB) addresses
                   DLL
How about yourself? Does it repro outside of the VS debugger?

Similar Messages

  • Issue with Submit and Return in passing string/values of longer length.

    Hi,
    I have a FM which has to submit a report as a job.
    I am required to send a string( length could be close to 1024 characters or more than that) to the report as the parameter.
    I am using Submit with Return.
    1.When I pass my string as parameters, in the report it gets truncated at 60 chars.( though i have defined the parameter of type char1024)I lose the data.
    2.When I split my string(aflter logical splitting the lenght is still equal to about 200 chars) and then pass as select options it gets truncated at 45 chars in the report ( though i have defined the parameter of type char1024)and i lose my data.
    3.I cannot use Export/Import as I found that it does not work with jobs.
    Please let me know how can i sumbit the report as a job while passing it a string of length 1024 characters.
    Regards,
    Sulakshana
    Edited by: Sulakshana Shinde on May 21, 2009 2:44 PM

    Option 3 should work, unless you are not using the EXPORT/IMPORT correctly.  I believe that you are going across work processes, which means you may need to use the shared buffer or shared memory when using the export/import statements.  
    Something like this.
    Data: lv_value type string.
    lv_value = 'SomeValue'.
    EXPORT lv_value = lv_value
           TO SHARED BUFFER INDX(ST) ID 'SomeUnigueKey'.
    See this.
    http://help.sap.com/abapdocu/en/ABAPEXPORT_DATA_CLUSTER_MEDIUM.htm
    Regards,
    Rich Heilman

  • Issue with gui_download function module

    Hi All,
             I have an issue with gui_download function module that it is creating one extra line while downloading my internal table data into text file,which i donot want.i have searched for various threads but couldnot get the proper reply.Or please provide me some other Function Module which will not create one extra line.Please help.

    part 2
    INCLUDE RPPPXD00.
    DATA : BEGIN OF COMMON PART A.
    INCLUDE RPPPXD10.
    DATA : END OF COMMON PART.
    INCLUDE PC2RXTW0.
    INCLUDE RPC2RX00.
    DATA : BEGIN OF COMMON PART B.
    INCLUDE RPC2CD00.
    DATA : END OF COMMON PART.
    INCLUDE RPPPXM00.
    INCLUDE RPCMGR00.
    AT SELECTION-SCREEN OUTPUT.
      CONCATENATE SY-DATUM2(6) SY-UZEIT0(4) INTO REF_NO.
      LOOP AT SCREEN.
        IF R1 = 'X'.
          IF SCREEN-NAME = 'FLN' OR SCREEN-NAME = '%_FLN_%_APP_%-TEXT' OR
             SCREEN-NAME = 'BTC'  OR SCREEN-NAME = '%_BTC_%_APP_%-TEXT' OR
            SCREEN-NAME = 'PY_DT' OR SCREEN-NAME = '%_PY_DT_%_APP_%-TEXT'"SOC BY ANKITA"
           OR SCREEN-NAME = 'ORG_ID' OR SCREEN-NAME = '%_ORG_ID_%_APP_%-TEXT'
           OR SCREEN-NAME = 'ORG_AC' OR SCREEN-NAME = '%_ORG_AC_%_APP_%-TEXT'
           OR SCREEN-NAME = 'DEPT_CD' OR SCREEN-NAME = '%_DEPT_CD_%_APP_%-TEXT'
           OR SCREEN-NAME = 'REF_NO' OR SCREEN-NAME = '%_REF_NO_%_APP_%-TEXT'
           OR SCREEN-NAME = 'PRS_BNK' OR SCREEN-NAME = '%_PRS_BNK_%_APP_%-TEXT'
           OR SCREEN-NAME = 'TRANS_TY' OR SCREEN-NAME = '%_TRANS_TY_%_APP_%-TEXT'
           OR SCREEN-NAME = 'TRANS_ID' OR SCREEN-NAME = '%_TRANS_ID_%_APP_%-TEXT'
           OR SCREEN-NAME = 'TRANS_RK' OR SCREEN-NAME = '%_TRANS_RK_%_APP_%-TEXT'."EOC BY ANKITA
            SCREEN-ACTIVE = 0.
          ENDIF.
        ENDIF.
        IF R2 = 'X'.
          IF SCREEN-NAME = 'FLN' OR SCREEN-NAME = '%_FLN_%_APP_%-TEXT' OR
             SCREEN-NAME = 'BTC'  OR SCREEN-NAME = '%_BTC_%_APP_%-TEXT' OR
             SCREEN-NAME = 'PREPBY' OR SCREEN-NAME = '%_PREPBY_%_APP_%-TEXT'
             OR SCREEN-NAME = 'APROBY' OR SCREEN-NAME = '%_APROBY_%_APP_%-TEXT'
             OR SCREEN-NAME = 'PY_DT' OR SCREEN-NAME = '%_PY_DT_%_APP_%-TEXT' "SOC BY ANKITA
             OR SCREEN-NAME = 'ORG_ID' OR SCREEN-NAME = '%_ORG_ID_%_APP_%-TEXT'
             OR SCREEN-NAME = 'ORG_AC' OR SCREEN-NAME = '%_ORG_AC_%_APP_%-TEXT'
             OR SCREEN-NAME = 'DEPT_CD' OR SCREEN-NAME = '%_DEPT_CD_%_APP_%-TEXT'
             OR SCREEN-NAME = 'REF_NO' OR SCREEN-NAME = '%_REF_NO_%_APP_%-TEXT'
             OR SCREEN-NAME = 'PRS_BNK' OR SCREEN-NAME = '%_PRS_BNK_%_APP_%-TEXT'
             OR SCREEN-NAME = 'TRANS_TY' OR SCREEN-NAME = '%_TRANS_TY_%_APP_%-TEXT'
             OR SCREEN-NAME = 'TRANS_ID' OR SCREEN-NAME = '%_TRANS_ID_%_APP_%-TEXT'
             OR SCREEN-NAME = 'TRANS_RK' OR SCREEN-NAME = '%_TRANS_RK_%_APP_%-TEXT'."EOC BY ANKITA
            SCREEN-ACTIVE = 0.
          ENDIF.
        ENDIF.
        IF R3 = 'X'.
          IF SCREEN-NAME = 'PREPBY' OR SCREEN-NAME = '%_PREPBY_%_APP_%-TEXT'
            OR SCREEN-NAME = 'APROBY' OR SCREEN-NAME = '%_APROBY_%_APP_%-TEXT'
            OR SCREEN-NAME = 'PY_DT' OR SCREEN-NAME = '%_PY_DT_%_APP_%-TEXT' "SOC BY ANKITA
            OR SCREEN-NAME = 'ORG_ID' OR SCREEN-NAME = '%_ORG_ID_%_APP_%-TEXT'
            OR SCREEN-NAME = 'ORG_AC' OR SCREEN-NAME = '%_ORG_AC_%_APP_%-TEXT'
            OR SCREEN-NAME = 'REF_NO' OR SCREEN-NAME = '%_REF_NO_%_APP_%-TEXT'
            OR SCREEN-NAME = 'DEPT_CD' OR SCREEN-NAME = '%_DEPT_CD_%_APP_%-TEXT'
            OR SCREEN-NAME = 'PRS_BNK' OR SCREEN-NAME = '%_PRS_BNK_%_APP_%-TEXT'
            OR SCREEN-NAME = 'TRANS_TY' OR SCREEN-NAME = '%_TRANS_TY_%_APP_%-TEXT'
            OR SCREEN-NAME = 'TRANS_ID' OR SCREEN-NAME = '%_TRANS_ID_%_APP_%-TEXT'
            OR SCREEN-NAME = 'TRANS_RK' OR SCREEN-NAME = '%_TRANS_RK_%_APP_%-TEXT'."EOC BY ANKITA
            SCREEN-ACTIVE = 0.
          ENDIF.
        ENDIF.
        IF R4 = 'X'.
          IF SCREEN-NAME = 'PREPBY' OR SCREEN-NAME = '%_PREPBY_%_APP_%-TEXT'"SOC BY ANKITA
             OR SCREEN-NAME = 'APROBY' OR SCREEN-NAME = '%_APROBY_%_APP_%-TEXT'
             OR SCREEN-NAME = 'BTC'  OR SCREEN-NAME = '%_BTC_%_APP_%-TEXT'."EOC BY ANKITA
            SCREEN-ACTIVE = 0.
          ENDIF.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    START-OF-SELECTION.
      SELECT SINGLE * FROM T549Q WHERE PERMO = '01'
                                 AND   PABRJ = PRD+0(4)
                                 AND   PABRP = PRD+4(2).
      FR_DT = T549Q-BEGDA.
      TO_DT = T549Q-ENDDA.
      CONCATENATE FR_DT0(4) FR_DT4(2) INTO FR_P.
      CONCATENATE TO_DT0(4) TO_DT4(2) INTO TO_P.
      PN-PAPER = PRD.
      PN-PERMO = '01'.
    GET PERNR.
      RP-PROVIDE-FROM-LAST P0003 SPACE PN-BEGDA PN-ENDDA.
      RP_PROVIDE_FROM_LAST P0001 SPACE PN-BEGDA PN-ENDDA.
      IF PNP-SW-FOUND EQ 1.
       SN = SN + 1.
       ITAB1-SNO = SN.
       ITCC-SNO = SN.
        ITAB1-ENO = PERNR-PERNR.
        ITAB1-NAM = PERNR-ENAME.
      ELSE.
        REJECT.
      ENDIF.
      RP-INIT-BUFFER.
      RP-SEL-CALC.
      CALL FUNCTION 'RP_EVALUATION_PERIODS'
        EXPORTING
          LAST_CALCULATED_DAY = P0003-ABRDT
          LAST_DAY_IN_PERIOD  = TO_DT
          RETROCALCULATED_DAY = RP-SEL-CALC-RRDAT
        TABLES
          DIR                 = RGDIR
          EVP                 = EVP
        EXCEPTIONS
          RGDIR_EMPTY         = 1
          INTERNAL_ERROR      = 2
          OTHERS              = 3.
      DESCRIBE TABLE EVP LINES LIN.
      IF LIN > 0.
        LOOP AT EVP.
          IF EVP-IAPER = TO_P AND EVP-PAPER = TO_P.
            RX-KEY-PERNR = PERNR-PERNR.
            UNPACK EVP-SEQNR TO RX-KEY-SEQNO.
            RP-IMP-C2-TN.
            READ TABLE BT INDEX 1.
            READ TABLE WPBP INDEX 1.
            READ TABLE TAX INDEX 1."CHANGES BY ANKITA
            ITAB1-BAC = BT-BANKN.
            ITAB1-BKEY = BT-BANKL .
            ITAB1-DEP = WPBP-KOSTL.
            ITAB1-BETRG = BT-BETRG."CHANGES BY ANKITA
            ITAB1-TAXID = TAX-TAXID."CHANGES BY ANKITA
            YEAR = VERSC-PAYDT+0(4) - 11.
            MONTH = VERSC-PAYDT+4(2).
            DAY = VERSC-PAYDT+6(2).
            CONCATENATE YEAR MONTH DAY INTO ITAB1-PDT.
           ITAB1-PDT = VERSC-PAYDT - 110000.
            ITCC-DEP = WPBP-KOSTL.
            LOOP AT RT WHERE LGART = '/559'.
              ITAB1-BTFR = RT-BETRG.
              ITCC-BTFR = RT-BETRG.
             IF EVP-SRTZA = 'P'.
               ITAB1-BTFR = ITAB1-BTFR - RT-BETRG.
             ELSE.
               ITAB1-BTFR = ITAB1-BTFR + RT-BETRG.
             ENDIF.
            ENDLOOP.
          ENDIF.
        ENDLOOP.
      ENDIF.
      APPEND: ITAB1, ITCC.
      CLEAR: ITAB1, ITCC.
    END-OF-SELECTION.
      CONCATENATE 'Prepared By:' ` ` PREPBY INTO PREPBY.
      CONCATENATE 'Approved By:' ` ` APROBY INTO APROBY.
      IF R1 = 'X'.
        FORMAT COLOR 2.
        ULINE (127).
        NEW-LINE.
        WRITE: 2 'Sr No.', 10 'Emp Num', 27 'Name'.
        WRITE: 57 'Department'.
        WRITE: 72 '  Transfer Amount' RIGHT-JUSTIFIED.
        WRITE: 92 'Bank Key', 107 'Bank AC. Number'.
        WRITE:1 '|', 8 '|', 25 '|', 55 '|', 70 '|', 90 '|', 105 '|', 127 '|'.
        NEW-LINE.
        ULINE (127).
        NEW-LINE.
        FORMAT COLOR OFF.
        LOOP AT ITAB1.
          SN = SY-TABIX.
          WRITE: 2 SN, 10 ITAB1-ENO, 27 ITAB1-NAM.
          WRITE: 57 ITAB1-DEP.
          WRITE: 72 ITAB1-BTFR.
          WRITE: 92 ITAB1-BKEY, 107 ITAB1-BAC.
          WRITE: 1 '|', 8 '|', 25 '|', 55 '|', 70 '|', 90 '|', 105 '|', 127 '|'.
          ULINE (127).
          NEW-LINE.
        ENDLOOP.
        SKIP 4.
        ULINE 90(32).
        NEW-LINE.
        WRITE: 90 PREPBY.
        SKIP 4.
        ULINE 90(32).
        NEW-LINE.
        WRITE: 90 APROBY.
      ENDIF.
      IF R2 = 'X'.
        LOOP AT ITCC.
          COLLECT ITCC INTO ITCOL.
        ENDLOOP.
        FORMAT COLOR 2.
        ULINE (44).
        NEW-LINE.
        WRITE:2 'Sr No.', 9 'Department'.
        WRITE: 27 'Transfer Amount  ' RIGHT-JUSTIFIED.
        WRITE:1 '|', 8 '|', 25 '|', 44 '|'.
        NEW-LINE.
        ULINE (44).
        NEW-LINE.
        FORMAT COLOR OFF.
        LOOP AT ITCOL.
          SN = SY-TABIX.
          WRITE: 2 SN, 9 ITCOL-DEP, 27 ITCOL-BTFR.
          WRITE:1 '|', 8 '|', 25 '|', 44 '|'.
          NEW-LINE.
          ULINE (44).
          NEW-LINE.
        ENDLOOP.
      ENDIF.
      IF R3 = 'X'.
        LOOP AT ITAB1.
          CLEAR: ITTF, P3, P11, P13, P6, V_BAC.
          LEN = STRLEN( ITAB1-BKEY ).
          IF LEN < 3.
            CONCATENATE ITAB1-BKEY '***' INTO P3.
          ELSE.
          LEN = LEN - 3.
            LEN = 3.
            P3 = ITAB1-BKEY+LEN(3).
          ENDIF.
          CLEAR LEN.
          V_BAC = ITAB1-BAC.
          REPLACE ALL OCCURRENCES OF '-' IN ITAB1-BAC WITH ''.
          CONDENSE ITAB1-BAC NO-GAPS.
          LEN = STRLEN( ITAB1-BAC )."if length of acc num > limit
          IF LEN > 11.
            IT_FAIL-EN = ITAB1-ENO.
            IT_FAIL-BA = V_BAC.
            APPEND IT_FAIL.
            CLEAR: IT_FAIL.
            CONTINUE.
          ENDIF.
          P11 = ITAB1-BAC.
          CONCATENATE P11 '***********' INTO P11.
    above step is for putting '' in place of unfilled chars of P11.
          P13 = ITAB1-BTFR * 100.
          P6 = ITAB1-PDT+2(6).
          CONCATENATE ` ` P3 P11 BTC P13 P6 INTO STR.
          ITTF-ROW = STR.
          APPEND ITTF.
        ENDLOOP.
        IF ITTF[] IS NOT INITIAL.
          CONCATENATE FLN SY-DATUM SY-UZEIT '.txt' INTO FILEPATH.
          CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            FILENAME                        = FILEPATH
            FILETYPE                        = 'ASC'
         WRITE_FIELD_SEPARATOR           = 'X'
            TABLES
            DATA_TAB                        = ITTF
         OTHERS                          = 22
          SKIP 2.
          IF SY-SUBRC <> 0.
            WRITE:/ 'Unable to Download file at ', FILEPATH.
          ELSE.
            WRITE:/ 'File with following data downloaded at ', FILEPATH.
            NEW-LINE.
            SKIP 2.
            LOOP AT ITTF.
              WRITE:/ ITTF.
            ENDLOOP.
          ENDIF.
        ELSE.
          WRITE 'No Data, no file was downloaded'.
        ENDIF.
        IF IT_FAIL[] IS NOT INITIAL.
          SKIP 2.
          FORMAT COLOR 2.
          WRITE 'Acc. No. of following employees exceeded the length limit'.
          WRITE:/ 'So their entry was not created in the file'.
          SKIP 1.
          WRITE : 'Employee Number', 20 'Bank Acc. No.'.
          FORMAT COLOR OFF.
          LOOP AT IT_FAIL.
            NEW-LINE.
            WRITE : IT_FAIL-EN, 20 IT_FAIL-BA.
          ENDLOOP.
        ENDIF.
      ENDIF.
      IF R4 = 'X'."CHANGES BY ANKITA
        WRITE:/ 'ERROR LOG - BANK A/C NO. CONTAINS ALPHANUMERIC'.
        WRITE:/ 'EMPID' COLOR COL_POSITIVE,12 '|',15 'Receiving Bank Code' COLOR COL_POSITIVE,
                                                                      40 '|','Receiver A/C No' COLOR COL_POSITIVE.
        PERFORM EXTRACT_DATA.
        SKIP 2.
      ENDIF."EOC
      RP-READ-PAYROLL-DIR.
    Edited by: ANKITA BHARDWAJ on Dec 9, 2009 10:36 AM

  • Some issue with the Function Module u0093'SKWF_FIND_BY_QUERY' in a BW ECC6.0

    Hi All,
    Need some urgent help..
    Iam facing some issue with the Function Module “'SKWF_FIND_BY_QUERY' in a BW ECC6.0 system.
    As shown below, in the function module, the Table “IT_PROPERTIES_RESULT” gets populated with some values based on inputs like IT_CLASSES, IT_QUERY, and ‘L’.
    This updation of “IT_PROPERTIES_RESULT” table is happening for some of the services sent through IT_QUERY and is not getting populated for some.
      call function 'SKWF_FIND_BY_QUERY
    exporting
      CONNECTION_SPACE         =
        OBJ_TYPE                 = 'L'
      PTYPE                    =
      X_STRICT                 =
    IMPORTING
      ERROR                    =
         tables
         CLASSES                  = IT_CLASSES
         QUERIES                  = IT_QUERY
         RESULT_OBJECTS           = IT_LOIO
      PROPERTIES_REQUEST       = PROPERTIES_RESULT        = IT_PROPERTIES_RESULT.
    The values are as follows:-
    Values getting populated in IT_CLASSES – BW_LO_TRAN               Values getting populated in IT_QUERY – 1) BW_QUERY, 2) /BIC/ZSERVICE
    I would like to know whether any Standard Customizing BW transaction is present that is maintaining “IT_PROPERTIES_RESULT” table properties  and fetching through this Function Module.
    Also, suggest how this issue can be resolved
    Thanks & Regards,
    Shailesh nagar

    Thanks Suhas. That definitely helped.
    Also the following links helped.
    http://help.sap.com/saphelp_nw70/helpdata/EN/86/1c8c3e94243446e10000000a114084/frameset.htm
    /people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
    Cheers,
    Preethi

  • Issue with Duplicate FUNCTION

    Hi Guys:
    I am experiencing some issue with DUPLIATE FUNCTION.  What happen is that I have create some BUTTONS on the stage that was used througth out difference scence.....those buttons has same action that point page to particular scence.  And this is when I found the DUPLICATE FUNCTION issue.
    I found that I could get away by changing the name of the FUNCTION, but as I have quite a lots of those buttons so I really don't think this method is very pratical and organized.  So does anyone have any better idea how this can be solved?
    Many Thanks!

    Thanks so much, this did solve the problem.  Studpid me that were trying to add same FUNCTION on each Scene that has the same button.  Initially I thought it's more complex in AS3, but seems AS3 is actually trying to make thing easier and more praticler.
    Not really good at previously AS, but decided to spend some time on learning AS3.0 now.  Hope I could help people like me on the forum with question about AS3.0 soon. Just like the favor you did for me.
    Many Thanks!!

  • As FI consultant, What are critical issues with other Functional Consultant

    Hai,  Masters
    Can you express about Critical issues with other functional consultant with exmples
    Regards
    Ramesh K

    Hi Ramesh K,
    I think the critical issue should be the definaition cross application should be consistency( Ex in FI, CO, MM or SD).
    And the Main issue is the result updated from FI to other applications or from other applications to FI is correct or not!
    With Best Regards,
    Gladys Xing

  • Can Function Return more than One Values ??

    Hi Experts,
    I would like to ask you Can Function Return more than one values. I Used Function with Out and In out parameter and its working Fine..
    1. what is harm using Out and In out parameter in function
    2. if we can use Out and In out parameter in Function so what is deffernce between procedure and Function.
    3. Is there any Other Way Though which we can return more the One values in Function.
    Please advice me...
    Thanks
    Umesh Goel

    Yes/No.
    You can return multiple value from function. But, in PL/SQL and not in a SQL.
    The following examples demonstrate that -
    SQL*Plus: Release 9.2.0.1.0 - Production on Wed Mar 28 17:41:15 2007
    Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> create or replace package glob
      2  as
      3    b varchar2(20);
      4    c varchar2(20);
      5  end;
      6  /
    Package created.
    SQL>
    SQL> create or replace function test_mul_out(a in number)
      2  return number
      3  is
      4    cursor c1(eno in number)
      5    is
      6      select ename,job,sal
      7   from emp
      8   where empno = eno;
      9  
    10    rec c1%rowtype;
    11    d  number(10);
    12  begin
    13    open c1(a);
    14    loop
    15      fetch c1 into rec;
    16      exit when c1%notfound;
    17       glob.b:= rec.ename;
    18    glob.c:= rec.job;
    19    d:= rec.sal;
    20    end loop;
    21    close c1;
    22    return d;
    23  end;
    24  /
    Function created.
    SQL> set serveroutput on
    SQL>
    SQL> declare
      2    zz  number(10);
      3  begin
      4    select test_mul_out(7777)
      5    into zz
      6    from dual;
      7    
      8    dbms_output.put_line('Ename: '||glob.b);
      9    dbms_output.put_line('Job: '||glob.c);
    10    dbms_output.put_line('Sal: '||zz);
    11  end;
    12  /
    Ename: Avik
    Job: CLERK
    Sal: 3456
    PL/SQL procedure successfully completed.
    SQL> Regards.
    Satyaki De.

  • Can oracle  function return more than one value

    Hi All
    please answer can oracle function return more than one value
    need one schenario
    regards

    Can any function, irrespective of the language, return multiple values?
    OF COURSE NOT!!
    So why do you think Oracle will now suddenly do it differently than all other languages? Never mind that it is impossible for a function (a unit/module of code) returning a memory address, to return multiple memory addresses. The machine code that does that, has not been yet been designed/implemented.
    I am continually amazed that this question is asked. It is about something so fundamental in almost every single 3rd and 4th generation language... something that is taught right at the start... the definition of what a procedure and what a function is.
    Sorry, but I simply cannot pull punches on this subject and smooth it over. There is something fundamentally wrong with your training as a programmer if you have to ask such a question about a function.
    And whatever programming skills you build on such a foundation, will be seriously lacking.
    I kindly suggest that you get back to the very basics of programming - and review and revisit until you fully understand it. There are no shortcuts in becomming a good programmer.
    Message was edited by:
    Billy Verreynne

  • Issues with 'Rounding' function (Word 2007 issue? Works in Word 2003...)

    My colleague (using Word 2003) and I (using Word 2007) are working on a change to a template where we include a formula that has the function called rounding.
    She (2003) is able to preview the pdf but I (2007) am getting error message: : oracle.xdo.parser.v2.XPathException: Extension function error: Method not found 'round'
    All other settings that we have appear to be the same (same config file, same java version, etc)
    Does anyone know if there are some changes to Word 2007 that are causing this? And, any ideas on how to resolve?
    Thanks for the help!
    Background:
    -The function is designed provide a total weight value: each individual weight value, multiply by a factor of .80, round up, and then added together to get a total amount.
    -Because we also show the individual weight values on the output, (also multiplied by the factor of .80 and then rounded up), we need the factor and rounding to happen before the sum).
    The entire set of functions for the total weight value is:
    <?xdoxslt:set_variable($_XDOCTX,'sum',0)?>
    <?for-each:LIST_G_CONTAINER_NAME1?><?for-each:G_CONTAINER_NAME1?>
    <?xdoxslt:set_variable($_XDOCTX,'sum', xdoxslt:get_variable($_XDOCTX,'sum')+ xdoxslt:round((GROSS_WT*0.8),2))?><?end for-each?><?end for-each?>
    <?format-number: xdoxslt:get_variable($_XDOCTX,'sum');'9G990D00'?>
    space
    <?WEIGHT_UOM_CODE?>
    Error when attempting to preview the pdf after uploading an xml file:
    : oracle.xdo.parser.v2.XPathException: Extension function error: Method not found 'round

    Hi,
    I took my original file (didn't have the round functionality) and Word 2007 and did the following:
    1) Tested with xml to ensure that there are no other issues - was able to preview successfully
    2) Added the function you suggested: <?xdoxslt:round(1000.98978,2)?> and saved the change
    3) Tried to preview using the same xml and got the same error message about rounding
    I can't test on 2003 because my colleague is not working right now (she is the one with that version installed). I will try on 2003 later today (but I am guessing it will work for her because the other rounding function works for her).
    Thanks for any other ideas about this.
    Here is the entire extract of error message:
    Font Dir: C:\Program Files\Oracle\BI Publisher\BI Publisher Desktop\Template Builder for Word\fonts
    Run XDO Start
    RTFProcessor setLocale: en-us
    RTFProcessor setConfig: C:\Program Files\Oracle\BI Publisher\BI Publisher Desktop\Template Builder for Word\config\xdo.cfg
    FOProcessor setData: C:\Data\BI Publisher\2010_CR-102626_PL-CML_Net Weight\Net Weight Template Changes\Testing\OTST_SC-06_PL_SGS-2903194_Direct_ENG_Jul-09.xml
    FOProcessor setLocale: en-us
    java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLT10gR1.invokeProcessXSL(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLT10gR1.transform(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLT10gR1.transform(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLTWrapper.transform(Unknown Source)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
         at oracle.apps.xdo.template.FOProcessor.createFO(Unknown Source)
         at oracle.apps.xdo.template.FOProcessor.generate(Unknown Source)
         at RTF2PDF.runRTFto(RTF2PDF.java:632)
         at RTF2PDF.runXDO(RTF2PDF.java:466)
         at RTF2PDF.main(RTF2PDF.java:254)
    Caused by: oracle.xdo.parser.v2.XPathException: Extension function error: Method not found 'round'
         at oracle.xdo.parser.v2.XSLStylesheet.flushErrors(XSLStylesheet.java:1526)
         at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:517)
         at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:485)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:264)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:150)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:187)
         ... 16 more

  • Slicer Time Dimension Issue with Cube Functions

    Hi,
    Hoping someone can help me figure out right approach here.
    Summary:
    Using Excel 2013 connected to a SSAS cube as data source, and cube functions with slicers to create a dashboard.
    Have following time dimension slicers; Fiscal Year, Fiscal Quarter, Fiscal Month, Fiscal Week & Date, that are used to slice data based on user selection, along
    with a sales measure.
    Below is example of Slicer name and CubeMember function for each:
    Slicer_Fiscal_Year: 
    =CUBEMEMBER("Cube","[Date].[Fiscal Year].&[2015]")
    Slicer_Fiscal_Quarter: 
    =CUBEMEMBER("Cube","[Date].[Fiscal Quarter].[All]")
    Slicer_Fiscal_Month: 
    =CUBEMEMBER("Cube","[Date].[Fiscal Month].&[201408]")
    Slicer_Fiscal_Week: 
    =CUBEMEMBER("Cube","[Date].[Fiscal Week].&[201509]")
    Slicer_Date: 
    =CUBEMEMBER("Cube","[Date].[Date].[All]")
    Problem:
    What I am trying to do is to build a table with cube functions that takes the lowest grain of the slicer time dimension selected, shows the current member, plus
    the prior 7 so I can have an 8 period trending view table that I will build a chart from. In the above example that would mean that it would look at Slicer_Fiscal_Week since that is lowest grain that has an attribute other than All, and then show me the prior
    7 periods. In this case 201509 means Week 9, so I would want to show in table Week 9 back to Week 2. But if Slicer_Fiscal_Week was set to All, along with Slicer_Date, then Fiscal Month would be lowest grain, so I would want to show Fiscal Months from August
    (201408) back to January 2014. I know how to use CubeRankedMember to pull the value from what is selected in the slicer, the problem is figuring out how to pass the lowest grain time dimension so that I can use lag or some other MDX function to get the previous
    periods.
    Any help on this would be greatly appreciated.
    <object height="1" id="plugin0" style=";z-index:1000;" type="application/x-dgnria" width="1"><param name="tabId" value="{28593A5C-70C0-4593-9764-80C76B51795C}"
    /></object>

    Hello,
    Thank you for your question.
    I am trying to involve someone familiar with this topic to further look at this issue.
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Authorization issue with upload functionality

    Hi,
    I have issue with authorization with upload functionality.
    we have country as authorization relavant field. if we are giving some country authorization to user it is giving authorization error at upload functionality.
    But if we give all country authorization than it is working fine.
    Could you guide me how to avoid this situation. We can not give all country authorization to all the users.
    Thanks,
    Naman Shah

    Hi Naman,
    For SAP BPS
    Here while defining a variable you can set the user authorization and can determine which all records can be seen by the user.
    For eg. Create a variable for country with replacement type User-specific values. Here you can assign values to a particular user id.
    Please check for more details:
    http://help.sap.com/saphelp_nw70/helpdata/EN/43/548bafbc0f357ee10000000a11466f/frameset.htm
    For SAP IP
    Please Check: User Authorization in SAP IP
    Regards, Rishi
    Edited by: Rishikesh Sinha on May 6, 2009 8:01 AM

  • Whitespace in User Account Name causes issues with various functions

    I've run into a few issues with users who have whitespace in their account names (for example, a user account name that was: "Joe Smith"). Generally, I think this is a result of windows interpreting the last name as a parameter when it tries to
    run a certain function. One place where this occurs and is easily replicated is in the "Troubleshoot Program Compatibility Wizard" which gives an error about permissions, another place this occurs is in the dx9 web installer which gives an error
    message concerning advpack.dll
    In both of these cases I've been able to 'fix' the issue by relocating the TEMP and TMP environment variables to a folder like C:\TEMP, however I still have some issues with other installers and programs such as the 3rd party Cordova build program and the
    android sdk which both get stumped by spaces in the user account name. From my understanding there is no way to change a user account name (not just the name which displays but the name which Windows reads) without deleting the account and copying often several
    gigabytes of files and settings over to a completely new account. Is this correct? Is there a way to remove the whitespace from an account name without these hackish workarounds? Is there anyway to report this as a bug to Microsoft in the hopes that they either
    remove support for usernames with whitespaces or come up with some way to make their internal features like the Compatibility Wizard operate correctly in these (fairly common) install environments? It's an incredibly pesky bug to identify....

    1. Spaces are allowed but not recommended. I would avoid using space(s) in account names.
    2. I do not understand what you have prevented from changing user name.
    3. For problems with 3rd pty programs ask support/forum of respective software vendors.
    4. If you feel like addressing Microsoft, use
    http://support.microsoft.com/contactus/?ln=en-us
    Regards
    Milos

  • My USB drives have "Disk Repair" issues, with "limited functionality."

    The only way I can transfer files between my PowerMac G4 with OS X v10.5.2 and my PowerMac 5500/225 with OS 8.6 is with Iomega Zip drives. My 100 MB disks work perfectly in OS 8.6 but they seem to get corrupted when I open them on the G4. I've had this problem with other USB drives on the G4, including an external USB hard drive and my USB SD card reader. Things will seem to work fine transferring files but then I'll get the following message:
    *+Disk Repair+*
    +The disk "disk" was not repairable by this computer. It is being made available to you with limited functionality. You must back up your data and reformat the disk as soon as possible.+
    Then I drag the files over with the Zip drive until everything blows up and I have to reformat the disk. I'm scared what might happen with the SD cards, if that will have any effect on the camera or if the disk will stop working entirely. The external hard drive was the first to blow up but we didn't know that this was going to be a trend so we had returned that to Best Buy. It had worked beautifully under OS X v.10.3.
    Does anyone have any ideas on what is going on here and how to fix it? I do not have vast sums to upgrade hardware and software nor do I even really want to. I'm quite fond of the old Power Mac 5500 and OS 8.6.
    Any suggestions are greatly appreciated!

    Have you tried backing up again by manually running a Time Machine backup? Unfortunately, if your backup is corrupted I don't know of a way to fix it except to start over.

  • Function - Return More than One Value in a Concatenated String

    Hi,
    Is it possible for a function to return a concatenated string(combining more than one number). I am trying to return the PO number by inputting and invoice_id and code number but an invoice_id can have more than one PO with the same code number. I would like to concatenate the PO numbers with commas e.g.
    10124, 10090, 10987
    At the moment the function returns null for these cases that have more than one PO number.
    Thanks

    Also is is possible to create another function that can be called in the same script using the PO number as an IN parameter in SQL. See SQL below:
    select cck.concatenated_segments as "Segment" ,
    cc.code_combination_id,
    NVL ( src . user_je_source_name , '**********' ) AS "Source" ,
    NVL ( cat . user_je_category_name , '**********' ) AS "Category" ,
    jel . period_name as "Period Name" ,
    i.invoice_id as "Invoice ID",
    s.vendor_name as "Vendor Name",
    s.segment1 as "Supplier No",
    jeb . name as "Batch Name" ,
    func_get_po(i.invoice_id, cc.code_combination_id) "PO No",
    jeh . name AS "Header Name" ,
    jel . description AS "Description" ,
    jel.accounted_dr AS "Debit" ,
    jel.accounted_cr AS "Credit" ,
    NVL(jel.accounted_dr, 0) - NVL(jel.accounted_cr, 0) AS "Net Amount"
    FROM apps.gl_code_combinations cc ,
    apps.gl_code_combinations_kfv cck,
    apps.gl_je_lines jel ,
    apps.gl_je_headers jeh ,
    apps.gl_je_batches jeb ,
    apps.gl_je_categories cat ,
    apps.gl_je_sources src,
    apps.gl_import_references r,
    apps.xla_ae_lines al,
    apps.xla_ae_headers ah,
    apps.xla_events e,
    xla.xla_transaction_entities te,
    apps.ap_invoices_all i,
    apps.ap_suppliers s
    WHERE ( cck.concatenated_segments BETWEEN '23.83545.141.000.00.23.000.000' AND '23.83545.141.000.00.23.000.000'
    AND cc.CHART_OF_ACCOUNTS_ID = 50328
    AND jeh.LEDGER_ID IN
    (select acc.ledger_id
    FROM apps.gl_access_set_ledgers acc
    WHERE acc.access_set_id = 1000
    AND jel.code_combination_id = cc.code_combination_id
    AND cck.code_combination_id = cc.code_combination_id
    AND jel.status
    || '' = 'P'
    AND ( jel.accounted_dr != 0
    OR jel.accounted_cr != 0 )
    AND jeh.je_header_id = jel.je_header_id
    AND jeh.actual_flag = 'A'
    AND 1 = 1
    AND jeh.currency_code != 'STAT'
    AND jeb.je_batch_id = jeh.je_batch_id
    AND jeb.average_journal_flag = 'N'
    and src.je_source_name = jeh.je_source
    and cat.je_category_name = jeh.je_category
    and r.je_header_id(+) = jel.je_header_id
    and r.je_line_num(+) = jel.je_line_num)
    AND ( :period_name = jel.period_name
    and al.gl_sl_link_id(+) = r.gl_sl_link_id
    and al.ae_header_id = ah.ae_header_id(+)
    and al.application_id = ah.application_id(+)
    and ah.application_id = e.application_id(+)
    and ah.event_id = e.event_id(+)
    and e.application_id = te.application_id(+)
    and e.entity_id = te.entity_id(+)
    and nvl(te.source_id_int_1,-99) = i.invoice_id(+)
    and i.vendor_id = s.vendor_id(+) )
    AND ( jel.ledger_id = 2041)
    ORDER BY src.user_je_source_name ,
    cat.user_je_category_name ,
    jeb.name ,
    jeh.name ,
    cck.concatenated_segments ,
    jel.je_line_num
    I am using func_get_po(i.invoice_id, cc.code_combination_id), I would like to call another function in this script that uses the PO number as an IN parameter.
    For example func_get_po_requester(i.invoice_id, cc.code_combination_id, func_get_po(i.invoice_id, cc.code_combination_id))
    Would this work?
    Thanks

  • Issue with Bookmark functionality (using java script) in WAD.

    Hi,
    I am working on a WAD report and instead of using the default bookmark functionality within WAD, i use a java code to get the bookmark url in a new window.
    But the problem is the java code is not working consistently at all times.
    Issue1: If i click on the bookmark button on the report for the first time, it will open up a new window with the bookmark link. But if i close that new bookmark url window and again click on the bookmark button, a new window is opened which displays the template corresponding to the bookmarkk generated earlier (the report in its executed form), instaed of the bookmark url.
    Can anyone help me to correct this issue. At any time i click the bookmark button i want to get the bookmark url opened in the new window, instead of the template.
    Issue2: The bookmark is not at all working at particular times. It will show error message at the bottom the page. What I am  thinking is, this is because of the misalignment of the java code when you sava the WAD report. The java code is so sensitive that it gets realigned each time you save the WAD report. But sometimes even without making any changes also it is not working.
    If anyone has any suggestion or inputs for solving these issues pleese help ASAP. The java code i used is given below.
    function createBookmark()
    var bwUrl="<SAP_BW_URL CMD='BOOKMARK'>";
    child1=window.open(bwUrl,'win1','width=1,height=1,alwaysLowered=0');
    window.focus();
    //Ensure that BW completed generation of the bookmark url.
    now = new Date();
    startTime = now.getTime();
    delayTime = 3000;
    //Set timeout to 3 seconds
    waitTime = startTime;
    //check if the bookmark url is ready and timeout after the specified time (delayTime).
    while (waitTime<(startTime+delayTime))
    now = new Date();
    waitTime = now.getTime();
    //BW identifies a bookmark using BOOKMARK_ID. The presence of this string
    //in the url is used to identify creation of the bookmark. If bookmark
    //is created on the server, proceed to the next step.
    if (child1.location.href.indexOf("BOOKMARK_ID") >0) 
    break;
    bookmark_url = escape(child1.location.href);
    bookmark_url = bookmark_url.replace(/%3A/g, ":");
    bookmark_url = bookmark_url.replace(/%3F/g, "?");
    bookmark_url = bookmark_url.replace(/%26/g, "&");
    bookmark_url = bookmark_url.replace(/%3D/g, "=");
    var base_url = window.location+"";
    var base_index = base_url.indexOf("?");
    base_index = base_index + 1;
    var book_link = base_url.substring(0,base_index);
    if (book_link.indexOf("sapdbi")!=-1)
    book_link = "http://dep.xxx.com/sso/index.jsp?target=BW&";
    if (book_link.indexOf("sapqbia1")!=-1)
    book_link = "http://qep.xxx.com/sso/index.jsp?target=BW&";
    if (book_link.indexOf("sapqbia2")!=-1)
    book_link = "http://qep.xxx.com/sso/index.jsp?target=BW&";
    if (book_link.indexOf("sappbia1")!=-1)
    book_link = "https://portal.xxx.com/sso/index.jsp?target=BW&";
    if (book_link.indexOf("sappbia2")!=-1)
    book_link = "https://portal.xxx.com/sso/index.jsp?target=BW&";
    if (book_link.indexOf("sapqbi")!=-1)
    book_link = "http://qep.xxx.com/sso/index.jsp?target=BW&";
    if (book_link.indexOf("sappbi")!=-1)
    book_link = "https://portal.xxx.com/sso/index.jsp?target=BW&";
    var book_index = bookmark_url.indexOf("?");
    book_index =   book_index +   1; 
    var book_length = bookmark_url.length;
    var temp_link= bookmark_url.substring(book_index,book_length);
    portal_bwUrl = book_link+temp_link;
    child1.close();
    // The below two lines are not necessary, it is left for reference.
    // https://portal.xxx.com/sso/index.jsp?target=BW&SAP-               //LANGUAGE=EN&language=EN&cmd=LDOC&TEMPLATE_ID=IPUWT_FRAME
    bookmark_window=window.open("",'_blank','width=1000px,height=30px,status=0');
    bookmark_window.moveTo(50,500);
    var body_tag = '<body leftmargin=3 topmargin=3 bgcolor=#cad4e3 class=&amp;SAPBEXTbsBdyEdg&amp;>';
    var body_text ='<p><font face=Arial size=2>
    This bookmark can be copied and pasted to Internet Explorer-Favourites, mail or other documents:
    </p>';
    bookmark_window.document.write('<title name="SAP_BW_TITLE_!IID_171">Bookmark</title>',body_text, body_tag, portal_bwUrl, '</body>');
    Thanks in Advance.

    Hi Danny
    Thanks for the update
    Hi Danny
      Thanks for the update.
      I can't find any code in the attachment.Its a Web Page.
      Rightclick on webpage and View Source
      Then i can find Code.
      Still it is not working
    Issues: Which object i have to replace with the URL in the code
    Value = 'Weekly'
    or
    fun(WEEKLY REPORT)
    and
    when i paste that code in the XHTML tab of template and tried to save it,The scripted is changed
    Please update how to proceed
    Thanks

Maybe you are looking for

  • How do we print multiple components each in a different page?

    hello I would like to print multiple JPanels (lets say an array) each in a different page. The question I ask is about the following code          printerJob.setPrintable(printTable.getInstance(), pageFormat);               try                     if

  • F110 Clearing Program

    I'm trying to find out which program utilized for the F110 to post in the company bank account and clearing the vendor. Does anyone know? Thanks

  • Assign Company Code to FM area greyed out

    Hi, We are in 4.7 and currently have assigned one company code  to FM area and now we have created a new company code and want to assign the new company code to the existing FM area but noticed that in IMG 'Assign company code to financial management

  • What is correct??

    I need to perform the following SQL operations in my JSP First a select into a temp table Select ....... into #temptable from table inner join (select ......) After this #temp table is created I need to then get my data into a hierarchical format wit

  • Problem opening the current selection

    Hey guys, This one has really got me stuck. I'm writing a Dreamweaver Extension and I need to programmatically select a page in the current site and then open it. Simple right? Well the opening step only seems to work when I already have 2 pages open