Finding date diff

Hi friends,
I'm having doubt in time diff. Just assume this scenario.
Today is sunday and 13 hrs. I just want to know the difference between this and coming wednesday 01 hrs. But i don't know the date for coming wednesday. Is there any function available which returns the date for this coming wednesday. And i don't want to add 3 to the DAY_OF_MONTH part.

Today is sunday and 13 hrs. I just want to know the
difference between this and coming wednesday 01 hrs.
But i don't know the date for coming wednesday. Is
there any function available which returns the date
for this coming wednesday. And i don't want to add 3
to the DAY_OF_MONTH part.Your loose specification makes it difficult to be sure what you want but try this.
    public static void main(String[] args)
        // Now
        GregorianCalendar calendar = new GregorianCalendar();
        long nowInMilliseconds = calendar.getTime().getTime();
        // Move on to next wednesday
        while (calendar.get(Calendar.DAY_OF_WEEK) != Calendar.WEDNESDAY)
            calendar.add(Calendar.DAY_OF_YEAR, 1);
        // Set to 1 am
        calendar.set(Calendar.HOUR_OF_DAY, 1);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        // Difference in ms
        long betweenNowAndNextWednesday = calendar.getTime().getTime() - nowInMilliseconds;
        System.out.println(betweenNowAndNextWednesday + " " + calendar.getTime());
    }It should not be too dififcult to generalise it!

