Function sometimes return wrong data

Hi all.
I have a very strange problem with a function. Situation is this: I have an application that handles processes. Each process have a number of steps that is arranged in a matrix like layout. User clicks a step to start/execute it.
Now in a list of current processes i want to have an indication of how "far" a process has reached so i created a function for that and included that in my processlist fetch.
gchs_user_process_steps is the table where the user data for the process step is
gchs_process_steps is the definition table of what steps a process has
gchs_steps is the definition table of all steps
The below function is supposed to return latest step user clicked in the display matrix. tier is used to store the column number and sortorder is the row number of any step user clicked.
CREATE OR REPLACE FUNCTION FN_REACHEDSTEP(p_user_process_id NUMBER)
RETURN VARCHAR IS
  ret VARCHAR(30);
  ret_id INTEGER;
  ret_num INTEGER;
BEGIN
   ret := '';
   ret_id := 0;
   ret_num := 0;
   BEGIN
SELECT substr(step_name,1,30),step_id,reached INTO ret,ret_id,ret_num
FROM (
SELECT a.*, rownum rnum
FROM (
    SELECT s.name AS step_name, ps.id AS step_id, max((ps.tier*1000)+ps.sortorder) AS reached
    FROM gchs_user_process_steps ups, gchs_process_steps ps, gchs_steps s
    WHERE ups.gchs_process_step_id=ps.id AND
       ps.gchs_step_id=s.id AND
       ups.gchs_user_process_id=p_user_process_id
    GROUP BY s.name,ps.id
    ORDER BY 3 DESC) a
WHERE rownum <= 1 )
WHERE rnum >= 1;
   EXCEPTION
     WHEN OTHERS THEN
        ret:='';
   END;     
      RETURN ret;
  EXCEPTION
WHEN OTHERS THEN
       ret := '';
   RETURN ret;
END FN_REACHEDSTEP;
Now the problem is that the function sometimes return wrong value. The name of the step that is returned is not the one i get if i run the SQL by itself.
So doing a
SELECT substr(step_name,1,30),step_id,reached INTO ret,ret_id,ret_num
FROM (
SELECT a.*, rownum rnum
FROM (
    SELECT s.name AS step_name, ps.id AS step_id, max((ps.tier*1000)+ps.sortorder) AS reached
    FROM gchs_user_process_steps ups, gchs_process_steps ps, gchs_steps s
    WHERE ups.gchs_process_step_id=ps.id AND
       ps.gchs_step_id=s.id AND
       ups.gchs_user_process_id=21680
    GROUP BY s.name,ps.id
    ORDER BY 3 DESC) a
WHERE rownum <= 1 )
WHERE rnum >= 1;
and a
select fn_ReachedStep(21680) from dual;
will sometimes return different values.
So is the function fundamentally wrong or is there any cache or something that i've missed that could hold "old" function outputs or am i missing something else.
Thankful for any clues.
I'm using Oracle 10.2.0.1.0
Best regards
/Tomas
Edit: Here's some data that the system uses.
gchs_steps
ID           NAME
10000     Step 1
10020     Step 2
10021     Step 3
10022     Step 4
10023     Step 5
10060     Step 6
10140     Step 7
gchs_process_steps
ID          GCHS_STEP_ID      TIER     SORTORDER
10000     10000               0          1
10001     10020               1          1                                                                                                                   
10002     10021               1          2                                                                                                                   
10003     10022               2          1
10020     10023               3          5
10060     10060                3          4
10080     10140               3          2
10040     10040               3          3
10100     10160               4          3
10160     10220               4          2
11640     11640               3          1
11660     11660               0          6
11661     11661               0          7
11600     11600               0          4
11620     11620               4          1
gchs_user_process_steps
ID          GCHS_USER_PROCESS_ID     GCHS_PROCESS_STEP_ID
35541     21680                         10002
38441     21680                         10020
38440     21680                         10000
52062     21680                         10060
Relations beween table is
gchs_user_process_steps.gchs_process_step_id=gchs_process_steps.id
and
gchs_process_steps.gchs_step_id=gchs_steps.id
So doing the SQL alone will always return
SUBSTR(..)     STEP_ID REACHED
Step 5      10020 3005
but executing the function sometimes returns
FN_REACHEDSTEP(21680)
Step 6
Also removing the rownum limits return and doing a
SELECT s.name AS step_name, ps.id AS step_id, max((ps.tier*1000)+ps.sortorder) AS reached
FROM gchs_user_process_steps ups, gchs_process_steps ps, gchs_steps s
WHERE ups.gchs_process_step_id=ps.id AND
ps.gchs_step_id=s.id AND
ups.gchs_user_process_id=21680
GROUP BY s.name,ps.id,ps.tier, ps.sortorder
ORDER BY 3 DESC
give this result
STEP_NAME     STEP_ID     REACHED
Step 5          10020     3005
Step 6          10060     3004
Step 3          10002     1002
Step 1          10000     1
Edited by: user4935832 on 2008-sep-19 01:38

