Re-Initializing Date object in a Thread

Hi ppl,
I am actually using a Thread, in which i check the current system time, to perform an operation.
I use a GreagorianCalendar Object to get the Current Time.
Calendar d = new GregorianCalendar();The time value stored in the object remains the same throughout the process. Therefore, i reinitialize the object every Millisecond to update the object with the current time.
d = new GregorianCalendar();Is there any other optimal way to perform this ?
If this is the only way possible, does it, in any way, affect the Memory, since Object is reinitialized every millisecond. If so, what could be the best possible solution ?
Code :
To perform a particular operation at 09:00:00:000
import java.util.Calendar;
import java.util.GregorianCalendar;
public class SampleThread implements Runnable{
     public void run() {
          try
               Calendar d = new GregorianCalendar();
               while(d.get(Calendar.HOUR)!= 9 ||
                         d.get(Calendar.MINUTE)!=0 ||
                         d.get(Calendar.SECOND) != 0 ||
                         d.get(Calendar.MILLISECOND) != 0 )
                    Thread.currentThread().sleep(1);
                    d = new GregorianCalendar();
               System.out.println("Operation Executed at : "+d.getTime());
               Thread.currentThread().sleep(1000);
               d = new GregorianCalendar();
               Thread.currentThread().run();
          catch (InterruptedException e)
               e.printStackTrace();
     public static void main(String a[])
          SampleThread st = new SampleThread();
          Thread t = new Thread(st);
          t.start();
}can the above code be optimized in any way ?

Hi,
Your problem is not the TimerTask, but the way you compute a specific time. Run the following program and you will see what is wrong:
import java.text.DateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
public class Tomorrow {
    public static void main(String[] args) {
     DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG,
          DateFormat.LONG);
     System.out.println("Your start time is today:       "
          + dateFormat.format(getTomorrowMorning4am()));
     System.out.println("Correct start time is tomorrow: "
          + dateFormat.format(tomorrow9am()));
    private static Date getTomorrowMorning4am() {
     Calendar tomorrow = new GregorianCalendar();
     Calendar result = new GregorianCalendar(tomorrow.get(Calendar.YEAR),
          tomorrow.get(Calendar.MONTH), tomorrow.get(Calendar.DATE), 9, 0);
     return result.getTime();
    private static Date tomorrow9am() {
     Calendar calendar = Calendar.getInstance();
     calendar.add(Calendar.DAY_OF_YEAR, 1);
     calendar.set(Calendar.HOUR_OF_DAY, 9);
     calendar.set(Calendar.MINUTE, 0);
     calendar.set(Calendar.SECOND, 0);
     calendar.set(Calendar.MILLISECOND, 0);
     return calendar.getTime();
}The start time you supply has already been expired when you invoke scheduleAtFixedRate.
There is a second problem: the interval. What will happen when daylight saving time comes into effect?
In your case, scheduling at a specific time of the day, you may consider canceling the timertask after completion and schedule a new timertask.
Piet

Similar Messages

  • Problem with initial download of a data object

    Dear All,
    I have created a data object named "EQUIPMENT", which has three nodes. EQUIPMENT is the header node, DETAILS is the child node to EQUIPMENT and LOCATION is the child node to DETAILS. I have also done explicit key mapping to DETAILS and LOCATION.
    I have selected the following as the BE Keys in the nodes.
    SERIAL NO in EQUIPMENT header node.
    TYPE in DETAILS node.
    ZIPCODE in LOCATION node.
    In the explicit key mapping of DETAILS node we have selected "SERIAL NO" field in this node.
    In the explicit key mapping of LOCATION node we have selected "SERIAL NO" and "TYPE" fields in this node.
    Data object contains no errors and i have activated the data object and it was successful.
    Then i have also created back adapter which has EQUIPMENT get list and get detail. Get list returns only serial numbers (which is the BE key in EQUIPMENT node). Get detail takes "serail no" as input, returns "DETAILS" and "LOCATION" data in tables parameter. I have tested the get list and get detail interfaces, they are working fine. Then i have activated back end adapter and that was successful.
    Now i have triggered an initial download for the  "EQUIPMENT" data object, but there is no data downloaded into the data object. I have checked the monitoring in administration portal, it is showing status "Ended with errors", but there is no details of an error.
    So can you please let me know what could be mistake i have done or how to check what is the error. Please help us to resolve the issue.
    Regards,
    Kiran.

    Hi Kiran
    Are you checking in the NWMA>>Monitoring>>Logs and Traces>>Backend Integration?  The logs should have the proper error.
    If not can you regenerate the DO, edit and activate your adapter and try again?
    Regards
    Rohith

  • How do you separate global data running in different threads of TestStand

    I have created a DLL which I want to call from multiple threads of TestStand. I also need to have some global data that is local to each thread. VC++ allows me to use the declaration:
    __declspec(thread) int foo
    to create "Thread Local Storage"
    (ie global data that is local in the each thread -- not shared between threads).
    This works fine from a VC++ application, but when I try to access data declared with this from Test Stand I get the following error.
    Win32error code 998 - Invalid access to memory location
    This occurs when I try to set a variable declared using this convention in my DllMain function.
    I get a -17502; System Level Exception when I access it from a function that I call in the DL
    L.

    Russell -
    I found the following comment in Microsoft's MSDN and I know that TestStand dynamically loads DLLs:
    If a DLL declares any nonlocal data or object as __declspec( thread ), it can cause a protection fault if dynamically loaded. After the DLL is loaded withLoadLibrary, it causes system failure whenever the code references the nonlocal __declspec( thread ) data. Because the global variable space for a thread is allocated at run time, the size of this space is based on a calculation of the requirements of the application plus the requirements of all of the DLLs that are statically linked. When you use LoadLibrary, there is no way to extend this space to allow for the thread local variables declared with __declspec( thread ). Use the TLS APIs, such as
    TlsAlloc, in your DLL to allocate TLS if the DLL might be loaded with LoadLibrary.
    Scott Richardson (NI)
    Scott Richardson
    National Instruments

  • How to send data to bam data object through java code

    how to send data to bam data object through java code

    I've made a suggestion in other thread: https://forums.oracle.com/thread/2560276
    You can invoke BAM Webservices (Using Oracle BAM Web Services) or use JMS integration using Enterprise Message Sources (http://docs.oracle.com/cd/E17904_01/integration.1111/e10224/bam_ent_msg_sources.htm)
    Regards
    Luis Fernando Heckler

  • Saving Data Objects in INDX-Type Database

    Hi,
    I am using the EXPORT statement to store data in a table into INDx table.
    EXPORT gt_update TO DATABASE indx(tt) ID index.
    And then I am using IMPORT statement to get that data.
    IMPORT gt_update to tb_update FROM DATABASE indx(tt) ID 'TTUPDATE'.
    The 'TT' is put into INDX- RELID and 'TTUPDATE' into INDX-SRTFD.
    The Export statement was working fine and a record got created in INDX table, but the IMPORT is not working. Can anyone please let me know what could be the problem ?
    'gt_update' and 'tb_update' are of the same type in the IMPORT statement.
    Also please let me know what exactly is the significance of the field INDX-SRTF2.
    Thanks a lot in Advance.

    My reason for using data clusters is that there is huge amount to data to be retrieved from database, so we have decided to get that data and put it in data clusters for faster access of data in the program.
    INDX tables are ideal to store complex strcutures, inlcuding deep data objects. Don't really know if the access is faster, but definitely it takes less space (as data are compressed).
    But I have a doubt, Ideally we should be having another program with the SELECT statement on the table required which needs to be scheduled periodically as a background job to Update the data cluster right ? Otherwise how would the data cluster hold the latest data ?
    It really depends on where you initial data comes from. I mean how data you want to put/update in data cluster are produced. If this is the report, which generates some result and based on that you want to update data cluster, then what you say is true. You would need to run it either manually (periodically) or simply schedule the job, which does the task.
    But as for the update of data cluster itself, I don't think we should use OPEN SQL statements to achieve that.
    What I think you have to do is, each time do a select to know which cluster to extract, then import the result. Next you need to change gt_update locally and place it back (with export) on right data cluster place. Data with same name under same RELID and cluster key will be completely replaced with new (changed) table.
    This is the only way I think of in terms of data cluster update, but maybe there is some other.
    Regards
    Marcin

  • Facing lot of problems with the DATA object  -- Urgent

    Hi,
    I am facing lot of problems with the data object in VC.
    1. I created the RFC initially and then imported the data object in to VC. Later i did some modifications to RFC Function module,and when i reload the data object, I am not able to see the new changes done to RFC in VC.
    2. Even if i delete the function module, after redeploying the IVIew, results are getting displayed.
    3. How stable is the VC?
      I restarted the sql server and portal connection to R3 is also made afresh.... still i am viewing such surprise results..
    please let me know what might be the problem.

    Hi Lior,
    Are u aware of this problem.
    If yes, please let me know...
    Thanks,
    Manjunatha.T.S

  • Delete a row from a data object using an AQ-driven EMS

    Hello, technetwork.
    I need to show the contents of a table that changes frequently (inserts, updates and deletes) at ORDBMS 10g in my BAM dashboard.
    What i have done is:
    - Create two different queue tables, queues.
    - Create two triggers: one for "AFTER insert or UPDATE" and the other for "BEFORE DELETE".
    - Create two EMS, one configured to Upsert operations and the other to Delete.
    - The Upsert EMS works, but the Delete EMS does not.
    - Both EMS Metrics say that they work fine and commit the messages i send to the ADC.
    - Testing showed records are populated and updated in the ADC but never deleted.
    There is a detailed user case for "Creating an EMS Against Oracle Streams AQ JMS Provider" in the Fusion Midleware Developer's Guide for SOA Suite, but it deals only with Upserts. I am using the last versions of SOA suite and Weblogic. The official support has no information either.
    I hope writing a web service client isn't the only way to delete a row from a data object. Am i missing something? Any help will be much appreciated.
    My EMS config:
    Initial Context Factory: weblogic.jndi.WLInitialContextFactory.
    JNDI Service Provider URL: t3://<spam>:80.
    Topic/Queue Connection Factory Name: jms/BAMAQTopicCF.
    Topic/Queue Name: jms/ProdGlobalBAMD_flx.
    JNDI Username: .
    JNDI Password: .
    JMS Message Type: TextMessage.
    Durable Subscriber Name (Optional): BAM_ProdGlobalBAMD.
    Message Selector (Optional): .
    Data Object Name: /bam/ProdGlobalBAM_flx.
    Operation: Delete.
    Batching: No.
    Transaction: No.
    Start when BAM Server starts: No.
    JMS Username (Optional): .
    JMS Password (Optional): .
    XML Formatting
    Pre-Processing
    Message Specification
    Message Element Name: row
    Column Value
    Element Tag
    Attribute
    Source to Data Object Field Mapping
    Key Tag name Data Object Field
    . BARCODE. BarCode.
    Added my EMS config

    Ram_J2EE_JSF wrote:
    How to accomplish this using JavaScript?Using Javascript? Well, you know, Javascript runs at the client side and intercepts on the HTML DOM tree only. The JSF code is completely irrelevant. Open your JSF page in your favourite webbrowser and view the generated HTML source. Finally just base your Javascript function on it.

  • Immutable Objects in multi threaded application - how does it works?

    Hi
    I have this code will work in multithreaded application.
    I know that immutable object is thread safe because its state cannot be changed. And if we have volatile reference, if is changed with e.g.
    MyImmutableObject state = MyImmutableObject.newInstance(oldState, newArgs); i.e. if a thread wants to update the state it must create new immutable object initializing it with the old state and some new state arguments) and this will be visible to all other threads.
    But the question is, if a thread2 starts long operation with the state, in the middle of which thread1 updates the state with new instance, what will happen? Thread2 will use reference to the old object state i.e. it will use inconsistent state? Or thread2 will see the change made by thread1 because the reference to state is volatile, and in this case thread1 can use in the first part of its long operation the old state and in the second part the new state, which is incorrect?
    Therad1:                                                  Thead2:
    State state = cache.get();     //t1                  
    Result result1 = DoSomethingWithState(state);     //t1    
                               State state = cache.get(); //t2
       ->longOperation1(state); //t1
                               Result result2 = DoSomethingWithState(state); //t2
                                   ->longOperation1(state); //t2
       ->longOperation2(state);//t1
    cache.update(result1);    //t1             
                                   ->longOperation2(state);//t2
                               cache.update(result2);//t2
    Result DoSomethingWithState(State state) {
       longOperation1(state);
       //Imaging Thread1 finish here and update state, when Thread2 is going to execute next method
       longOperation2(state);
    return result;
    class cache {
    private volatile State state = State.newInstance(null, null);
    cache.update(result) {
       this.state = State.newInstance(result.getState, result.getNewFactors);
    get(){
    return state;
    }

    Please don't cross post
    http://stackoverflow.com/questions/6803487/immutable-objects-in-multi-threaded-application-how-does-it-work

  • MI 7.1 data objects push data to backend in some sequence

    Hi all,
    Let's say we have 2 data objects with no dependency between these. If we add instances of these data objects on the client in some sequence, can we be sure that these instances will arrive on DOE in the same order and will be processed in that order? Or do we actually have to define this order with report 'DOE_MAINTAIN_DO_SYNC_ORDER' ? But i've read on this forum that this is only for backward compatibility reasons... I find it rather strange that this sequence was easily be set in MI7.O with MI_MCD, but in MI7.1 it seams not. 
    In thread Re: How to set execution preferences between Data Objects, someone says that this will be encorporated in the DOE workbench (SDOE_WB) itself. We are on MI 7.1 SP9. Is this the case then? Were can we do these settings?
    Additional question:
    Let's say there is a dependency between these 2 data objects, then i know that download request for leading data object triggers download request of following DO. Does this also define the update order from client to DOE?
    thanks in advance,
    regards
    Peter

    Hi,
    I will answer your questions in the same sequence as posted by you.
    1. If the objects have no association between them: In this case whenever on the client any change is made to an object the state of the transaction is commited to the device outbound queue. It does not matter whether Obj1 was modified or object 2. The order in which the changes are done will be the order in which the transactions will be commited to DB and the same order will be used by MI to process these messages when client syncs.
    2. In case the objects have dependency: Here also the same principle works as in 1. Having a dependency between two objects technically drills down to having referential integrity between these objects. Lets say DO1 refers to DO2 instances. Then when you are saving DO1 your application would obviously ensure that it maintains the business referential integrity to DO2 else it will not even be a valid DO1 instance in your SAP Backend.
    Thus the order in which changes are done on the client is what determines the order of processing of these instances on the server.
    Regards,
    Vikas

  • How to initialize a data object in bpm 11g?

    I created a Business Object with a few attributes,
    then a Process Data Object with the type of the Business Object,
    and tried to use it in Humantask, set it as Editable.
    but I failed editing it when starting the process, it's not editable at all, I don't know why? maybe the Process Data Object is not initialized? or something I missed?
    anyone can help? thanks.

    If you are using ADFBC, the easiest way is
    - drop the data control as ADF form
    - add CreateInsert method binding to the pagedef
    - add an invokeAction for the createInsert with a refresh property set to renderModel so that an empty creation form will be shown on page load
    for insertion
    - Finally, add the commit action as button
    Sireesha

  • Error when i drag a DATA object -- Priority

    Hi,
    I have written two function modules, which are RFC enabled in R3. In VC, when i search for them, i can see them here.
    WHen i drag the First function module, it says, reading function metadata and shows the data in the iview.
    BUT,
    when i drag the Second funciton module, it says,   "PORTAL REQUEST FAILED(no specific exception)" and will not show the data in the iview...
    How to get the DATA object on to IView..
    Anybody knows what might be the problem.
    Regards,
    Manjunatha.T.S

    Hello Pablo,
                I am also facing exactly same problem.
    initially i thought it could be a memory problem, since other modules are working fine.
    My system configuration is :-
    OS:-  Microsoft Windows 2000 server 5.00.2195 (SP 4)
    EP:-  6.0 SR1 (SP 9.0)
    VC:-  6.00.0020
    WAS:- 6.4
    Is this patch available for download.
    Will you please, let me know the location please?
    Thanks & regards,
    Sunil Kulkarni

  • Data Object Assignment for BAPI /SYCLO/CORE_MDW_SESSION1_CRT Not Found! Agentry

    Hi,
    I am facing an issue with Agentry (SMP3.0) startup. I am aware that something wrong happens on Agentry SAP Framework but I dont know how to fix it. Please help me. Thank you.
    18:56:11  - Data Object Assignment for BAPI /SYCLO/CORE_MDW_SESSION1_CRT Not Found! |
    2014 06 11 12:56:03#+0700#INFO#System.out##anonymous#Agentry Runtime Worker Thread###User::rethrowException::begin |
    2014 06 11 12:56:03#+0700#INFO#System.out##anonymous#Agentry Runtime Worker Thread###User::rethrowException::Exception caught: 11.06.2014 18:56:11  - Data Object Assignment for BAPI /SYCLO/CORE_MDW_SESSION1_CRT Not Found! |
    2014 06 11 12:56:03#+0700#INFO#System.out##anonymous#Agentry Runtime Worker Thread### |
    2014 06 11 12:56:03#+0700#INFO#System.out##anonymous#Agentry Runtime Worker Thread###User::rethrowException::COM.SYCLO.AGENTRY.AGENTRYEXCEPTION: 11.06.2014 18:56:11  - DATA OBJECT ASSIGNMENT FOR BAPI /SYCLO/CORE_MDW_SESSION1_CRT NOT FOUND! |
    2014 06 11 12:56:03#+0700#INFO#System.out##anonymous#Agentry Runtime Worker Thread### |
    2014 06 11 12:56:03#+0700#INFO#System.out##anonymous#Agentry Runtime Worker Thread### AT COM.SYCLO.SAP.BAPI.BAPIERRORHANDLER.INIT(BAPIERRORHANDLER.JAVA:68) |
    2014 06 11 12:56:03#+0700#INFO#System.out##anonymous#Agentry Runtime Worker Thread### AT COM.SYCLO.SAP.BAPI.BAPIERRORHANDLER.<INIT>(BAPIERRORHANDLER.JAVA:42) |
    2014 06 11 12:56:03#+0700#INFO#System.out##anonymous#Agentry Runtime Worker Thread### AT COM.SYCLO.SAP.BAPI.BAPI.CHECKFORERRORS(BAPI.JAVA:304) |
    2014 06 11 12:56:03#+0700#INFO#System.out##anonymous#Agentry Runtime Worker Thread### AT COM.SYCLO.SAP.BAPI.BAPI.RUN(BAPI.JAVA:184) |
    2014 06 11 12:56:03#+0700#INFO#System.out##anonymous#Agentry Runtime Worker Thread### AT COM.SYCLO.SAP.SESSIONMANAGER.CREATEREMOTEUSER(SESSIONMANAGER.JAVA:95) |
    2014 06 11 12:56:03#+0700#INFO#System.out##anonymous#Agentry Runtime Worker Thread### AT COM.SYCLO.SAP.SESSIONMANAGER.OPENSESSION(SESSIONMANAGER.JAVA:67) |
    2014 06 11 12:56:03#+0700#INFO#System.out##anonymous#Agentry Runtime Worker Thread### AT COM.SYCLO.SAP.USER.INITSESSION(USER.JAVA:693) |
    2014 06 11 12:56:03#+0700#INFO#System.out##anonymous#Agentry Runtime Worker Thread### AT COM.SYCLO.SAP.SERVER.LOGIN(SERVER.JAVA:310) |
    The same thing happen to /SYCLO/CORE_MDW_SESSION1_DEL
    I access my Agentry SAP Framework and found out that there are 3 MDOs assigned to the BAPI. Then why do they popup such exception.

    Hi Kunal,
    Below is my JavaBE.ini. Please help. Thank you very much.
    [HOST]
    server=be1.vdc.csc.com
    APPNAME=ZCH_MATERIALLIST
    [CLIENT_NUM]
    CLIENT=800
    [SYSTEM_NUM]
    SYSNUM=01
    [LOGON_METHOD]
    ; USER_AUTH if standard UID/Password authentication is used
    ; USER_AUTH_GLOBAL if pooled connections using single UID/Password is used
    ; USER_AUTH_GROUP if UID/Password authentication with SAP Message Server
    ;   (load balancing) is used
    LOGON_METHOD=USER_AUTH
    [GLOBAL_LOGON]
    ; referenced when LOGON_METHOD=USER_AUTH_GLOBAL
    ; uses a pool of connections to the SAP backend all utilizing a single
    ;    UID/password
    UID=
    UPASSWORD=
    SHAREDCONNECTION=0
    GET_PERSONNEL_INFO=
    [SERVICE_LOGON]
    ENABLED=true
    UID=hngu3
    UPASSWORD=xxxxxx
    UPASSWORDENCODED=false
    [GROUP_LOGON]
    ; referenced when LOGON_METHOD=USER_AUTH_GROUP
    ; individual user authentication using an SAP Message Server which distributes
    ; client connections among a "group" of SAP application servers based on load
    ; balancing criteria
    ; host name or IP address of SAP Message Server
    MESSAGE_SERVER=
    GROUP_NAME=
    SYSTEM_ID=
    CLIENT=
    [LANGUAGE]
    LANG=EN
    [LOGGING]
    Level=4
    [REQUIRED_BAPI_WRAPPER]
    com.syclo.sap.bapi.LoginCheckBAPI=/SYCLO/CORE_SUSR_LOGIN_CHECK
    com.syclo.sap.bapi.RemoteUserCreateBAPI=/SYCLO/CORE_MDW_SESSION1_CRT
    com.syclo.sap.bapi.RemoteParameterGetBAPI=/SYCLO/CORE_MDW_PARAMETER_GET
    com.syclo.sap.bapi.SystemInfoBAPI=/SYCLO/CORE_SYSTINFO_GET
    com.syclo.sap.bapi.ChangePasswordBAPI=/SYCLO/CORE_SUSR_CHANGE_PASSWD
    com.syclo.sap.bapi.CTConfirmationBAPI=/SYCLO/CORE_OUTB_MSG_STAT_UPD
    com.syclo.sap.bapi.DTBAPI=/SYCLO/CORE_DT_GET
    com.syclo.sap.bapi.GetEmployeeDataBAPI=/SYCLO/HR_EMPLOYEE_DATA_GET
    com.syclo.sap.bapi.GetUserDetailBAPI=/SYCLO/CORE_USER_GET_DETAIL
    com.syclo.sap.bapi.GetUserProfileDataBAPI=/SYCLO/CORE_USER_PROFILE_GET
    com.syclo.sap.bapi.PushStatusUpdateBAPI=/SYCLO/CORE_PUSH_STAT_UPD
    com.syclo.sap.bapi.RemoteObjectCreateBAPI=/SYCLO/CORE_MDW_USR_OBJ_CRT
    com.syclo.sap.bapi.RemoteObjectDeleteBAPI=/SYCLO/CORE_MDW_USR_OBJ_DEL
    com.syclo.sap.bapi.RemoteObjectGetBAPI=/SYCLO/CORE_MDW_SESSION_GET
    com.syclo.sap.bapi.RemoteObjectUpdateBAPI=/SYCLO/CORE_MDW_SESSION_UPD
    com.syclo.sap.bapi.RemoteReferenceCreateBAPI=/SYCLO/CORE_MDW_USR_KEYMAP_CRT
    com.syclo.sap.bapi.RemoteReferenceDeleteBAPI=/SYCLO/CORE_MDW_USR_KEYMAP_DEL
    com.syclo.sap.bapi.RemoteReferenceGetBAPI=/SYCLO/CORE_MDW_SESSION_GET
    com.syclo.sap.bapi.RemoteReferenceUpdateBAPI=/SYCLO/CORE_MDW_SESSION_UPD
    com.syclo.sap.bapi.RemoteSessionDeleteBAPI=/SYCLO/CORE_MDW_SESSION1_DEL
    com.syclo.sap.bapi.RemoteUserDeleteBAPI=/SYCLO/CORE_MDW_SESSION1_DEL
    com.syclo.sap.bapi.RemoteUserUpdateBAPI=/SYCLO/CORE_MDW_SESSION_UPD
    com.syclo.sap.bapi.TransactionCommitBAPI=WFD_TRANSACTION_COMMIT
    com.syclo.sap.bapi.SignatureCaptureBAPI=/SYCLO/CS_DOBDSDOCUMENT_CRT

  • How to fill depended Z-Table, created by Rapid Application Tool, with initial data?

    Hello gurus,
    I created a component ZBOOKING with RAD Tool and will fill booking detail table with initial data during a creation of new booking objekt.
    My Booking component looks like on the picture below. It was created with Rapid Application Tool and is based on one ZBOOKING Table with was created in CRM Backend and one “Booking details” Table with was created with Rapid Application.
    My Question is how should I populate initial Template-Data to this dependent “booking details” Table wenn I will create a new booking object.
    Web UI of ZBooking component
    Component structure of ZBooking
    I have tried to do sample implementation in do_init_context method of ZACL_CLASS00000C_IMPL class to fill ZBOOKING_DETAILS with some data.
    method DO_INIT_CONTEXT.
    CALL METHOD SUPER->DO_INIT_CONTEXT.
    DATA: lr_col TYPE REF TO if_bol_bo_col,
    lr_valuenode TYPE REF TO  cl_bsp_wd_value_node,
    lr_template  TYPE REF TO  ZBOOKING_DETAIL.
    CREATE DATA lr_template.
    CREATE OBJECT lr_valuenode
    EXPORTING
    IV_DATA_REF = lr_template.
    if lr_valuenode is BOUND.
    lr_valuenode->SET_PROPERTY_AS_STRING(
    iv_attr_name = 'ZZVISITDATE' "#EC NOTEXT
    iv_value     = '01.01.2014'
    ENDIF.
    CREATE OBJECT lr_col TYPE cl_crm_bol_bo_col.
    lr_col->ADD(
    exporting
    iv_entity = lr_entity
    IV_SET_FOCUS = ABAP_TRUE
    me->TYPED_CONTEXT->ZBOOKING_DETAIL->SET_COLLECTION( lr_col ).
    endmethod.
    After this implementation the initial data is displayed in “Booking details”.
    However if I press an Edit-List-button (Assignment block) I get an error “CUST Operation”.
    May be I should fill this depented table ZBOOKING_DETAILS without cl_bsp_wd_value_node?
    Where should I implement logic if I want to fill initial data just during creation of booking object and not every
    time when the booking object is called or initialized?
    Regards Dmitry

    Hi,
    I get an error "Dereferencing of the NULL reference" during created_related_entity.
    If you see on the picture below I think that I use right relation name for my zbooking_detail table.
    method DO_INIT_CONTEXT.
    CALL METHOD SUPER->DO_INIT_CONTEXT.
    data :   lr_leading_entity  TYPE REF TO cl_crm_bol_entity,
                lr_col TYPE REF TO if_bol_bo_col.
               lr_leading_entity->create_related_entity(
                      iv_relation_name = 'ZAET_CA_ATAB000000' ).
               lr_leading_entity->SET_PROPERTY_AS_STRING(
                           iv_attr_name = 'ZZVISITDATE' "#EC NOTEXT
                           iv_value     = '01.01.2014'
    lr_col->ADD(
       exporting
         iv_entity = lr_leading_entity
         IV_SET_FOCUS = ABAP_TRUE
    me->TYPED_CONTEXT->ZBOOKING_DETAIL->SET_COLLECTION( lr_col ).
    endmethod.
    Many Thanks & Regards,
    Dmitry

  • Convert RichInputDate to Date object

    Hi,
    I'm using af:inputDate in my form.
    in my backing bean i'm trying to get the value as Date object.
    public RichInputDate getFromDate() {
    return fromDate;
    public void convert(){
    Date fromDt = (Date)this.getFromDate().getValue();
    but I get this error:
    java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Date
    any idea?
    is there a simple way to get the value as Date object.
    Thanks!

    Converting RichInputDate to specific format
    https://kr.forums.oracle.com/forums/thread.jspa?threadID=2242338

  • Date object to RichInputDate

    Hello,
    How can i convert Date object to RichInputDate
    Vice versa was possible bt i want it other way round

    Converting RichInputDate to specific format
    https://kr.forums.oracle.com/forums/thread.jspa?threadID=2242338

Maybe you are looking for

  • Report of slow moving item

    Hi friends Is ther any report to see slow moving items with quantity and value. Regards, Mahesh. Edited by: Csaba Szommer on Dec 19, 2011 8:30 AM

  • Using Search Strings

    Dears We have a scenario where bank is using NTRF both for check and Bank Transfer. Only way to distinguish that it is check is that immediately after External Transaction the check number is of 6 character otherwise it is Bank Transfer. In the EBS c

  • 大家帮我看看outofmemory error on AIX 5308

    ####<Mar 4, 2009 9:57:07 AM GMT+08:00> <Error> <HTTP> <cms_appp01> <MS1> <ExecuteThread: '8' for queue: 'weblogic.socket.Muxer'> <<WLS Kernel>> <> <> <1236131827178> <BEA-101083> <Connection failure. java.lang.OutOfMemoryError      at java.net.Socket

  • CDC and OWB 10g R2 installation error

    Hi, We are using CDC (Autolog) and OWB 10g R2 for the warehouse. We have CDC installed and up and running on the database. I then try to install the OWB 10g R2 repository using OMBPlus and it fails with this error message: OWB repository installtion

  • Printing bullets problem

    Hi I love iWeb, however there are some problems I get aproblem printing my pages from the browser (Safari/firefox etc). It does not look good, but when I print from iWeb it is fine. if you look at: http://www.gestalthuset.se/Ledarutvecklingsprogram.h