T-SQL and CLR types for return value do not match

Hi I am trying to create a CLR function to call a webservice, the CLR function return data type is double, whether I try
to create this as a table valued funcion or a scalar to return a distance travelled value I am receiving the error below. I've tried changing data types around in the CLR side and the SQL side but keep receiving the same error message, any help would be appreciated,
Thank you,
[Microsoft.SqlServer.Server.SqlFunction(Name = "DistanceCalc")]
public static Double DistanceCalc(Double SrcLat, Double SrcLong,
Double DestLat, Double DestLong)
MileageWS ws = new MileageWS();
ws.Url = "http://test.isp.ca/Distance.asmx";
int intUom = 0; // 0 = Mile, 1 = KM
RouteType RouteMethod = RouteType.Practical;
Requester RequestedFrom = Requester.LinkRoute;
Double distance;
distance = ws.GetDistanceInfoForLonLat(SrcLat, SrcLong, DestLat, DestLong, intUom, RouteMethod, RequestedFrom);
return distance;
CREATE FUNCTION DistanceCalc
@SrcLat as float, @SrcLong as float,
@DestLat as float, @DestLong as float
RETURNS TABLE (Distance float)
External NAME CLRfunctions.RIFunctions.DistanceCalc
GO
Error received when try to Create function ...
1, Level 16, State 2, Procedure pcMiler, Line 6
CREATE FUNCTION for "pcMiler" failed because T-SQL and CLR types for return value do not match.

You defined at table-valued CLR function, but I think you meant to define a scalar CLR function. That might be the cause of the error.
RETURNS TABLE (Distance float)
should be
RETURNS (Distance float)