ORDER BY 3 DESC) a
WHERE rownum <= 1 )
WHERE rnum >= 1;Just some thoughts.
1. You could replace "ORDER BY 3" by "ORDER BY reached"
2. the rownum <=1 and rnum>=1 will return only one row... I don't understand the second one.
Lastly, the difference might come from a duplicate value return by your MAX() function.
If there is two rows (or more) with same MAX, Oracle might return one row arbitrary.
To get the same row, you have to use some aggregation function like MAX() KEEP (DENSE_RANK LAST...).
Here a try for your query, obviously not tested :
SELECT max(substr(step_name,1,30)) keep (dense_rank last order by reached) as step_name,
       max(step_id) keep (dense_rank last order by reached,step_name) as step_id,
       max(reached) as reached
FROM   (SELECT s.name AS step_name,
               ps.id AS step_id,
               max((ps.tier*1000)+ps.sortorder) AS reached
        FROM   gchs_user_process_steps ups,
               gchs_process_steps ps,
               gchs_steps s
       WHERE   ups.gchs_process_step_id=ps.id
       AND     ps.gchs_step_id=s.id
       AND     ups.gchs_user_process_id=21680
       GROUP BY s.name,ps.id) a;Nicolas.

Similar Messages

  • Report returns wrong data when run on server

    Hi,
    I'm runing CRS XI R2 on Windows Server 2003 SP2.  When I refresh a report in the Crystal Reports XI Designer, I'm getting correct data.  But when I schedule the report to run on the server it returns wrong data.  The data is different from what I see when I refresh it from the designer.  In the report I have running totals set up to count customers that meet a certain criteria.  The report is very large.  It take almost 2 hours to refresh.
    I was wondering what is causing the difference in running total data between refreshing it on the designer and running it on the server.  Is it returning wrong data b/c of it not reading all the records?  Should I be making any changes to the server settings?  I saw that under pageserver, there are options for  setting the 'Minutes Before an Idle Report Job is Closed' and 'Database Records To Read When Previewing Or Refreshing a Report".  Do either of those have anything to do with the report returning incorrect data when being scheduled to run on the server?
    Thanks,
    Kim

    Hi Xuandao,
    You would need to Use Cell Binding and Trigger concept to accomplish this.
    Its simple, however, you would have to work on a trial and error basis to understand this concept as implementing the same is subject to your dashboard and WEBI Design.
    Open you LiveOffice.
    Insert your WEBI, Now, go to Object Properties of your WEBI, select the second tab that says Prompt, Here, it lists the prompts that you have for your WEBI. This would also enlist your BEx variables as well. Select this BEx variable and click on the button that says Prompt at the bottom of this window. Here, select choose Excel Data Range and click on the cell select button on the right (small button that lets you choose what cell you want to bind this prompt to), Now select a free cell that would not be even populated later on when you run the dashboard say A1 (remember the value that you select). Click on OK and again OK. The WEBI Refreshes and you can see all the prompt values at the cell A1. These are all the possible values stored for your BEx prompt variables (these values are fetched from BW system dynamically).
    Now, save this LiveOffice, Go to you dashboard. Connect your dashboard to your Live office. Go to Data-> connections-> Now, select the WEBI and in the right hand pane  go to Usage tab, here, Click on Trigger cell button on the right hand side and select A1 in you LiveOffice.
    It should work fine.
    Let me know.
    Rgds,
    Sreekul Nair

  • JSObject returns wrong date. How can I extract correct date from digital signature?

    I'm trying to extract name and date from digital signatures by using JSObject in Excel VBA, but JSObject returns wrong date. Year, month, hour and minute are correct, but only day is incorrect.
    Here is my code. I'm using Acrobat 8.1.3.
    Please tell me what's wrong with this code and how I can extract correct date from digital signatures.
    Public Sub sbTest()
    Dim oApp As Acrobat.acroApp
    Dim oPDDoc As Acrobat.AcroPDDoc
    Dim jso As Object
    Dim f As Object
    Dim sig As Object
    Dim strFileName As String
    Set oApp = CreateObject("AcroExch.App")
    Set oPDDoc = CreateObject("AcroExch.PDDoc")
    strFileName = "C:\Test.pdf"
    If (oPDDoc.Open(strFileName)) Then
    Set jso = oPDDoc.GetJSObject
    Set f = jso.getField("Signature1.0")
    Set sig = f.signatureInfo()
    Debug.Print sig.Name
    Debug.Print sig.Date
    End If
    Call oPDDoc.Close
    Call oApp.Exit
    End Sub

    Hi
    You can use TDMS file format to save the data. I have attached a reference Vi.
    On button click you can log the data or remove the case structure and continuous log the complete acquisition data.
    Thanks and Regards
    Himanshu Goyal
    Thanks and Regards
    Himanshu Goyal | LabVIEW Engineer- Power System Automation
    Values that steer us ahead: Passion | Innovation | Ambition | Diligence | Teamwork
    It Only gets BETTER!!!
    Attachments:
    Data Save in File.vi ‏35 KB

  • I get an error when i try to execute a function that returns a date value

    Hi,
    I'm new in ODP.NET, i'm make a package that contains a function that returns a date i.e.
    Package Body General_pkg is
    Function Get_Day Return Date is
    vd_day date;
    Begin
    select sysdate into vd_day from dual;
    return vd_day;
    end Get_Day;
    End General_pkg;
    i use the next code to execute the function:
    OracleCommand cmdData = new OracleCommand("General_pkg.Get_Day", cnx);
    cmdData.CommandType = Commandtype.StoredProcedure;
    OracleParameter PRM;
    PRM = new OracleParameter();
    PRM.ParameterName = "VDATE";
    PRM.OracleDbType = OracleDbType.Date;
    PRM.Direction = ParameterDirection.ReturnValue;
    cmdData.Parameters.Add(PRM);
    try
    cmdData.ExecuteNonQuery();
    catch(OracleException e);
    When i execute this code, i have and exception, which say "identifier GENERAL_PKG.Get_Day must be declare..."
    Obviously the package is correctly created in ORACLE i tested first in sql plus and it works but in ODP.NET they don't recognize the package or the function i don't know... please help!!!

    OOOOOPSS.... i forgot that i change the user in my conecction string that's why it didn't work...
    i guess i had to much beer last night.;. :)
    thanks.

  • User defined function for removing wrong data ... !!!

    Hi  Experts,
    I'm having a source data like this
    1001     545     6895895     1584     654     5478
    1002     525     6895895     5084     654     5472
    1003     535     6895895     0584     654     5478
    1004     545     6895895     5184     654     5478     4XXX     &^%%     1004     545
    1005     555     6895895     5824     654     5478     8547     0000     522#     ##00
    1006     565     6895895     5844     654     5478
    1007     575     6895895     5845     654     5478
    1008     585     6895895     5846     654     5478
    Some times I get a wrong data in my source file (above 4 and 5 th rows) .
    My requirement is to remove these kind of wrong lines(entire lines to be removed) whenever XI reads the data. For this what is the standard function i can use in mapping. I thought I can create my own function to remove such kind of false data lines. It would be helpful for me if some body provide me the java code.
    Thanks very much.

    Hi Swarna,
    1001 545 6895895 1584 654 5478
    1002 525 6895895 5084 654 5472
    1003 535 6895895 0584 654 5478
    1004 545 6895895 5184 654 5478 4XXX &^%% 1004 545
    1005 555 6895895 5824 654 5478 8547 0000 522# ##00
    1006 565 6895895 5844 654 5478
    1007 575 6895895 5845 654 5478
    1008 585 6895895 5846 654 5478
    is it the .txt file you are keeping.  Or the input in your mapping.
    You just Tell your requirement properly.
    If it is input in Mapping. Map like this
    input ----->subtring( starting position 0 andNumber of characters 30) ---->Output
    substring is a standard Text function.
    Thanks.

  • NCo 3.02 crashes when invoking functions that return a date field

    I'm using NCo 3.02 (.NET 4 target framework) with Visual Studio 2010.
    When I invoke a function that returns date fields (like BAPI_SALESORDER_GETLIST) NCo crashes with the following message:
    SAP.Middleware.Connector.RfcTypeConversionException: Cannot convert DOCDATE....
    Below is the code I'm using:
    Dim customer_orderAPI As IRfcFunction = ecc.Repository.CreateFunction("BAPISALESORDER_GETLIST")
    customer_orderAPI.SetValue("CUSTOMER_NUMBER", "0000020000")
    customer_orderAPI.SetValue("SALES_ORGANIZATION", "ARCO")
    customer_orderAPI.SetParameterActive("MATERIAL", False)
    customer_orderAPI.SetParameterActive("DOCUMENT_DATE", False)
    customer_orderAPI.SetParameterActive("DOCUMENT_DATE_TO", False)
    customer_orderAPI.SetParameterActive("PURCHASE_ORDER", False)
    customer_orderAPI.SetParameterActive("TRANSACTION_GROUP", False)
    customer_orderAPI.SetParameterActive("PURCHASE_ORDER_NUMBER", False)
    customer_orderAPI.SetParameterActive("MATERIAL_EVG", False)
    customer_orderAPI.Invoke(_ecc)                ' >>>>  I receive the error in this line
    Dim table As IRfcTable = customer_orderAPI.GetTable("SALES_ORDERS")
    Dim returnCode As String = customer_orderAPI.GetStructure("RETURN").GetString("TYPE")
    If (returnCode.Equals("E") Or returnCode.Equals("A")) Then
    Console.WriteLine(customer_orderAPI.GetStructure("RETURN").GetString("MESSAGE"))
    Else
    Console.WriteLine("*********** SUCCESS **********")
    Console.WriteLine("Number of orders is .", table.RowCount)
    End If
    Does anyone know what is the issue and how to fix it?

    I'm using NCo 3.02 (.NET 4 target framework) with Visual Studio 2010.
    When I invoke a function that returns date fields (like BAPI_SALESORDER_GETLIST) NCo crashes with the following message:
    SAP.Middleware.Connector.RfcTypeConversionException: Cannot convert DOCDATE....
    Below is the code I'm using:
    Dim customer_orderAPI As IRfcFunction = ecc.Repository.CreateFunction("BAPISALESORDER_GETLIST")
    customer_orderAPI.SetValue("CUSTOMER_NUMBER", "0000020000")
    customer_orderAPI.SetValue("SALES_ORGANIZATION", "ARCO")
    customer_orderAPI.SetParameterActive("MATERIAL", False)
    customer_orderAPI.SetParameterActive("DOCUMENT_DATE", False)
    customer_orderAPI.SetParameterActive("DOCUMENT_DATE_TO", False)
    customer_orderAPI.SetParameterActive("PURCHASE_ORDER", False)
    customer_orderAPI.SetParameterActive("TRANSACTION_GROUP", False)
    customer_orderAPI.SetParameterActive("PURCHASE_ORDER_NUMBER", False)
    customer_orderAPI.SetParameterActive("MATERIAL_EVG", False)
    customer_orderAPI.Invoke(_ecc)                ' >>>>  I receive the error in this line
    Dim table As IRfcTable = customer_orderAPI.GetTable("SALES_ORDERS")
    Dim returnCode As String = customer_orderAPI.GetStructure("RETURN").GetString("TYPE")
    If (returnCode.Equals("E") Or returnCode.Equals("A")) Then
    Console.WriteLine(customer_orderAPI.GetStructure("RETURN").GetString("MESSAGE"))
    Else
    Console.WriteLine("*********** SUCCESS **********")
    Console.WriteLine("Number of orders is .", table.RowCount)
    End If
    Does anyone know what is the issue and how to fix it?

  • Function that returns the date/time ?

    We would like to make a validation in the Activity status based on the activity End Time.
    Pls... is there a function that returns something that I could compare with: "8/6/2009 01:00 PM" ?
    I know of Today but I understand that today() returns just the day (no time).
    Txs.
    Antonio

    Hi Antonio,
    You can try using the function -: Timestamp()
    To quote the CRM On Demand help files...
    "+The Timestamp function in Expression Builder returns the server date and time converted to the current user's time zone setting. For example, if the current user's time zone setting is set to Eastern Daylight Time (EDT) -0400 UTC, the Timestamp function converts the server time to EDT. The TimeStamp function performs UTC (universal time code) conversion. NOTE: Arithmetic operations (for example, add or subtract) are not supported with the Timestamp() function.+"
    Hope this helps.
    Regards,
    Cameron

  • Java.util.Calendar returning wrong Date object

    Example: This was my scenario last night. A server in California has date/time of 'Mon Aug 18'. Current time in Indiana is 'Sun Aug 17'. I use Calendar.getInstance(TimeZone.getTimeZone("America/Indiana/Indianapolis")) to return a Calendar instance. I then call the getTime() method on that instance. It should return a Date object relating to that particular time zone. It will not. It defaults back to the server time. When I print out the Calendar instance everything is good, correct date, correct time,etc. WHY WON'T THE getTime() return the correct java.util.Date???
    Following is the output was run today so the dates happened to be the same so focus on the Time. Output includes Server time, new Calendar values, and the Date returned by calendar instance getTime(). See that the Calendar is getting the correct Time.
    SERVER DATE=Mon Aug 18 15:52:13 CEST 2003
    CALENDAR INSTANCE=java.util.GregorianCalendar[time=1061214732975,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="America/Indiana/Indianapolis",offset=-18000000,dstSavings=0,useDaylight=false,transitions=35,lastRule=null],firstDayOfWeek=2,minimalDaysInFirstWeek=1,ERA=1,YEAR=2003,MONTH=7,WEEK_OF_YEAR=34,WEEK_OF_MONTH=4,DAY_OF_MONTH=18,DAY_OF_YEAR=230,DAY_OF_WEEK=2,DAY_OF_WEEK_IN_MONTH=3,AM_PM=0,HOUR=8,HOUR_OF_DAY=8,MINUTE=52,SECOND=12,MILLISECOND=975,ZONE_OFFSET=-18000000,DST_OFFSET=0]
    Date from getTime()=Mon Aug 18 15:52:12 CEST 2003

    I got it worked with using DateFormat.parse !
    The trick is to instantiate a new Date object as a result
    of parsing out of 'localized' date string.
    with below code :
    Calendar localCal = new GregorianCalendar(TimeZone.getTimeZone("America/Los_Angeles"));
    localCal.set(Calendar.DATE, 25);
    localCal.set(Calendar.MONTH, 7);
    localCal.set(Calendar.YEAR, 2003);
    localCal.set(Calendar.HOUR_OF_DAY,6);
    localCal.set(Calendar.MINUTE, 38);
    localCal.set(Calendar.SECOND, 11);
    Calendar sinCal = new GregorianCalendar(TimeZone.getTimeZone("Asia/Singapore"));
    sinCal.setTimeInMillis(localCal.getTimeInMillis());
    int date = sinCal.get(Calendar.DATE);
    int month = sinCal.get(Calendar.MONTH);
    int year = sinCal.get(Calendar.YEAR);
    int hour = sinCal.get(Calendar.HOUR_OF_DAY);
    int min = sinCal.get(Calendar.MINUTE);
    int sec = sinCal.get(Calendar.SECOND);
    String sinTimeString = date + "/" + month + "/" + year + " " + hour + ":" + min + ":" + sec;
    System.out.println("VIDSUtil.hostToLocalTime : time string now in SIN time : " + sinTimeString);
    java.util.Date sinTime = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").parse(sinTimeString);
    System.out.println("time in SIN using Date.toString(): " + sinTime.toString());
    It prints out :
    VIDSUtil.hostToLocalTime : time string now in SIN time : 25/7/2003 21:38:11
    time in SIN using Date.toString(): Fri Jul 25 21:38:11 PDT 2003
    (Ignore the PDT, because Date.toString() defaults where the JVM is running)

  • Strange issue - WD4A when called from EP returns wrong data

    Hi Experts,
    I am facing a very strange issue with WD4A. I have created one RFC. WD4A program calls this RFC. When I am executing the RFC using se37 it gives me 10 records. When I am executing the same RFC from WD4A program (Web Dynpro Application -- Right Click -
    test) the program is returning 10 records.
    I have created one iView in Portal. When I am calling the same program from portal, sometimes it returns 9 records and sometimes 10 records. I just refresh the iview and no of records getting displayed in screen changes.
    I have cheked the code many times. The code is perfectly fine.
    I have used clear and refresh command in the beginigng  of  RFC.
    What may be wrong? I have wasted my full dayfor resolving the issue. But I could not succeed.
    Is it due to some BASIS issue? Is it due to some server session issue?
    I have used business graphics in my application. Is it due to this? Whether IGS server and ECC contain different data?
    Please suggest
    Regards,
    Gary

    Hi Experts,
    The System configuration in the EP  is pointing to the right system and right client. I am using same setting for other Iviews. The other iViews are working fine.
    How we can apply break point in WDA. I beliveve I have to meet following requirement:
    1) Suppose EP user is 4755. The EP user 4755 is mapped to R/3 user 4755 and R/3 pernr 4755.
    2) Backend R/3 user 4755 should have se80
    3) Backend R/3 user should have debug access.
    The authorization will not provide such accesses for backend user 4755.
    Do we have any workaround?
    Please help.
    Regards,
    Gary

  • Date class of jdk 1.5.0 returns wrong Date.

    Hi All,
    i have a problem in my code with Date class in jdk 1.5.0.
    The code given below gives different output on two OS ( {color:#0000ff}both are placed at same place{color} )
    GregorianCalendar cal = new GregorianCalendar();
    Date today = cal.getTime();
    System.out.println("today: " + today);
    System.out.println("Hi !! current timeZone is :" +TimeZone.getDefault().getID());
    output ( on solaris 5.8) :--
    {color:#ff0000}today: Thu Sep 27 07:02:39 EDT 2007
    Hi !! current timeZone is :US/Eastern{color}
    output (on windows) :--
    today: Thu Sep 27 11:04:05 IST 2007
    Hi !! current timeZone is :Asia/Calcutta
    please, tell me, how this can be fixed?
    Thanks in Advance!

    I'm not sure I understand right. So this may be all wrong .
    But if you send actions between the two computers pick one of them and always refer to it's date.
    All you'd have to do is to init a calendar with the picked OS time, and time zone with time zone, and keep those two alive all the time. This way you'd have the same settings on both java applications (but not OSes).
    If you send actions I suppose you could just as well send the time settings.
    HTH

  • Infoset Query Returns Wrong Data

    Hi there exports,
    I created a infoset query based on 3 DSO's 0PUR_O01 (Purchase Order Items), 0PUR_DS03 (Purchase Order Item Schedule Line) & a Z-DSO (Material Consumption).
    I need information by PO Number (Item, Material) and the total consumption for that material from the Z-DSO irrespective what the item & PO Number is.
    My link to Z-DSO is material & plant. My problem is that the info from the orther 2 DSO is triple when I run my query.
    Any suggestions?
    Thank you
    Dirk

    Hi,
    This issue arrises due to the infoset property, ie. Infoset provides intersection of data.
    So for a single combination of material and plant in Z-DSO, there might be multiple (here 3)records in other two DSO so you get the triple amount in Query.
    Inorder to overcome it you must ideally join the DSO in a infoset based on the same key fields..
    Hope it helps..
    Regards..
    Umesh.

  • TCP Read w/ #bytes=4 returns wrong data.

    On an initial TCP Read to a just-open connection, I can read any number of bytes, always getting the first n bytes from the arriving data. Except when I try to read 4 bytes! Then I get 4 bytes, but they're the seventh through ninth bytes, not the first four. Haven't found any other number that gives problems - 1,2,3,5,6,7,8,16,40,1020,etc. all work fine. Ideas?

    You may want to try runnig the Data Client and Data Server example VIs which ship with LabVIEW and see if they work on your system. The Client example actually reads in 4 bytes every time. I ran it and it works fine, so if yours exhibits the behavior you've been seeing, then the problem could be with your connection. Otherwise, if the example does work, then it could be somewhere in your code. Let us know what you find.
    J.R. Allen

  • Web Services  from ABAP function modules return values- leading zeros

    I am using several web services from SAP CRM (5.0) that were created from Function modules ( I am assuming that that they are in ABAP).
    I can call the web services fine and they work as expected, but I am seeing a lot of leading zeros in the return values of fields in tables from the Web service.
    The ABAP er’s are telling me that they cannot see the leading zero’s.
    So my question is where these are appended to the values in the whole process. When I execute the Function Module in SAP CRM from transaction SE37 I can see the leading zeros. So I think that this is something that has to be handled by the ABAP er’s and not in the client consuming the web service.
    Are the functions in SAP CRM that can remove leading zeros for fields in a table (that is an export parameter?)
    Jawahar

    Hello Jawahar
    If you run your (RFC-enabled) function modules using the SAP-GUI (i.e. in dialog) then the GUI automatically replaces leading zero when the function module returns any data. However, calling the same function module remotely you will always see these leading zeros.
    These so-called conversion exits are defined as attribute of domains in the ABAP dictionary. If the function module used for the WebService is a standard fm then you have little chances to get rid of the leading zero. Perhaps the WebService has some attribute to suppress conversion exits or activate them when retrieving the data.
    Regards, 
       Uwe

  • Date function to pull back dates of the year?

    is there a built in function for returning all dates (whatever format) between to dates ?
    Example:
    Select functionname('2009/06/01', 'yyyy/mm/dd), ('2009/06/05', 'yyyy/mm/dd')
    from dual
    Wanted results
    2009/06/02
    2009/06/03
    2009/06/04

    Hi,
    user11210446 wrote:
    Here is what I'm trying to do,
    There is a start date and an end date. I have US holidays for current year in a table so for example christmas 12/25/2009
    I want to show dates between the start date and end date, and if there is a holiday on that date it will not show.
    make sense
    so if a user puts 12/23/2009 for start and 12/29/2009
    it would show
    12/24/2009
    12/26/2009
    12/27/2009
    12/28/2009Yes, that's very clear.
    I would actually do that with a NOT IN sub-query
    SELECT  TO_DATE ('&start_date', 'MM/DD/YYYY') + LEVEL - 1
    FROM     dual
    WHERE   TO_DATE ('&start_date', 'MM/DD/YYYY') + LEVEL - 1 NOT IN
            SELECT  appropriate_column
            FROM    holiday
    CONNECT BY LEVEL <= 1 + (TO_DATE ('&end_date', 'MM/DD/YYYY') - TO_DATE ('&start_date', 'MM/DD/YYYY'));where &start_date and &end_date are substitution variables in MM/DD/YYYY format. You could use bind variables just as well.
    This assumes the DATEs in holdiay are all midnight. If not, use TRUNC (appropriate_column).
    Edited by: Frank Kulash on Jun 4, 2009 12:59 PM
    There's nothing like clicking that "Save" button to give you better ideas!
    MINUS is a little simpler than NOT IN:
    SELECT  TO_DATE ('&start_date', 'MM/DD/YYYY') + LEVEL - 1
    FROM     dual
    CONNECT BY LEVEL <= 1 + (TO_DATE ('&end_date', 'MM/DD/YYYY') - TO_DATE ('&start_date', 'MM/DD/YYYY'));
    MINUS
    SELECT  appropriate_column     -- or TRUNC (appropriate_column)
    FROM    holiday
    ORDER BY 1;

  • HTMLDB_ITEM.SELECT_LIST function returns wrong result in 1.6?

    Look at following select statements:
    1. select flows_010600.htmldb_item.select_list(1,null,'Full;F,Read;R,No;N',
    '','YES',null,'Derived','f01_'||TO_CHAR(ROWNUM,'FM0000'),'D')
    from dual
    &lt;label for="f01_0001" class="hideMe508"&gt;D&lt;/label&gt;&lt;select name="f01" id="f01_0001"&gt;&lt;option value=""&gt;Derived&lt;/option&gt;&lt;option value="F" &gt;Full&lt;/option&gt;&lt;option value="R" &gt;Read&lt;/option&gt;&lt;option value="N" &gt;No&lt;/option&gt;&lt;option value="" selected="selected"&gt;&lt;/option&gt;&lt;/select&gt;
    2.select flows_010500.htmldb_item.select_list(1,null,'Full;F,Read;R,No;N',
    '','YES',null,'Derived','f01_'||TO_CHAR(ROWNUM,'FM0000'),'D')
    from dual
    &lt;label for="f01_0001" class="hideMe508"&gt;D&lt;/label&gt;&lt;select name="f01" id="f01_0001"&gt;&lt;option value=""&gt;Derived&lt;option value="F" &gt;Full&lt;option value="R" &gt;Read&lt;option value="N" &gt;No&lt;/select&gt;
    If selected value of list is null version 1.6 call adds extra item without display value. Version 1.5 call works fine. Is it a bug or implied behavior?

    Hi Alexey,
    This is the intended behavior; in your htmldb_item.select_list call, you are setting the current value to NULL. This is the value shown in 1.6. In 1.5 the first value from your list of values was shown. This behavior wasn't appropriate in most cases. If for example you had a tabular form with a select list and the values retrieved from the database were not part of the list of values used for the select list, it would basically default the select list to the first value from your list of values. If you then saved your tabular form, you would have ended up with the wrong data. Now the select list will show the actual value from the database, if it's not part of the list of values. Otherwise it will show the correct display value. If in your case this is not the behavior you need, you can simply turn that off by modifying your query to:
    select flows_010600.htmldb_item.select_list(1,null,'Full;F,Read;R,No;N',
    '','YES',null,'Derived','f01_'||TO_CHAR(ROWNUM,'FM0000'),'D','NO')
    from dual
    I simply added another attribute which is called p_show_extra and set it to 'NO'. Here's the full specification of the function:
    function select_list (
    p_idx in number,
    p_value in varchar2 default null,
    p_list_values in varchar2 default null,
    p_attributes in varchar2 default null,
    p_show_null in varchar2 default 'NO',
    p_null_value in varchar2 default '%null%',
    p_null_text in varchar2 default '%',
    p_item_id in varchar2 default null,
    p_item_label in varchar2 default null,
    p_show_extra in varchar2 default 'YES'
    ) return varchar2
    Hope this helps,
    Marc

Maybe you are looking for

  • Saving photo attachments from Mail to iPhone

    Merry Christmas The MMS debate and iPhone rages on and many iPhone fanatics say 'why do you need MMS when you can send/receive photos as email attachments...?'. If that's the case, is there any way you can save a photo received as an email attachment

  • Query regarding Business Partner Address in SAP B1?

    Hi Friends, WHile i extract SAP datas for my ETL Product,I found some issues..Hereby i m telling the steps to reproduce that in Demo database of OEC Computers.. 1.Open SAP B1 Business Partner data 2.Open C40001 Business partner data.. 3.Open Addresse

  • PO summary report

    Hi everyone, I want summary report on purchase orders created on last 12 months.  Following are some of the key information I am looking for in the report: 1. Total number of POs created in last 12 months 2. Total number of PO line items created in l

  • General issue with class declaration

    Hi all, Iam very new to OO programming. can any one tell as how i should call a CLASS FOR FM , i know we use click pattern and give the required FM name and it would bring up the code in the editor and we have to pass the necessary parameters but how

  • WS reliable messaging implementation in OSB

    Hi All, I have to implement relaible messaging through OSB service. I want to know 1. how reliable messaging can be implemented in OSB with proxy and bussiness service and how it can be tested? 2. The advantages of using WS transport to implement rel