How to check whether the ref-variable refers to an object or not?

Hi,
I think the topic says all!
Thanks for help!

Hi,
Just to clarify:
is bound works only in case if object variable is instantiated (is not initial).
casting to object works always.
So if we want to know also if initial variable is object reference type or not we should use casting to object.
Example:
DATA lo_my_class TYPE REF TO zcl_my_class.
DATA lo_test_object TYPE REF TO object.
TRY.
     lo_test_object ?= lo_my_class.
     WRITE 'IS OBJECT casting success'.
CATCH cx_root.
     WRITE 'IS OBJECT casting fail'.
ENDTRY.
DATA l_is_bound TYPE abap_bool.
IF ( lo_my_class IS BOUND ).
     WRITE 'IS OBJECT is bound success'.
ELSE.
     WRITE 'IS OBJECT is bound fail'.
ENDIF.
This will result in output:
IS OBJECT casting success
IS OBJECT is bound fail
Regards,
Adam

Similar Messages

  • R12.1.1 staging complete! How to check whether the stage is Good

    Hi Gurusl,
    I have completed staging R12.1.1 for Hp unix B.11.31. I want to know how to check whether the stage is good for installation or whether it is corrupted. Is there any metalink note or script from where we can check it. Ur help will be highly appreciated. Thanks in advance
    regards,

    Hi,
    Please refer to (Note: 802195.1 - MD5 Checksums for R12.1.1 Rapid Install Media).
    Regards,
    Hussein

  • How to check Whether the File is in Progress or used by some other resource

    Hi All,
    I am retrieving a file from the FTP server using Apache commons FTP.
    I need to check whether the file is fully retrieved or in progress.
    for now i can able to use the file which is partially retrieved. it is not throwing any file sharing exception or i am unable to find whether it is in progress.
    How to check whether the file is in progress ? or The file is accessed by some other resource ?
    Pls Help me.
    Thanks,
    J.Kathir

    Hi Vamsi,
    Explicitly such kind of requirement has not been catered and i dont think you would face a problem because any application that is writing to a file will open the file in the read only mode to any other simultaneous applications so i think your concerns although valid are already taken care off .
    In the remote case you still face a problem then as a work around. Tell the FTP administrator to set the property to maximum connections that can be made to ftp as one. I wonder if you have heard of the concept of FTP handle , basically the above workaround is based on that concept itself. This way only one application will be able to write.
    The file adapter will wait for its turn and then write the files.
    Regards
    joel
    Edited by: joel trinidade on Jun 26, 2009 11:06 AM

  • How to check whether the Application Server directory exits or not

    Hi,
    I have a selection screen in which I give the Application server file name(UNIX file) as input. Here, I would like to check whether the Server directory exists or not.
    Let us say, the path I gave in the selection screen is /usr/sap/tmp/testfile.txt . Here, the file name is testfile.txt and the server directory is /usr/sap/tmp . I would like to check whether this directory /usr/sap/tmp exists in the server or not. I am not bothered about the file name as I am going to write data into the file. I am mainly concerned about whether the directory exists in the server or not. and one more thing... this is the Application Server path not the Local path.
    Can anyone help me on the same how to check whether the server directory exists or not.
    Thanks in advance.
    Best Regards,
    Pradeep.

    Also you can use the FM EPS_GET_DIRECTORY_LISTING for this purpose.
      Store the directory name
        l_dpath = p_file+0(l_no).
      Validate the directory of the application server
        CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
          EXPORTING
            dir_name               = l_dpath
          TABLES
            dir_list               = l_i_dlist
          EXCEPTIONS
            invalid_eps_subdir     = 1
            sapgparam_failed       = 2
            build_directory_failed = 3
            no_authorization       = 4
            read_directory_failed  = 5
            too_many_read_errors   = 6
            empty_directory_list   = 7
            OTHERS                 = 8.
      If any problem occurs with the directory then display proper
      error message
        IF sy-subrc <> 0.
        Display error message
          MESSAGE e018 WITH 'Problem with directory entered'(008).
        ENDIF. " sy-subrc <> 0
    Regards,
    Joy.

  • Oracle AS Web Cache - How to check whether the request goes throught it ?

    Hi,
    My application runs on Oracle 10g App Server,
    The OracleAS Web Cache is also running
    the command opmnctl status shows...
    WebCache - Alive
    WebCacheAdmin - Alive
    Is there any way to check whether the request form the client goes through the Web Cache ?
    B'coz when i checked OracleAS Web Cache Administrator UI
    The information like Total Requests Served, Cahce Hit , Cache Misses etc are 0 and it does'nt changes...
    I have the directive keepAlive as[b] off in httpd.conf, will this have an impact over Web Cache ???
    Plz suggest me a way to check whether the request goes through Web Cache or directly to Oracle HTTP Server ??
    Deepak.C

    Keepalive has no impact on webcache, but it does have a huge impact on performance. So far I found no proper reason to put it off in any production system.
    Anyway, logging from webcache and/or apache (ias) should show how requests are going from the client to the AS.

  • How to check whether the browser supports cookie using servlet

    Hi
    I have a servlet that uses session.I want to check whether the browser supports cookie.
    Please help me how can i detect this using servlet.
    could you please include a sample code
    thanks
    sabu

    You can check whether any cookies were sent in the request to your servlet:
    Cookie cookies[] = request.getCookies();
    if cookies is not null (cookies != null) then the browser sending you the request suppoerts cookies.
    If it is null then you would need to do a little extra work. Basically add a cookie to the response going back to the browser. Then send a redirect back to this same servlet. You then would have to add code to check to see whether the cookie was sent back.
    // Servlet named myServlet
    String test = request.getParameter("TEST");
    Cookie cookies[] = request.getCookies();
    if (test == null || !test.equals("TRUE")
    if (cookies == null)
    response.addCookie("testCookies","testCookies");
    response.sendRedirect("myServlet?TEST=TRUE");
    else
    // cookies were sent in the initial request, so
    // browser supports cookies
    else
    // This is the redirect. Check the for the presence of
    // our testCookie
    Hope this helps.

  • How to check whether the system has eclipse environment: urgent

    Hi gurus
    can you please tell me how to check whether my crm system has eclipse envirionment.
    Thanks
    shashi

    There is no way to check whether a system is used productively or not, I believe what you mean is checking a client is productive or not in an ABAP-stack based system. Remember although a SAP ABAP system is identified by a SID but from a business perspective the system is recognized by a client, as it is a unique business identity.
    Thus, to check whether the client is productive or not in txn SCC4 check the role of the client, it will show you the correct status. The data of SCC4 is stored in table T000, you can also opt to check that.
    - Regards, Dibya

  • How to check whether the vendor invoice was reversed (MR8M & FB08)

    hi,
    need to check whether the vendor invoice has been reversed. Posting of the vendor invoice as well as its reversal may happen in FI (e.g. FB60 - FB08) and MM (MIRO - MR8M).  have developed a custom function based on the values of the fields: stblg, stjah,... (for fb08) and rebzg, rebzj,rebzz (for mr8m) and trans type but not sure this is the right way.
    Is there a bapi (e.g. similar to BAPI_ACC_INVOICE_REV_CHECK) , sap function or at least a report to as a sample. Any help appreciated.
    Thank you,
    victor

    Viktor, We have always used the table fields values you have listed to determine if the invoice has been reversed or cancelled...

  • How to check whether the current snapshot is validated?

    I have removed some articles of my publication in transactional replication. I use the script below, and contrary to what I have found in documentation, it does not invalidate the snapshot of that publication.
    I normally test this by running the snapshot agent, which, after about 12 seconds, tells me that there is no need to run a full snapshot.
    How can I test whether the snapshot is good, without running it?
    I don't want to run it, because if it is not good, I don't want to stop it in the middle, and I don't want to run it during the office hours.
    thanks and regards
    Marcelo
    -- the script to remove an article from the replication is: (1) and (2) below:
    -- to be run at the publisher (in this case SERVER MYSERVER - DATABASE MYDATABASE
    -- (1)
    --use [MYDATABASE]
    --exec sp_dropsubscription @publication = N'MYPUBLICATION', @article = N'tblTaxTransaction', @subscriber = N'all', @destination_db = N'all'
    --GO
    -- (2)
    --use [MYDATABASE]
    --exec sp_droparticle @publication = N'MYPUBLICATION', @article = N'tblTaxTransaction', @force_invalidate_snapshot = 1
    --GO
    --[ @force_invalidate_snapshot = ] force_invalidate_snapshot
    --Acknowledges that the action taken by this stored procedure may invalidate an existing snapshot. 
    --force_invalidate_snapshot is a bit, with a default of 0.
    --0 specifies that changes to the article do not cause the snapshot to be invalid. 
    --If the stored procedure detects that the change does require a new snapshot, an error occurs 
    --and no changes are made.
    --1 specifies that changes to the article may cause the snapshot to be invalid, 
    --and if there are existing subscriptions that would require a new snapshot, 
    --gives permission for the existing snapshot to be marked as obsolete and a new snapshot generated.

    Hi Lydia,
    in fact I could not find anything to let me know if the snapshot is valid, whether or not it will have to be re-snap when I add or remove an article from it.
    however, I found out that 
    running Exec sp_helppublication against your publication database and checking immediate_sync and allow_anonymous options --->  If they are set to 1 then every time you add a new article
    it will cause the entire snapshot to be applied.
    You can disable them using sp_changepublication: Exec sp_changepublication @publication = ' publication db' @property=N'allow_anonymous', @value='false' Go Exec sp_changepublication @publication
    = ' publication db' @property=N'immediate_sync', @value='false' go

  • How to check whether the user has a certificate or not?

    Hi everyone.
    We're currently finishing a web project and the last step is to check whether users accessing the application have a valid certificate or not.
    Users with a valid certificate can access all the data. Users without any certificate installed on their browsers may still proceed, but they won't be able to see all data. Please note that the lack of a certificate doesn't mean an error - it's just another use case.
    Is there any way to check whether users have a certificate installed on their browsers?
    Thanks in advance.
    Edit: sorry, I forgot to post some tech details. We're using Struts 1.2 on a Tomcat 5 app server.
    Message was edited by:
    advaca

    I am not sure how Tomcat handles this, but you need to use two-way (mutual authentication) request but not enforce SSL between Tomcat and the client browser. This will make the browser prompt the user for the cert they want to send. Then you'll need to tackle the other part of your problem, getting the correct content displayed depending on whether the user sent a cert or not. I'm even less help there than I was on the first part of your question.
    So, yeah - good luck with that
    Lee

  • How to check whether the report is being called or not

    Iam using srw.run_report.for calling another report. I have registered both the report in oracle apps11.0.3. When i run the master report in oracle apps I want to see whether the second report is called or not. How to check this.
    Thanks.

    try to check it in C:\Reports6i\Bin
    C:\Reports6i\Bin <-- this may varry depending on the location of your reports.
    btw, are you generating a pdf file?

  • How to check whether the Resultset is empty or not ??

    I wanna check whether my Result set is empty or not ( I don't want the no of rows it contains..) i'm using this function...
    boolean result=myResultSet.isAfterLast() | myResultSet.isBeforeFirst() ;
    if (result == true)
    {//Result Set is populated
    else
    {//ResultSet Blank
    Is it ok to do like this ?? Or is there any other functanality to do this, since in big appl..i'm using it more than 10-15 times & it's working fine evrywhere except for one jsp where it is returing TRUE everytime ...
    Help Appreciated !!

    try,
    rs = pstmt.executeQuery();
    boolean b = false;
    if( b = rs.next() ) {
    while( b ) {
    //... rs.getXXX( YYY );
    b = rs.next();
    else {
    //...empty rs processing
    or,
    ResultSet rs = ps.executeQuery();
    if(rs.next()) {
    do {
    System.out.println(rs.getString(1));
    } while(rs.next());
    } else {
    System.out.println('empty result set');
    but I usually avoid using do...while although this may be an exception.

  • How to check whether the particular schema(user) is having import privilege

    Hi,i need to check whether a particular schema(user) is having privilege to import the data to target database within the same database(10 g)

    Answer is in the documentation - which is pretty easy to look up -
    http://docs.oracle.com/cd/E11882_01/server.112/e22490/dp_import.htm#i1007024
    http://docs.oracle.com/cd/E11882_01/server.112/e25513/statviews_5406.htm#REFRN26230
    HTH
    Srini

  • How to check whether the Application Server file has already been opened?

    Hi Experts,
    I have a query related to Application Server file. I am using multithreading concept to process the data and write it in to a single file.
    For example, I have 4 workprocesses. Each workprocess will process the data and whenever it has a record available it will access the file and write it directly.
    Problem is the statements that are written in the workprocess is same and I want to check the status whether the file has been opened or not ?
    Thanks in advance!!!
    Thanks,
    Babu Kilari

    Depends on the structure, and whether the data needs to be sorted in some way in the final file.
    In any case, I don't think there will be a significant performance difference between using OPEN DATASET again and getting funny with Unix commands.
    If you don't need to sort the final file, you can use strings to read, concatenate and write the data even without line-based DO ENDDO loops, this works pretty fast.
    I hope we are not talking about GBytes of data
    Thomas

  • How to check whether the Workflow event is triggered or not ?

    Hello All,
        My scenario is like this :
    1. Go to MM02
    2. Change a material of any view other than the classification.
    3. Save it.
    4. Go to transaction SWEL and check there .
    5. An entry has been created in that across the object type Y01BUS1001.
    6. Now I can check in the Transaction CFG1 the Log details.
    7. This is correct.
    8. Now the same procedure is not working when I change the material for the classification View.
    9. Do i need to check something else ?
    10. When the classification data is changed for a material the Object type Y01BUS1003 has to be triggered.
    Can any one help me out ?
    Regards,
    Deepu.K

    Hi,
    If you are using the Event collector, you can check in from RSA1-> Tools-> Event collector. You cannot trace whether that event was raised from anywhere I think
    Regards

Maybe you are looking for