Similar Messages

  • GR/IR A/c Amount and Amount in local Curreny values are not matching

    Hello Gurus
    When we are doing MIGO for some Scheduling Agreement PO's the Amount and Amount in local currency columns are mismatching with  paise (+/-), eventhough PO belongs to Local Currency (INR). Because of this GR/IR account is not cleared after MIRO through F.13. Both MIGO and MIRO amount are showing as Open items.
    Why it is happening and what is the way to clear GR/IR A/C. (F.13 with Tolerance limit is also not workout).
    Thanks & Regards
    Venkat.P

    Hi sridhar
    Thanks for reply
    Through MR11 also these values are not cleared.
    Regards
    Venkat.P

  • MB51 and BW Material Inventory 0IC_C03_Q0006 values do not match

    Hello BW experts,
    We recently implemented the standard material inventory extractors to our BW system.  When I compare the values between MB51 and 0IC_C03_Q0006, the quantities are the same but the values are different.
    For a particular material/plant, I exported MB51 to excel and did a sum on "Qty in Un. of Entry" and "Amount in LC"
    qty:  2104  Value: 8073.51
    Here's what the query looks like in Bex Analyzer for the same material/plant:
    Is ValStockValue not the same as Amount in LC?  If not, what should I be using to make sure ECC and BW are matching up?
    Thank you for your help,
    Susan

    Hi Susan,
    For Closing Stock quantity use 0TOTALSTCK which is Ncum value of in flow (0RECTOTSTCK)and out flow (0ISSTOTSTCK). For that your values are matching.
    And for Closing Stock Value use 0VALSTCKVAL which is Ncum value of in flow (0RECVS_VAL)and out flow (0ISSVS_VAL).
    In case if you need to calculate opening stock quantity & value use below formulas:
    Opening stock quantity = Closing(0TOTALSTCK) + Issued(0ISSTOTSTCK) - Receipt(0RECTOTSTCK)
    Opening stock value = Closing(0VALSTCKVAL) + Issued(0ISSVS_VAL) - Receipt(0RECVS_VAL)
    Also use can use MC.9 with MB5B for matching data.
    Regards,
    Abdullah

  • Switch Sign For Flow and Switch Type for Flow

    Hi Can any one Please make me clear at least with 3 examples how to understand Switch Sign for Flow and Switch Type for Flow
    and also the good example with Balance Recurring Account Types

    Hi Chennai,
    Consider an account "Fixed-Assets" supported by movement analysis in Custom1, as follows:
    ClosingBalance
    OpeningBalance
    Additions
    Disposals
    If you mark the Custom1 member Disposals as SwitchSignForFlow, you will enter positive values in Disposals but HFM will subtract from the other two members to calculate the Closing Balance. You may use this functionality if your client prefers to see all values as positive on the reports.
    Using the same example, you might recognize that while Closing and Opening balances are of balance type (they provide a snapshot of the account at a specific instant meaning that you see the same number whether you view the YTD or Periodic values of the account), Additions and Disposals are movements, which means that they accumulate during the same year starting from a zero balance on 1/1/201X and therefore you will see different numbers depending on viewing the YTD or Periodic values of the account. In order to provide with this behavior you have to mark both Additions and Disposals with SwitchTypeForFlow. If you don't they will behave as the underlying account (the Fixed-Assets account) and like the other two Custom1 members, Opening and Closing balance members.
    As for the BalanceReccuring, an account of this type behaves like a normal Balance account, but once you input a number in an intermediate period (say June), the same number will be copied to all following periods (July-December) until you override the numbers by explicitly inputting new values. With a normal balance account, all following periods will be empty.
    --Kostas                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Passing the file name and file type for mime_download

    HI All,
    Can You Please let me know how to pass the parameters file name and file type for mime_download.
    Thanks in Advance.
    Regards,
    Haritha.

    Hello Haritha,
    Please see the SAP help:
    http://help.sap.com/saphelp_nw70/helpdata/en/46/9bd97240b81e5be10000000a1553f6/frameset.htm
    Edgar

  • Item category (Customized )ZJT1 and MRP type for material is not allowed

    Hi Guys,
                   When i try to create the order i see the error as item category and MRP type of the material is not allowed.
    I checked in Vov5 table, i could observe that Schedule line category is maintained.
    Could you please help us in resolving this..
    Thanks and regards,
    Rahul

    Hi,
    Please assign the Item Category ZJTI and MRP type (for eg: PD) assigned to the schedule line category in IMG under Sales and Distribution--> Sales ---> Schedule line -->Assign schedule line
    Hope this resolve your issue
    Regards,
    KrishnaO

  • Item Category and MRP type for material is not allowed

    Hello all,
    I got a Error Message:
    <b>Transaction Z113 is not defined (Message no. V1347)</b>
    <b>Diagnosis</b>
    This combination of item category Z113 and MRP type for material is not allowed.
    <b>System response</b>
    The system does not allow further processing of this item.
    <b>Procedure</b>
    Check your entry.
    You can display the combination defined in table TVEPZ, which controls scheduling line category determination, and change it as required if you have the authorization to do so. The MRP type for the material may be changed in the material master.
    <b>The SD Configuration seems all right, I have:</b>
    Sls Doc Type (<b>VOV8</b>) – ZA9 (no delivery type assigned)
    Item Category (<b>VOV7</b>) – Z113
    Assigs Sls Doc & Item Ctgry (<b>VOV4</b>) – ZA9/ZNOR/blank/blanl/Z113
    ZNOR = Std Item-Av. chck  Del
    ZNOR defined in MM03/Sls Org 2
    Define Schedule Line (<b>VOV6</b>) = Z7 (without delivery)
    Z7 has FLAG on Prod Allocation
    Assign Schedule Line (<b>VOV5</b>) = Z113/ND/Z7
    At table: TVEPZ
    I have the entry: Z113/ND/Z7
    Guys, what would?
    Please help me out because I am stuck in this issue.
    Thanks a lot,
    Barbara

    Barbara, this may be tied to Strategy Group on the Material Master (I can't read enough into the detail)
    Item Category determination + MRP Type for your schedule line type ties to a Sched. Line category(this you know)
    New Rqmts class gets tied to a Rqmts Type
    New Rqmts Type gets assigned to rqmts class
    Strategy, assign the Rqmts Type to it
    Strategy Group, Assign the Strategy  to it
    MM02 [MRP3 view] strategy group should be the one that ties together (all the other ties
    It may be something in this area that you need to trace through ?
    Bill

  • Tax model, Tax combinations and Tax types for New Jersey

    We are having problems in computing taxes correctly for Employees who have their Work tax area and Residence tax area as New Jersey.
    Can anyone please help with the best Tax model, tax combination and Tax types for these combination for New Jersey.
    It will be better if you have employees in New Jersey, who have their Taxes deducted correctly.
    We are in an implementation and unfortunately it has been a while since we have applied any Tax related SAP notes or BSI tubs.
    Appreciate all help.

    i have been researching and have found that NJ state taxes are like Puerto Rico taxes. The Schema UMOT may have to be used with a different modifier to calculate Withhoding tax for NJ , different from FED.
    Has anyone of you used this schema ? I find that UTAXRAUTHY ( tax authority) is an Operation in the deecisison tree .Can anyone confirm if Tax type is also an operation?
    I shall appreciate any related feedback.Thanks.

  • No delivery type for returns processing assigned to item 00010

    Dear all,
    I want to create a Return Purchasing Order.
    I have got an error: No delivery type for returns processing assigned to item 00010
    Please help to to find out problem. What do i have to check?

    Hi,
    Regarding the error ME392, please check the customizing under
    the IMG path:
    Materials Management
    -> Purchasing
       -> Purchase Order
          -> Returns Order
             -> Store Return
    Here, for the supplying plant in your Cross-company-code return, you
    need to set up a delivery type.
    In order to know the supplying plant, please, open the vendor master
    data (XK03).
    Select the 'Purchasing data' section.
    Once you are in the screen SAPMF02K 310 follow the menu path 'Extras' ->
    'Add.purchasing data'.
    Here you will see the Plant that is linked to your vendor.
    So, now, for this Plant, under the IMG path mentioned before,
    set a a delivery type for the store return (NCR - Ret.StTranspOrd CC
    can be used, for example).
    Best Regards,
    Arminda Jack

  • Maintenance activity type  and order type  for plant maintenance order

    How can i get the maintenance activity type  and order type  for a given plant maintenance order. Please let me know the table where i can get these two fields
    In AFIH i can only get the MAT for an order number

    Maintenance activity type -
    AFIH - ILART
    Order Category Indicator Plant Maintenance -
    AFIH - AKKNZ
    reward if heplful

  • I want the message types and basic types for catsdb table

    i want the message types and basic types for catsdb table

    Hi Jagrut,
    Message Class is "LR".
    <b>Reward points, if helpful.</b>
    Regards,
    Atin

  • XDK for PL/SQL and XML Parser for PL/SQL

    Is there a difference between the terms:
    XDK for PL/SQL
    and
    XML Parser for PL/SQL V2
    or are they the same thing...?
    cheers,

    XDK stands for XML Developer's Kit. There are Oracle XDKs for Java, C, C++, and PL/SQL. These development kits contain building blocks for reading, manipulating, transforming, and viewing XML documents.
    XML Parser is one component of XDK. Other components of XDK are
    XSLT Processor, XSU, XSQL Servlet, XML Class Generator, etc.
    For more information on XDK and its components please refer to:
    http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/appdev.920/a96621/adx01bas.htm#1656
    Regards,
    Anupama
    http://otn.oracle.com/sample_code/content.html

  • How to know the printprogram and output type for perticular standard script

    how to know the print program and output type for perticular standard script and wt the proceure we will fallow to modifie the standard script..if possible u have any sample code plz share with me.....

    Hi Phani,
    To know the print program and output type for a standard script we have a table called TNAPR. So just you go to SE11 and provide the table name as TNAPR and choose display option.Then go with display entries option and in selection screen you have to provide the form name for whic you want to know the print program and output type.
    To modify a standard script first of all you have to copy the standard form for which you need modifications into Zform. Once you done this you can modify the layout set as per your requirement.Then what ever the modifications you have done in layout set for that you need to populate the data.For this you also need to do some modifications to the print program.so you have to options like directly you can modify the print program as per your requirement and other one is you can create a subroutine and do coding in that subroutine. Then you need call this subroutine in the Script Form.like this you can do modifications to the standard script........................... Reward me if its helpful..........
    Thanks & Regards.
    Laxman.P
    B'lore.

  • Idoc type and message type for Planned Independent Requirement (PIR)

    Hi
    Can anyone please give me the information on the idoc type and message type for Planned Independent Requirement(PIR)?
    And also the prerequisites to use them.
    Regards,
    Lohitha
    Moderator message: please do more research before asking, show what you have done yourself when asking.
    Edited by: Thomas Zloch on May 23, 2011 10:45 AM

    Hi,
    You can use IDoc type WMMBID02 with message type WMMBXY.
    Also please check test program RLMBXY00 to simulate IDoc WMMBID02.
    Regards,
    Ferry Lianto

  • Idoc type and message type for inventory

    Hi All
    What is the idoc type and message type for inventory adjustments? Thanks for any help
    Thanks
    Ricky

    Hi,
    You can use IDoc type WMMBID02 with message type WMMBXY.
    Also please check test program RLMBXY00 to simulate IDoc WMMBID02.
    Regards,
    Ferry Lianto

Maybe you are looking for