Similar Messages

  • Can not find data in virtual cube

    Experts,
    I can not find data in virtual cube with services function module (copying Z_RS_BCT_FIGL_DATA_GET_VC10 from RS_BCT_FIGL_DATA_GET_VC10).The standard cube is maintained with data.
    Can anybody tell me what could be the reasons the data is coming through Virtua cube.
    Thanks,
    AK

    Hi,
    i_basic_infoprov is the name of the provider where the data is selected from. This must be a basic provider that contains data. What I meant was, create a copy of fm RS_BCT_FIGL_DATA_GET_VC,1 maybe as Z_BCT_FIGL_DATA_GET_VC1, and enter the name of this fm in the properties of your virtual cube. For that fm it might also be a good idea to enter a default value for i_infoprov. And this should be the name of your virtual cube.
    regards
    Siggi

  • Unable to find data source

    Hi All,
    we have installed standard cubes and ODS from Business content. Now we want to load standard ODS but we are unable to identify standard data source.
    0CPR_C03 -  Infocube.
    We have already checked in BI Content and help.sap.com but it doesnot display any data source name.
    Kindly give input to find data source.
    Regards,
    Sathvik

    Hi,
    Now you got some clue, i.e. some datasource names supports the cube.So in that you need to analyze what feilds you want to and in which datasource you have all that feilds in that way you need to use the DS. For any other information you need to check in sap help sites, here I'm giving some tables in BW, so it will help you.
    RSISOSMAP Mapping Between InfoSources and DataSources (=OLTP Sources)
    RSOSFIELDMAP Mapping Between DataSource Fields and InfoObjects
    RSTS Transfer Structure in SAP BW
    ROOSGEN Generated Objects for a DataSource
    ROOSOURCE Header Table for SAP BW DataSources (SAP Source System/BW System)
    RODELTAM BW Delta Procedure (SAP Source System)
    RSOLTPSOURCE Replication Table for DataSources in BW
    Thanks
    Reddy

  • Unable to find data in RSA3 for particular fields2lis_04_p_arbpl datasource

    I am working with datasource 2lis_04_p_arbpl to construct Yield Report. I have a field GAMNG(Target Quantity) in the table AFKO, so I added it to the communication structure and activated it. I also want the field IGMNG(confirmed quantity) which is available in the table AFKO but not appearing in the pool tables of ARBPL datasource, so I have done datasource enhancement and obtained the field in the datasource. When I am checking for the data in RSA3, unable to find data(zero values) for both the fields.
    Edited by: bhagav on Jan 5, 2012 1:20 PM

    Hi ,
    Please make sure that you are doing the extractor check in Update mode 'Full' .If the setup tables are filled then this should pick the data for the 2 newly added fields .
    check and update accordingly later .
    Thanks
    Kamal Mehta

  • Unable to find data source null [Caused by: jdbc/Apps1DataSource not found]

    Hi,
    I am using OA Adapter which listens to an EBiz HRMS event, and I am encountering the following error in $Home\j2ee\oc4j_soa\log\oc4j_soa_default_group_1\oc4j\log.xml while registering the ESB service.
    Error details:
    <MSG_TEXT>Failed to process control event for Service "DefaultSystem.SyncWorkerPartyEbizOAAdapter" due to an error while adding the Service! Reason : oracle.tip.esb.server.common.exceptions.BusinessEventFatalException: An unhandled exception has been thrown in the ESB system. The exception reported is: "ORABPEL-12517
    AdapterFrameworkImpl::endpointActivation - Endpoint Activation Error.
    The Resource Adapter Oracle Applications Resource Adapter was unable to activate the endpoint oracle.tip.adapter.apps.AppsWFBesQueueDequeueActivationSpec:{MessageSelectorRule=tab.user_data.event_name = 'oracle.apps.per.api.person.update_person', QueueName=WF_BPEL_Q, Consumer=ORA_6krj2dpn70s36c1g6h1k8dhi8h, DatabaseSchema=APPS, AppsEventSchema=ANY_SCHEMA} due to the following reason: javax.resource.ResourceException: Unable to find data source null Caused by: jdbc/Apps1DataSource not found
    Please correct the reported issue and redeploy the BPEL process.
         at oracle.tip.adapter.fw.jca.AdapterFrameworkImpl.endpointActivation(AdapterFrameworkImpl.java:566)
         at oracle.tip.esb.server.service.impl.inadapter.ESBActivationAgent.activateInboundJcaEndpoint(ESBActivationAgent.java:390)
         at oracle.tip.esb.server.service.impl.inadapter.ESBActivationAgent.performEndpointActivation(ESBActivationAgent.java:306)
         at oracle.tip.esb.server.service.impl.inadapter.ESBActivationAgent.activateEndpoint(ESBActivationAgent.java:236)
         at oracle.tip.esb.server.service.impl.inadapter.ESBActivationAgent.activateEndpoint(ESBActivationAgent.java:209)
         at oracle.tip.esb.server.service.impl.inadapter.InboundAdapterService.activateEndpoint(InboundAdapterService.java:177)
         at oracle.tip.esb.server.service.impl.inadapter.InboundAdapterService.activateService(InboundAdapterService.java:119)
         at oracle.tip.esb.server.service.EsbServiceFactory.activateEsbService(EsbServiceFactory.java:222)
         at oracle.tip.esb.server.service.EsbServiceFactory.addEsbService(EsbServiceFactory.java:240)
         at oracle.tip.esb.server.common.RuntimeESBSystem.addService(RuntimeESBSystem.java:211)
         at oracle.tip.esb.common.system.ServiceEventsHandler.handleCreateService(ServiceEventsHandler.java:72)
         at oracle.tip.esb.common.system.MetadataChangeListener.handleServiceEvent(MetadataChangeListener.java:136)
         at oracle.tip.esb.common.system.MetadataChangeListener.onMetadataChange(MetadataChangeListener.java:85)
         at oracle.tip.esb.common.control.ControlMessageHandler.handleMessage(ControlMessageHandler.java:115)
         at oracle.tip.esb.server.dispatch.agent.ESBWork.process(ESBWork.java:162)
         at oracle.tip.esb.server.dispatch.agent.ESBWork.run(ESBWork.java:120)
         at oracle.j2ee.connector.work.WorkWrapper.runTargetWork(WorkWrapper.java:242)
         at oracle.j2ee.connector.work.WorkWrapper.doWork(WorkWrapper.java:215)
         at oracle.j2ee.connector.work.WorkWrapper.run(WorkWrapper.java:190)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:814)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: javax.resource.ResourceException: Unable to find data source null
         at oracle.tip.adapter.apps.AppsManagedConnectionFactory.getDataSourceConnection(AppsManagedConnectionFactory.java:411)
         at oracle.tip.adapter.apps.AppsManagedConnectionFactory.getConnection(AppsManagedConnectionFactory.java:288)
         at oracle.tip.adapter.apps.AppsManagedConnection.getConnection(AppsManagedConnection.java:85)
         at oracle.tip.adapter.apps.AppsConnection.getJdbcConnection(AppsConnection.java:70)
         at oracle_tip_adapter_apps_AppsConnection_Proxy.getJdbcConnection()
         at oracle.tip.adapter.aq.database.MessageReader.establishDBconnection(MessageReader.java:358)
         at oracle.tip.adapter.aq.database.MessageReader.&lt;init>(MessageReader.java:265)
         at oracle.tip.adapter.aq.inbound.AQActivationSpecDequeuer.init(AQActivationSpecDequeuer.java:142)
         at oracle.tip.adapter.aq.AQEndpoint.&lt;init>(AQEndpoint.java:99)
         at oracle.tip.adapter.aq.AQResourceAdapter.endpointActivation(AQResourceAdapter.java:73)
         at oracle.tip.adapter.apps.AppsResourceAdapter.endpointActivation(AppsResourceAdapter.java:147)
         at oracle.tip.adapter.fw.jca.AdapterFrameworkImpl.endpointActivation(AdapterFrameworkImpl.java:541)
         ... 20 more
    Caused by: javax.naming.NameNotFoundException: jdbc/Apps1DataSource not found
         at com.evermind.server.rmi.RMIServerContext.lookup(RMIServerContext.java:207)
         at com.evermind.server.ApplicationContext.unprivileged_lookup(ApplicationContext.java:257)
         at com.evermind.server.ApplicationContext.lookup(ApplicationContext.java:197)
         at javax.naming.InitialContext.lookup(InitialContext.java:351)
         at oracle.tip.adapter.apps.AppsManagedConnectionFactory.getDataSourceConnection(AppsManagedConnectionFactory.java:408)
         ... 31 more
    </MSG_TEXT>
    I have added the connection properties in $Home\j2ee\oc4j_soa\application-deployments\defaul\oc4j-ra.xml as follows:
    <connector-factory location="eis/Apps/apps1" connector-name="Oracle Applications Adapter">
         <config-property name="xADataSourceName" value="jdbc/AIADataSource"/>
         <config-property name="dataSourceName" value=""/>
         <connection-pooling use="none">
         </connection-pooling>
         <security-config use="none">
         </security-config>
    </connector-factory>
    Please correct me if the connection properties are wrong.
    I tried AppsEventSchema with 'NO-SCHEMA' and 'ANY-SCHEMA' also.
    If I use File Adapter I was able to register the ESB and instances were created successfully.
    My versions:
    JDEV:      10.1.3.3.0
    SOA:     10.1.3.3.0
    I have done a lot of research on this but in vain. Is there any patch for rectifying this error?
    Help me on this issue pl.
    Regards
    RK

    You need to check your datasource name jdbc/AIADataSource
    Check out your data-sources.xml to make sure you didn't mistype it.

  • In which table in CRM can i find data in business activity details?

    Hi
    In which table in CRM can i find data entered in business activity details in opportunity transaction.
    Please advice .
    Thanks,
    Vaishnavi

    found the table name CRMD_Activity_H

  • In 4.1 BO Client Tools not able to find data source  for BVM

    Hi All,
    In 4.1 BO Client Tools not able to find data source  for BVM
    Its creating issue .
    So if any body have any solution please let me know.
    Regards,
    Abhishek

    java.lang.NoSuchMethodError: org.w3c.dom.Node.getTextContent()Ljava/lang/String;
         at customertree.XmlLoader.readData(XmlLoader.java:127)
         at customertree.XmlLoader.<init>(XmlLoader.java:69)
         at customertree.CustomerTreeFinal.jbInit(CustomerTreeFinal.java:240)
         at customertree.CustomerTreeFinal.init(CustomerTreeFinal.java:858)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source
         at java.lang.Thread.run(Unknown Source)and then inside the code... this is where i get my first error
    clients.setRowId(list2.item(i).getTextContent());

  • Function Module to find date by passign the Planning Calendar

    Hi All,
    Can you tell me is there any function Module to find date by passign the Planning Calendar?
    The requirement is i have a planning calender assigned to the Material in the MRP2 view.
    Example: Material XXXXXX is assigned a Planning Calendar Z01.
    Z01 is defined such that Delivery is on Monday only. This calendar says that the material is received from the Vendor only on Mondays.
    So whenever i punch a Sales Order for Material XXXXXX, a PR is automatically geenrated when saving the sales order and the calculation of Delivery dates is also happening at this level.
    Basing on this PR a PO is raised to a Vendor for procuring the Material XXXXXX, now my problem is for example the PO is raised today (30.04.2008), but the Materail XXXXXX is available only on next monday in my plant (05.05.2008) basing on my Planning Calendar assigned in the Materail Master, so i have to inform this dealy to my customer at the time of punching the sales order.
    So is there any function Module to find date by passign the Planning Calendar?
    Thanks for your valuable inputs.
    Regards,
    Sudarshan

    Hi Jorge,
    Thanks for your reply.
    I am unable to open the Function module which you have mentioned below.
    I am working on 4.6 c version of SAP.
    Any ways i have found one function module which is useful to my requirement as stated below:
    DATE_GET_PERIOD
    Thanks and Regards,
    Sudarshan

  • System Not coming in Find Data

    Hi,
    I added a new JDBC system in portal in Visual Composer folder, created alias, done usermapping and my connection tests are successful.
    But when i tried to access it from VC, its not coming up in Find data tab.
    I am getting the following message in status area
    <b>0001> Welcome to Visual Composer
    0002> com/sap/portal/connectivity/destinations/IPortalSystemLandscapeRetriever</b>
    Any ideas?
    Regards,
    Sooraj

    Hi,
    There is a message box saying no BI systems are configured with the portal when i try BI integration wizard.
    Regards,
    Sooraj

  • Find data same kind in Oracle dBase SQL

    Hello all
    I'm working on a project were i need to find data that are cross referencing in between them (Redundant data).
    I explain:
    I have this SQL that i use all the time to extract trailer per carrier ID:
    SELECT NULL,
         NULL,
         TRC.TL_RESOURCE_ID,
         TRC.CARRIER_ID,
         TRC.PERIOD,
         TRC.MAX_LOADS,
         TRC.CONTRACT_MAX_TEAMS,
         TRC.CURRENT_MAX_TEAMS,
         TRC.PERCENT_COMMIT,
         L.NAME,
         R.NAME AS REGION_NAME,
         RD.KEY_NUM,
         RD.LOW_KEY_VALUE,
         RD.HIGH_KEY_VALUE,
         R1.NAME AS REGION_NAME_1,
         RD1.KEY_NUM,
         RD1.LOW_KEY_VALUE,
         RD1.HIGH_KEY_VALUE,
         NULL,
         NULL,
         TRT.TRLR_TYPE_ID,
         to_char(TRT.EFFECTIVE, 'yyyymmdd'),
         TRT.CONTRACT_NUM_VEHICLES,
         TRT.CURRENT_NUM_VEHICLES
    FROM TL_RESOURCE_CARRIER TRC,
         TL_RESOURCE_TRLR TRT,
         LANE L,
         REGION R,
         REGION R1,
         REGION_DETAIL RD,
         REGION_DETAIL RD1
    WHERE TRC.TL_RESOURCE_ID = TRT.TL_RESOURCE_ID
         AND R.ID = RD.REGION_ID
         AND R1.ID = RD1.REGION_ID
         AND TRC.LANE_ID = TRT.LANE_ID
         AND TRC.CARRIER_ID = TRT.CARRIER_ID
         AND L.ID = TRC.LANE_ID
         AND L.ID = TRT.LANE_ID
         AND L.FROM_REGION_ID = RD.REGION_ID
         AND L.TO_REGION_ID = RD1.REGION_ID
         AND TRC.CARRIER_ID = 'UPS';What we see in these fields bellow are Location ID or Postal Code or States value from an origin to a destination:
    RD.LOW_KEY_VALUE, (Origin)
    RD1.LOW_KEY_VALUE, (Destination)
    Ex:
    H7S 2B9 (Postal code)
    QC (State) etc...
    In these 2 fields bellow, i have keys that link to a specific type of data:
    RD.KEY_NUM,
    RD1.KEY_NUM,
    Ex:
    4 (State)
    8 (Postal code) etc...
    In TRC.CARRIER_ID field, i will have the Carrier ID ex: UPS
    Now here comes my problem:
    I have to link this to the location table to validate for example the postal code is in what state for example.
    4 IN (RD.KEY_NUM) AND (EXISTS (SELECT STATE FROM LOCATION WHERE STATE IN (RD.LOW_KEY_VALUE))
    8 IN (RD.KEY_NUM) AND (EXISTS (SELECT ZIP FROM LOCATION WHERE ZIP IN (RD.LOW_KEY_VALUE, ))If i have UPS carrier ID set from origin postal 7 : H7S 2B9 to Destination postal 7 : G0L 2K0
    and also UPS carrier set from origin postal 7 : H7S 2B9 to Destination State : QC
    Since we have the same carrier, and the same origin postal 7 and that the destination postal 7 equal the destination state from the second record, i need to see that i have these 2 lanes that are overlapping.
    I'm trying to extract all duplicated data like this.
    I know this is kind of a big thing but it can be done in multiple set of you want.
    I just need to start from the beginning.
    Can you please help me?
    Thanks again
    Edited by: 974487 on Dec 2, 2012 2:22 PM

    Hello all
    sorry for the big delay.
    I was working on the SQL;
    I have now this error:
    ORA-01427: single-row subquery returns more than one row
    On this part of the code:
    ( select distinct carrier_id, low_key_value, (select state from location would you know what it is?
    Thanks again
    Full code
    with S1   -- with constuction enables to use selected data twice
    AS
    SELECT NULL,
          NULL,
          TRC.TL_RESOURCE_ID,
          TRC.CARRIER_ID,
          TRC.PERIOD,
          TRC.MAX_LOADS,
          TRC.CONTRACT_MAX_TEAMS,
          TRC.CURRENT_MAX_TEAMS,
          TRC.PERCENT_COMMIT,
          L.NAME,
          R.NAME AS REGION_NAME,
          RD.KEY_NUM,
          RD.LOW_KEY_VALUE,
          RD.HIGH_KEY_VALUE,
          R1.NAME AS REGION_NAME_1,
          RD1.KEY_NUM,
          RD1.LOW_KEY_VALUE as LOW_KEY_VALUE_1,            -- as added
          RD1.HIGH_KEY_VALUE as HIGH_KEY_VALUE_1,          -- as added
          NULL,
          NULL,
          TRT.TRLR_TYPE_ID,
          to_char(TRT.EFFECTIVE, 'yyyymmdd'),
          TRT.CONTRACT_NUM_VEHICLES,
          TRT.CURRENT_NUM_VEHICLES
    FROM TL_RESOURCE_CARRIER TRC,
          TL_RESOURCE_TRLR TRT,
          LANE L,
          REGION R,
          REGION R1,
          REGION_DETAIL RD,
          REGION_DETAIL RD1
    WHERE TRC.TL_RESOURCE_ID = TRT.TL_RESOURCE_ID
          AND R.ID = RD.REGION_ID
          AND R1.ID = RD1.REGION_ID
          AND TRC.LANE_ID = TRT.LANE_ID
          AND TRC.CARRIER_ID = TRT.CARRIER_ID
          AND L.ID = TRC.LANE_ID
          AND L.ID = TRT.LANE_ID
          AND L.FROM_REGION_ID = RD.REGION_ID
          AND L.TO_REGION_ID = RD1.REGION_ID
    select s2.*
    from
    select carrier_id, low_key_value, low_key_1_state 
    from
    ( select distinct carrier_id, low_key_value, (select state from location
      where zip = s1.LOW_KEY_VALUE_1
             or city =  s1.LOW_KEY_VALUE_1
             or state = s1.LOW_KEY_VALUE_1
      and rownum = 1   -- because there are more rows with same city or same state
      )  low_key_1_state,  low_key_value_1
    from s1
    group by carrier_id, low_key_value, low_key_1_state
    having count(*) > 1 -- select duplicates
    )       s2

  • Finding data element

    hi
       i m new to idoc.i m trying to create the segment.in that i have 5 fields but i m not getting how to find data element for those fields.In y requirement they have just given fields like 
    Idoc   field                         XT01 message                          Description      
    FUNLOC_OWNER     C069_StockOwnerFunloc     STOCK OWNER FUNLOC
    M, 1      Format          Value
    M     N6     fixed value '000000'
    so how to find the data element of this field..plz help me...
    thnx

    Hi,
    Go to se11 -> give any datatype name > Press F4> serach for dataelements --> popup will come 'Press Information system and give datatype and length. --> you can find your dataelement.
    Regards
    Bhupal Reddy

  • Date Diff Issues

    1. Subscriber – Employee Details has these three records
    2. Call Details  has these two records
    My main goal is to populate date diff in table 1 as 1 if "work order check in date" >= 3 of Aspect calender date from the 2nd table.
    The Problem i am facing is that the date diff in table 1 does not populate. I have come to an understanding that the issue is because of many t many relationship between table 1 and table 2. Is there a way to work around this?
    Date Diff formula - If(DaysBetween([Work Order Check In Date];[Base2]) >=3 ;1;0)

    Hi Akshay
    Did you try removing If condition and able to see the date difference result,if so is it working fine or not? If it is working fine use this result and define another variable for If-else and validate the condition
    Regards
    Bose

  • System Alias is not coming in dropdown of System under Find Data Services

    I am having role in VC.
    In Visual Composer studio. I Clicked on Find Data option at right pane of the window to get
    Find Data Services window.
    In this window, I am not able to see the system alias from the dropdown list of the System field.
    Appreciate your help.

    Hi
    Inside Visual Composer , Goto Tools >Options> Compiler .
    Remove the Checkbox for Mask Unsupported Features.
    Click Ok.
    Now try the Find Data
    It worked for me.
    Regards
    Rajendra

  • How to find data base tables for a particular  trancation code

    Dear All,
    Is there any T.code for finding data base tables used in  a particular transaction code(Eg.: MM01).
    Regards,
    Satyapalli

    Hello Satya
    There is a very useful function module available for your requirement:
    <b>RS_PROGRAM_TABLES</b>
    Call this function module using:
    OBJECT_TYPE  = 'TRAN'       " transaction
    OBJECT_NAME = 'VA01'
    " PROGRAM  -> not required
    MONITOR_ACTIVATE = 'X'
    The function module will list you all DB tables touched by the transaction and shows whether they are read or updated (unfortunately, on ECC 5.0 this seems to be no longer the case. All tables are displayed as READ).
    Regards
      Uwe

  • In which table can I find data about payment runs (F110)

    Good morning,
    Can anyone tell me in which table I can find data about payment runs,which are carried out via transaction F110?
    Data about dunning runs can be found in table MAHNV, KNB5 & LFB5.
    Thank you.
    Kind regards,
    Linda

    Hi
    See in REGUH and REGUP. Also for Check payments, it can be seen in PAYR
    Jayaram

Maybe you are looking for